[issue13966] Add disable_interspersed_args() to argparse.ArgumentParser
Christophe Kalt k...@taranis.org added the comment: nice, thank you! -- nosy: +kalt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13966 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13922] argparse handling multiple -- in args improperly
Christophe Kalt k...@taranis.org added the comment: Hah.. was just about to report this. I'm in the midst of converting a bunch of scripts from optparse to argparse, and this is one of the problems I'm hitting. -- nosy: +kalt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13922 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10949] logging.RotatingFileHandler not robust enough
New submission from Christophe Kalt k...@taranis.org: logging.RotatingFileHandler.doRollover() can fail leaving the handler with a closed filehandle, causing all subsequent logging attempts to fail: import logging import logging.handlers logging.getLogger().addHandler(logging.handlers.RotatingFileHandler('testlog', None, 10, 5)) logging.getLogger().setLevel(logging.INFO) logging.info('qwertyuiop') os.system('ls -l testlog*') -rw-r--r-- 1 - - 11 Jan 19 10:02 testlog -rw-r--r-- 1 - - 0 Jan 19 10:02 testlog.1 0 os.remove('testlog') logging.info('qwertyuiop') Traceback (most recent call last): File /home8/taraniso/opt/lib/python2.6/logging/handlers.py, line 72, in emit self.doRollover() File /home8/taraniso/opt/lib/python2.6/logging/handlers.py, line 129, in doRollover os.rename(self.baseFilename, dfn) OSError: [Errno 2] No such file or directory logging.info('qwertyuiop') Traceback (most recent call last): File /home8/taraniso/opt/lib/python2.6/logging/handlers.py, line 71, in emit if self.shouldRollover(record): File /home8/taraniso/opt/lib/python2.6/logging/handlers.py, line 145, in shouldRollover self.stream.seek(0, 2) #due to non-posix-compliant Windows feature ValueError: I/O operation on closed file logging.info('qwertyuiop') Traceback (most recent call last): File /home8/taraniso/opt/lib/python2.6/logging/handlers.py, line 71, in emit if self.shouldRollover(record): File /home8/taraniso/opt/lib/python2.6/logging/handlers.py, line 145, in shouldRollover self.stream.seek(0, 2) #due to non-posix-compliant Windows feature ValueError: I/O operation on closed file Fix seems trivial enough, attaching. This is against 2.6.5, browsing subversion online seems to indicate it is needed on the trunk as well, although it won't apply cleanly. -- components: Library (Lib) files: logging.diff keywords: patch messages: 126541 nosy: kalt priority: normal severity: normal status: open title: logging.RotatingFileHandler not robust enough type: behavior versions: Python 2.6, Python 2.7, Python 3.1 Added file: http://bugs.python.org/file20454/logging.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8893] file.{read,readlines} behaviour on Solaris
Christophe Kalt k...@taranis.org added the comment: I haven't had a chance to build Python to check, but from the test output I suspect the problem to be different on FreeBSD. -- Added file: http://bugs.python.org/file17750/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8893 ___I haven#39;t had a chance to build Python to check, but from the test output I suspect the problem to be different on FreeBSD.br ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8893] file.{read,readlines} behaviour on Solaris
Christophe Kalt pyt...@ote.taranis.org added the comment: This is on Solaris 10, but I also see it on Solaris 8 w/ Python 2.4. Just tried Python 3.6.1, and it doesn't seem to have that problem. Python 2.7b2 has the problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8893 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8893] file.{read,readlines} behaviour on Solaris
Christophe Kalt pyt...@ote.taranis.org added the comment: Antoine: I'm not sure what the expected behaviour should be either, this is certainly for others more familiar with Python than I to decide. Although I am certainly annoyed that the current behaviour differs between Solaris and Linux. Haven't had time to check other platforms to see how things should be. Also, the behaviour seems inconsistent between the various file methods on Solaris which seems wrong. Finally, from looking into fileobject.c, clearerr() is used in most places and the omissions (corrected by my patch) do seem unintentional to me, e.g. bugs. Hope this helps. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8893 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8893] file.{read,readlines} behaviour on Solaris
Christophe Kalt k...@taranis.org added the comment: FreeBSD is yet another beast: $ uname -rs FreeBSD 8.0-STABLE $ python -V Python 2.5.5 $ python readlines.py read : [] readlines: [] readline : -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8893 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8893] file.{read,readlines} behaviour on Solaris
New submission from Christophe Kalt pyt...@ote.taranis.org: The following snippet of code is a concise way to exhibit the problem: import os wr = open('/tmp/test', 'w') wr.write('oink\noink\n') rd = open('/tmp/test', 'r') rdlns = open('/tmp/test', 'r') # first, read til EOF is reached (which is right away) assert len(rd.read()) == 0 assert len(rdlns.readlines()) == 0 # add data to the file wr.flush() # try to read again print 'read : ', rd.read().split() # fails print 'readlines: ', rdlns.readlines() # fails print 'readline : ', rdlns.readline().strip() # succeeds # cleanup wr.close() rd.close() rdlns.close() os.remove('/tmp/test') On Linux, here is the output: $ python2.6 src/readlines.py read : ['oink', 'oink'] readlines: ['oink\n', 'oink\n'] readline : On Solaris, here is the output: $ python src/readlines.py read : [] readlines: [] readline : oink The problems comes from the fact that once EOF is reached, nothing more will be read from the file on subsequent reads, as noted in the manual page (http://docs.sun.com/app/docs/doc/816-5168/getchar-3c?a=view): If the stream is at end-of-file, the end-of-file indicator for the stream is set and these functions return EOF. For standard-conforming (see standards(5)) applications, if the end-of-file indicator for the stream is set, these functions return EOF whether or not the stream is at end-of-file. The attached diff fixes the problem. -- assignee: theller components: ctypes files: fileobject.diff keywords: patch messages: 106999 nosy: kalt, theller priority: normal severity: normal status: open title: file.{read,readlines} behaviour on Solaris type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file17542/fileobject.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8893 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1734346] patch for bug 1170311 zipfile UnicodeDecodeError
Christophe Kalt [EMAIL PROTECTED] added the comment: Any chance of this making it in sometime? The current behaviour is rather limiting/annoying. -- nosy: +kalt _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1734346 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com