python-tee icon indicating copy to clipboard operation
python-tee copied to clipboard

Not for Python 3 ?!?

Open jedie opened this issue 6 years ago • 3 comments

setup.py has only:

"Programming Language :: Python :: 2.7",

See: https://github.com/algrebe/python-tee/commit/75582710ea0bc5e52614393c90803a6edcb84396#r30382013

jedie avatar Sep 04 '18 08:09 jedie

Seems it didn't work with Python 3:

    with tee.StdoutTee(log_file_path):
  File "/usr/local/lib/python3.6/site-packages/tee/tee.py", line 69, in __enter__
    self.fp = open(self.filename, self.mode, self.buff)
ValueError: can't have unbuffered text I/O

that's a pity

jedie avatar Sep 04 '18 08:09 jedie

@jedie Thanks for reporting this!

Looks like version specific code might have to be written for the call to open.

algrebe avatar Sep 04 '18 15:09 algrebe

It's actually just a bad default value. If you set buff=-1 (which is the default in python 2 & 3 and therefore imho should be the default here) it works fine under python 3.

maxgrenderjones avatar Apr 26 '20 22:04 maxgrenderjones