> On 20 Dec 2019, at 15:31, Dr Rainer Woitok wrote:
>
> Greetings,
>
> One of my Python scripts basically does the following:
>
> source = tarfile.open(name=tar_archive , mode='r|*')
> dest = tarfile.open(fileobj=sys.stdout, mode='w|', format=fmt)
>
> .
> .
> .
>
> source.close()
>
Chris,
On Saturday, 2019-12-21 06:45:24 +1100, you wrote:
> ...
> This construct can be simplified down to:
>
> stdout = getattr(sys.stdout, "buffer", sys.stdout)
Nice! And with my admittedly trivial test case it correctly works under
both, Python 2 and Python 3.
Now I'll do some more
On Sat, Dec 21, 2019 at 6:13 AM Peter Otten <__pete...@web.de> wrote:
>
> Dr Rainer Woitok wrote:
>
> > Ethan,
> >
> > On Friday, 2019-12-20 07:41:51 -0800, you wrote:
> >
> >> ...
> >> In Python 3 `sys.stdout` is a character interface, not bytes.
> >
> > Does that mean that with Python 3
Dr Rainer Woitok wrote:
> Ethan,
>
> On Friday, 2019-12-20 07:41:51 -0800, you wrote:
>
>> ...
>> In Python 3 `sys.stdout` is a character interface, not bytes.
>
> Does that mean that with Python 3 "Tarfile" is no longer able to write
> the "tar" file to a pipe? Or is there now another
Ethan,
On Friday, 2019-12-20 07:41:51 -0800, you wrote:
> ...
> In Python 3 `sys.stdout` is a character interface, not bytes.
Does that mean that with Python 3 "Tarfile" is no longer able to write
the "tar" file to a pipe? Or is there now another way to write to a
pipe? And if that new
On 12/20/2019 04:19 AM, Dr Rainer Woitok wrote:
One of my Python scripts basically does the following:
source = tarfile.open(name=tar_archive , mode='r|*')
dest = tarfile.open(fileobj=sys.stdout, mode='w|', format=fmt)
.
.
.
source.close()
dest.close()
In an attempt to move my
On Sat, Dec 21, 2019 at 2:29 AM Dr Rainer Woitok
wrote:
>
> Greetings,
>
> One of my Python scripts basically does the following:
>
> source = tarfile.open(name=tar_archive , mode='r|*')
> dest = tarfile.open(fileobj=sys.stdout, mode='w|', format=fmt)
>
> .
> .
> .
>
> source.close()
>
Greetings,
One of my Python scripts basically does the following:
source = tarfile.open(name=tar_archive , mode='r|*')
dest = tarfile.open(fileobj=sys.stdout, mode='w|', format=fmt)
.
.
.
source.close()
dest.close()
In an attempt to move my Python scripts from Python 2.7 to Python 3.6