This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients hathawsh, martin.panter, vstinner, ztane
Date 2016-08-20.12:36:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
Antti Haapala added the comment:
> Presumably the case was that a *named* log file is opened with 'a' mode, and one could pass '/dev/stdout' just like any other name of a file, and it did work, but not in Python 3.5.

Oh ok, in this case, you need something smarter like:

mode = 'a' if not stat.S_ISCHR(os.stat(filename).st_mode) else 'w'
fp = open(filename, mode)

or something like (emulate append mode, but catch ESPIPE):

fp = open(filename, 'w')
try:, os.SEEK_END)
except OSError as exc:
  if exc.errno != errno.ESPIPE: raise
Date User Action Args
2016-08-20 12:36:06vstinnersetrecipients: + vstinner, hathawsh, martin.panter, ztane
2016-08-20 12:36:06vstinnerlinkissue27805 messages
2016-08-20 12:36:06vstinnercreate