Re: logging.FileHandler diff Py2 v Py3

2018-04-05 Thread Skip Montanaro
> I'll poke around a little and maybe open a bug report if I can't find any > explanation for the change in behavior. Turns out to be a known problem with a bit of history: https://bugs.python.org/issue27805 Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Skip Montanaro
> > >> I think the culprit is io.open() rather than the logging module. Why > does > Thanks, Peter. It never even occurred to me to look at the source code around the call. I saw open() and thought "built-in open". I forgot that the io package supplanted a bunch of lower level i/o. I'll poke arou

Re: logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Peter Otten
Paul Moore wrote: > On 3 April 2018 at 17:54, Peter Otten <__pete...@web.de> wrote: >> I think the culprit is io.open() rather than the logging module. Why does >> > io.open("/dev/stderr", "a") >> Traceback (most recent call last): >> File "", line 1, in >> OSError: [Errno 29] Illegal seek

Re: logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Paul Moore
On 3 April 2018 at 17:54, Peter Otten <__pete...@web.de> wrote: > I think the culprit is io.open() rather than the logging module. Why does > io.open("/dev/stderr", "a") > Traceback (most recent call last): > File "", line 1, in > OSError: [Errno 29] Illegal seek > > even try to seek()? Be

Re: logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Peter Otten
Skip Montanaro wrote: > I've encountered a problem in an application I'm porting from Python > 2.7 to 3.6. The logginng.FileHandler class likes "/dev/stderr" as a > destination in Python 2, but complains in Python 3. > > Python 2.7.14: > import logging logging.FileHandler("/dev/stderr"

logging.FileHandler diff Py2 v Py3

2018-04-03 Thread Skip Montanaro
I've encountered a problem in an application I'm porting from Python 2.7 to 3.6. The logginng.FileHandler class likes "/dev/stderr" as a destination in Python 2, but complains in Python 3. Python 2.7.14: >>> import logging >>> logging.FileHandler("/dev/stderr") Python 3.6.4: >>> import logging