[issue1445] SystemError accessing uninitialised cell contents
New submission from Duncan Booth: The following code throws a SystemError exception. cell_get_contents in Objects\cellobject.c should check for a null op->ob_ref value and throw an appropriate exception. >>> def oops(): def f(): cell f.func_closure[0].cell_contents cell = None >>> oops() Traceback (most recent call last): File "", line 1, in oops() File "", line 3, in oops f.func_closure[0].cell_contents SystemError: error return without exception set >>> -- components: Interpreter Core messages: 57525 nosy: duncanb severity: normal status: open title: SystemError accessing uninitialised cell contents type: behavior versions: Python 2.5, Python 2.6 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1445> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11272] input() has trailing carriage return on windows
Duncan Booth added the comment: > If anyone knows how to reproduce the two bugs with a short Python > script, I can try to convert it into a test. If you don't mind kicking off some sub-processes then here's a script that shows the bugs. I couldn't figure out how to do a script that would work on Python 3.1 but fail on Python 3.2, because I think to show the problem you have to use the shell to pipe data and Popen on Python 3.1 quotes the pipe character. -- Added file: http://bugs.python.org/file20857/stdintests.py ___ Python tracker <http://bugs.python.org/issue11272> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11272] input() has trailing carriage return on windows
New submission from Duncan Booth : In Python 3.2, the builtin function `input()` returns a string with a trailing '\r' on windows: C:\Python32>python Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> print(repr(input())) test 'test\r' >>> This breaks code that expects the string to be stripped, e.g. 'pydoc.py -b' doesn't recognise its commands: C:\Python32>python lib\pydoc.py -b Server ready at http://localhost:4680/ Server commands: [b]rowser, [q]uit server> q Server commands: [b]rowser, [q]uit server> b Server commands: [b]rowser, [q]uit server> -- components: Interpreter Core, Windows messages: 128964 nosy: duncanb priority: normal severity: normal status: open title: input() has trailing carriage return on windows type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue11272> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11272] input() has trailing carriage return on windows
Duncan Booth added the comment: Yes, it does indeed look like stdin has been opened in binary mode. Just iterating over it also gives the spurious carriage returns: C:\Python32>python Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> for line in sys.stdin: ... print(repr(line)) ... hello 'hello\r\n' ^Z >>> -- ___ Python tracker <http://bugs.python.org/issue11272> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2417] [py3k] Integer floor division (//): small int check omitted
Changes by Duncan Booth <[EMAIL PROTECTED]>: -- nosy: +duncanb __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2417> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com