[issue7643] What is an ASCII linebreak?
New submission from Florent Xicluna la...@yahoo.fr: Bytes objects and Unicode objects do not agree on ASCII linebreaks. ## Python 2 for s in '\x0a\x0d\x1c\x1d\x1e': print u'a{}b'.format(s).splitlines(1), 'a{}b'.format(s).splitlines(1) # [u'a\n', u'b'] ['a\n', 'b'] # [u'a\r', u'b'] ['a\r', 'b'] # [u'a\x1c', u'b'] ['a\x1cb'] # [u'a\x1d', u'b'] ['a\x1db'] # [u'a\x1e', u'b'] ['a\x1eb'] ## Python 3 for s in '\x0a\x0d\x1c\x1d\x1e': print('a{}b'.format(s).splitlines(1), bytes('a{}b'.format(s), 'utf-8').splitlines(1)) ['a\n', 'b'] [b'a\n', b'b'] ['a\r', 'b'] [b'a\r', b'b'] ['a\x1c', 'b'] [b'a\x1cb'] ['a\x1d', 'b'] [b'a\x1db'] ['a\x1e', 'b'] [b'a\x1eb'] -- components: Interpreter Core messages: 97299 nosy: flox severity: normal status: open title: What is an ASCII linebreak? type: behavior versions: Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7643 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7643] What is an ASCII linebreak?
Marc-Andre Lemburg m...@egenix.com added the comment: Florent Xicluna wrote: New submission from Florent Xicluna la...@yahoo.fr: Bytes objects and Unicode objects do not agree on ASCII linebreaks. ## Python 2 for s in '\x0a\x0d\x1c\x1d\x1e': print u'a{}b'.format(s).splitlines(1), 'a{}b'.format(s).splitlines(1) # [u'a\n', u'b'] ['a\n', 'b'] # [u'a\r', u'b'] ['a\r', 'b'] # [u'a\x1c', u'b'] ['a\x1cb'] # [u'a\x1d', u'b'] ['a\x1db'] # [u'a\x1e', u'b'] ['a\x1eb'] ## Python 3 for s in '\x0a\x0d\x1c\x1d\x1e': print('a{}b'.format(s).splitlines(1), bytes('a{}b'.format(s), 'utf-8').splitlines(1)) ['a\n', 'b'] [b'a\n', b'b'] ['a\r', 'b'] [b'a\r', b'b'] ['a\x1c', 'b'] [b'a\x1cb'] ['a\x1d', 'b'] [b'a\x1db'] ['a\x1e', 'b'] [b'a\x1eb'] Unicode has more line break characters defined than ASCII, which only has a single line break character \n, but also uses the conventions \r and \r\n for meaning start a new line, go to position 1. See e.g. http://en.wikipedia.org/wiki/Ascii#ASCII_control_characters The three extra code points Unicode defines for line breaks are group separators that are not in common use. -- nosy: +lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7643 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7644] bug in nntplib.body() method with possible fix
New submission from Michael Mullins pabloonbr...@gmail.com: When using NNTP.body(id,file) I get the following repeatable error: Traceback (most recent call last): File stdin, line 1, in module File nntplib.py, line 436, in body return self.artcmd('BODY {0}'.format(id), file) File nntplib.py, line 410, in artcmd resp, list = self.longcmd(line, file) File nntplib.py, line 267, in longcmd return self.getlongresp(file) File nntplib.py, line 249, in getlongresp file.write(line + b'\n') File /usr/lib/python3.0/io.py, line 1478, in write s.__class__.__name__) TypeError: can't write bytes to text stream But by simply changing the line openedFile = file = open(file, w) ...to... openedFile = file = open(file, wb) ...in the following code: def getlongresp(self, file=None): Internal: get a response plus following text from the server. Raise various errors if the response indicates an error. openedFile = None try: # If a string was passed then open a file with that name if isinstance(file, str): openedFile = file = open(file, wb) ...it seems to fix the problem. I discovered this in 3.0, but downloading and inspecting the source for 3.1 shows the same problem. MDMullins -- messages: 97301 nosy: mdmullins severity: normal status: open title: bug in nntplib.body() method with possible fix versions: Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7644 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7644] bug in nntplib.body() method with possible fix
Changes by Michael Mullins pabloonbr...@gmail.com: -- components: +Library (Lib) type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7644 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7640] buffered io seek() buggy
Pascal Chambon chambon.pas...@gmail.com added the comment: My bad, I had looked at _buffered_raw_seek, not buffered_seek _ Indeed, the code is OK in both trunk _io an _pyio modules. And the SEEK_CUR flag (value : 1) seems more than sufficiently tested in test_io actually, for example in the function write_ops() : http://svn.python.org/view/python/trunk/Lib/test/test_io.py?view=markup So concerning python2.6, isn't that just possible to backport _pyio (and its test suite) to it (renamed as io.py) ? They seem to offer the same functionality, except that _pyio is much more robust than io.py (the code around seek(), in particular, is much more complete). Just tell me, else I'll gather a patch for the seek() problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7640 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7640] buffered io seek() buggy
Antoine Pitrou pit...@free.fr added the comment: So concerning python2.6, isn't that just possible to backport _pyio (and its test suite) to it (renamed as io.py) ? I would not be against it, but someone has to provide a patch. The current _pyio.py might rely on other new behaviour of 2.7, so perhaps it won't be that easy. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7640 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7633] decimal.py: type conversion in context methods
Mark Dickinson dicki...@gmail.com added the comment: Thanks for the patch! Rather than using the Decimal constructor, I think you should convert use _convert_other(..., raiseit=True): the Decimal constructor converts strings and tuples, as well as ints and longs, while _convert_other only converts ints and longs. Note also that the conversion shouldn't depend on the current context; only the operation itself needs that. Maybe it would be worth adding some tests to ensure that e.g., MyContext.add('4.5', 123) raises TypeError as expected? I agree with the observation that it's usually only necessary to convert the first argument (since the Decimal method itself converts the second). If you like, you could also usefully deal with the NotImplemented return value by turning it into a TypeError (i.e., in the context method, check for a NotImplemented return value, and raise TypeError there if necessary). This is only needed for the double underscore methods __add__, __sub__, etc. associated with Python's binary operators; the other methods shouldn't ever return NotImplemented. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7640] buffered io seek() buggy
Pascal Chambon chambon.pas...@gmail.com added the comment: Hum, with a selective merge (tortoiseSVN makes it easy), backporting _pyio should be doable in a decent time. Triaging pertinent tests should be more brain damaging :p I'm looking at this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7640 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7644] bug in nntplib.body() method with possible fix
R. David Murray rdmur...@bitdance.com added the comment: ('crash' is for the interpreter crashing) Unfortunately there currently are no unit tests for nntplib. Unless someone feels like creating an nntp test framework we may have to commit this fix without a test. -- keywords: +easy nosy: +r.david.murray priority: - normal stage: - test needed type: crash - behavior versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7644 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7640] buffered io seek() buggy
Pascal Chambon chambon.pas...@gmail.com added the comment: Well, here is a patch for the seek() methods of io module, in python2.6 maintenance branch. Finally, I've only backported some assertions and the offset stuffs - I'm not comfortable enough about recent io refactorings to do more (it changed pretty quickly while I looked away, actually :p). Tests have been patched too (bufferedrandom wasn't tested as other buffer classes), and to have the whole suite pass, I had to modify testWriteNonBlocking() as well (mock objects returned wrong values - this test is marked as unreliable in sources anyway). If more is needed to patch the py2.6 branch, just tell me B-) -- keywords: +patch Added file: http://bugs.python.org/file15759/seek_cur_buffers_py26.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7640 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7627] mailbox.MH.remove() lock handling is broken
Changes by A.M. Kuchling li...@amk.ca: -- assignee: - akuchling nosy: +akuchling ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7627 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions
Changes by A.M. Kuchling li...@amk.ca: -- assignee: georg.brandl - akuchling ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5368 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7633] decimal.py: type conversion in context methods
Mark Dickinson dicki...@gmail.com added the comment: Thanks for the missing divmod docstring, too: I've applied this separately, partly because it needs to go into 2.6 and 3.1 as well as 2.7 and 3.2, and partly as an excuse to check that the new py3k-cdecimal branch is set up correctly. See revisions r77324 through r77327. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7601] Installation - 2 tests failed: test_cmd_line test_xmlrpc
Jozef Gáborík jozef.gabo...@gmail.com added the comment: Thank you! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7601 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7601] Installation - 2 tests failed: test_cmd_line test_xmlrpc
Ezio Melotti ezio.melo...@gmail.com added the comment: Thanks to you for the report :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7601 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6299] pyexpat build failure on Solaris 10 for 2.6.1/2.6.2
Tim Mooney enchan...@users.sourceforge.net added the comment: This still happens in 2.6.3 and 2.6.4 so I spent some time looking at it. It's happening because of a combination of issues, but ultimately it's because python's build isn't making certain that it's including its private copy of expat.h and expat_external.h. Basically, this -DHAVE_EXPAT_CONFIG_H=1 -DUSE_PYEXPAT_CAPI -I/local/src/RPM/BUILD/Python-2.6.4/./Modules/expat should *precede* CFLAGS, rather than coming after it. To reproduce: - install expat 2.0.1 under /usr/local or /opt (or any prefix other than just /usr) - include -I$prefix/include in CFLAGS when configuring Python - make This results in the special includes for python's local copy of the expat sources being *after* the -I/usr/local/include on the command line, so the copy of expat.h and expat_external.h in /usr/local/include are found first, and that causes the link failure when generating pyexpat.so. Note that it's not just as simple as not including -I/usr/local/include in CFLAGS, because there may be other locally-installed packages that python should be finding to build other modules. The real fix is for Python's build machinery to make certain that the special includes for Python's private expat sources precede CFLAGS. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6299 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6067] make error
Georg Brandl ge...@python.org added the comment: Closing due to lack of response. -- nosy: +georg.brandl resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6067 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5959] PyCode_NewEmpty
Georg Brandl ge...@python.org added the comment: PyCode_NewEmpty has been merged in r74132. -- nosy: +georg.brandl status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5959 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5954] PyFrame_GetLineNumber
Georg Brandl ge...@python.org added the comment: This was merged in r74132. -- nosy: +georg.brandl status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5954 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5991] Add non-command help topics to help completion of cmd.Cmd
Georg Brandl ge...@python.org added the comment: Thanks for the patch; applied and fixed up a bit in r77332. -- nosy: +georg.brandl resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5991 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5950] zimport doesn't work with zipfile containing comments
Georg Brandl ge...@python.org added the comment: Yes, comments are not supported right now. Documented this in r77333, and turning this issue into a feature request for adding that support. -- nosy: +georg.brandl type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5950 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7633] decimal.py: type conversion in context methods
Juan José Conti jjco...@gmail.com added the comment: New patch. Fix Context.method that were returning NotImplemented. Decimal.__methods__ don't use raiseit=True in _convert_other so I check in Context.method and raise TypeError if necessary. Added tests for Context.divmod missed in first patch. -- Added file: http://bugs.python.org/file15760/issue7633_jjconti2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7645] test_distutils fails on Windows XP
New submission from Austin English austinenglish+pyt...@gmail.com: IOError: [Errno 2] No such file or directory: 'C:\\Python31\\lib\\distutils\\tests\\Setup.sample' Full output is attached. -- components: Windows files: distutils.txt messages: 97318 nosy: austin987 severity: normal status: open title: test_distutils fails on Windows XP type: behavior versions: Python 3.1 Added file: http://bugs.python.org/file15761/distutils.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7646] test_telnetlib fails in Windows XP
New submission from Austin English austinenglish+pyt...@gmail.com: socket.error: [Errno 10053] An established connection was aborted by the software in your host machine Full output is attached. -- components: Windows files: telnetlib.txt messages: 97319 nosy: austin987 severity: normal status: open title: test_telnetlib fails in Windows XP versions: Python 3.1 Added file: http://bugs.python.org/file15762/telnetlib.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7646 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7646] test_telnetlib fails in Windows XP
Changes by Austin English austinenglish+pyt...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7646 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6511] zipfile: Invalid argument when opening zero-sized files
R. David Murray rdmur...@bitdance.com added the comment: I've backported this to 2.6 in r77334 and to 3.1 in r77335. -- nosy: +r.david.murray priority: - normal stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6511 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6939] shadows around the io truncate() semantics
Pascal Chambon chambon.pas...@gmail.com added the comment: Hi Here is a patch for the python2.6 _fileio.c module, as well as the corresponding testcase. I'll check the _pyio and C _io trunk modules asap. -- keywords: +patch Added file: http://bugs.python.org/file15763/python26_io_truncate_bugfix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6939 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7647] Add statvfs flags to the posix module
New submission from Adam Jackson a...@redhat.com: Though the statvfs call exists in the posix module, the posix-defined values for the f_flag field are not. This makes it hard to know whether a filesystem is readonly without also knowing the value for ST_READONLY on the machine you're running on. Attached patch is against python2 svn, but probably applies to python3 too. -- components: Extension Modules files: posix-statvfs-symbols.patch keywords: patch messages: 97322 nosy: a...@redhat.com severity: normal status: open title: Add statvfs flags to the posix module versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file15764/posix-statvfs-symbols.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7647 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7647] Add statvfs flags to the posix module
Changes by Adam Jackson a...@redhat.com: -- type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7647 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7647] Add statvfs flags to the posix module
Changes by Dave Malcolm dmalc...@redhat.com: -- nosy: +dmalcolm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7647 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled
Florent Xicluna la...@yahoo.fr added the comment: Still some -3 warnings to silence: ./python -3m collections /dev/null ./python -3c import Cookie ./python -3c import idlelib.rpc ./python -3c import logging.handlers ./python -3c import multiprocessing ./python -3c import shelve ./python -3c import trace All these modules yield: DeprecationWarning: the cPickle module has been removed in Python 3.0 There's also bsddb but it is deprecated. -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7092 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled
Antoine Pitrou pit...@free.fr added the comment: All these modules yield: DeprecationWarning: the cPickle module has been removed in Python 3.0 I think this warning is both annoying (cPickle is a legitimate module to use in 2.x, since pickle is much slower) and useless (2to3 should be able to do the module rename -- Benjamin, does it?). Therefore I suggest to remove this warning. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7092 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled
Jean-Paul Calderone exar...@divmod.com added the comment: I think this warning is both annoying (cPickle is a legitimate module to use in 2.x, since pickle is much slower) and useless (2to3 should be able to do the module rename -- Benjamin, does it?). Therefore I suggest to remove this warning. You may be right, but keep in mind that cPickle and pickle are only *mostly* compatible with each other. There are uses of one which will not automatically work if you switch to the other. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7092 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7645] test_distutils fails on Windows XP
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +tarek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7645] test_distutils fails on Windows XP
Changes by R. David Murray rdmur...@bitdance.com: -- assignee: - tarek components: +Distutils priority: - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6939] shadows around the io truncate() semantics
Pascal Chambon chambon.pas...@gmail.com added the comment: Whoups - I forgot to bugfix as well the _bytesio classes... let's just forget about the previous patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6939 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled
Florent Xicluna la...@yahoo.fr added the comment: +1 to remove this boring cPickle message. cStringIO do not print such messages. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7092 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6939] shadows around the io truncate() semantics
Pascal Chambon chambon.pas...@gmail.com added the comment: Here is the new patch for py2.6, fixing (hopefully) all the truncate() methods. Note that the python _BytesIO implementation isn't covered by the test suite, as it's shadowed by the C implementation ; but imo we shouldn't care : I've manually tested it once, and anyway the trunk sources don't have this problem. -- Added file: http://bugs.python.org/file15765/python26_full_truncate_patch.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6939 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6939] shadows around the io truncate() semantics
Pascal Chambon chambon.pas...@gmail.com added the comment: And here is the python trunk patch, covering _Pyio and _io modules (+ corresponding tests). -- Added file: http://bugs.python.org/file15766/python27_full_truncate_bugfix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6939 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7319] Silence DeprecationWarning by default
Brian Curtin cur...@acm.org added the comment: The wording of the documentation flows and is arranged better than before. However, there is a test failure: test_exceptions.testDeprecatedMessageAttribute depends on the deprecation warning always occuring. @unittest.skipIf(DeprecationWarning in [filter[2] for filter in warnings.filters], DeprecationWarning disabled) or something like that could avoid it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7319 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3660] reference leaks in test_distutils
Ezio Melotti ezio.melo...@gmail.com added the comment: This issue has been fixed. -- nosy: +ezio.melotti resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3660 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7648] test_urllib2 fails on Windows if not run from C:
New submission from Austin English austinenglish+pyt...@gmail.com: Passes fine if run from C:, but when run from any other drive, fails: test_trivial (__main__.TrivialTests) ... ERROR == ERROR: test_trivial (__main__.TrivialTests) -- Traceback (most recent call last): File c:\Python31\lib\urllib\request.py, line 1189, in open_local_file stats = os.stat(localfile) WindowsError: [Error 3] The system cannot find the path specified: '\\Python31\\ lib\\urllib\\request.py' -- components: Windows files: url.txt messages: 97332 nosy: austin987 severity: normal status: open title: test_urllib2 fails on Windows if not run from C: versions: Python 3.1 Added file: http://bugs.python.org/file15767/url.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7648 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7648] test_urllib2 fails on Windows if not run from C:
Changes by R. David Murray rdmur...@bitdance.com: -- components: +Tests keywords: +easy nosy: +orsenthil priority: - low type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7648 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7643] What is an ASCII linebreak?
Michael Foord mich...@voidspace.org.uk added the comment: '\x85' when decoded using latin-1 is just transcoded to u'\x85' which is treated as the NEL (a C1 control code equivalent to end of line). This changes iteration over the file when you decode and actually broke our csv parsing code when we got some latin-1 encoded data with \x85 in it from our customer. -- nosy: +michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7643 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7649] u'%c' % char broken for chars in range '\x80'-'\xFF'
New submission from Ezio Melotti ezio.melo...@gmail.com: On Py2.x u'%c' % char returns the wrong result if char is in range '\x80'-'\xFF': u'%c' % '\x7f' u'\x7f' # correct u'%c' % '\x80' u'\uff80' # broken u'%c' % '\xFF' u'\u' # broken This is what happens whit %s and 0x80: u'%s' % '\x80' Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128) u'%c' % 0x80 u'\x80' u'%c' % '\x80' should raise the same error raised by u'%s' % '\x80'. -- assignee: ezio.melotti components: Interpreter Core, Unicode messages: 97334 nosy: ezio.melotti priority: high severity: normal stage: test needed status: open title: u'%c' % char broken for chars in range '\x80'-'\xFF' type: behavior versions: Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7649 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7519] ConfigParser can't read files with BOM markers
STINNER Victor victor.stin...@haypocalc.com added the comment: Use utf_8_sig charset and open your file using io.open() or codecs.open() to get unicode sections, options and values. Example: - from ConfigParser import ConfigParser import io # create an utf-8 .ini file with a BOM marker with open('bla.ini', 'wb') as fp: fp.write(u'[section]\ncl\xe9=value'.encode('utf_8_sig')) # read the .ini file config = ConfigParser() with io.open('bla.ini', 'r', encoding='utf_8_sig') as fp: config.readfp(fp) # dump the config for section in config.sections(): print [, repr(section), ] for option in config.options(section): value = config.get(section, option) print %r=%r % (option, value) - -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7519 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7649] u'%c' % char broken for chars in range '\x80'-'\xFF'
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7649 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7649] u'%c' % char broken for chars in range '\x80'-'\xFF'
Eric Smith e...@trueblade.com added the comment: This looks like a signed vs. unsigned char problem. What platform are you on? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7649 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7649] u'%c' % char broken for chars in range '\x80'-'\xFF'
Changes by Eric Smith e...@trueblade.com: -- nosy: +doerwalter ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7649 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7650] test_uuid is invalid
New submission from Austin English austinenglish+pyt...@gmail.com: From http://bugs.winehq.org/show_bug.cgi?id=21276 I believe this is a bug in the python test code, not in Wine. Wine's UuidCreate function follows RFC 4122, section 4.4. That is, it generates a Uuid from a pseudorandom number generator, not from a MAC address. Thus, the error message from the test program is correct: it doesn't appear to be a MAC address. On the other hand, it's not an error: this is expected. The python code should be checking the version field of the generated Uuid first. If it's 1, then the generated Uuid *may* be expected to contain a MAC address. From RFC 4122, section 4.1.6: For UUID version 1, the node field consists of an IEEE 802 MAC address, usually the host address. For systems with multiple IEEE 802 addresses, any available one can be used. The lowest addressed octet (octet number 10) contains the global/local bit and the unicast/multicast bit, and is the first octet of the address transmitted on an 802.3 LAN. However, the test for the most significant bit not being set is also invalid on systems with no MAC address. From the python code: self.assertTrue(node (1 48), message) The most significant bit of a MAC address is set when the MAC address is a multicast address. For systems with no MAC address, a multicast address is supposed to be used. Also from RFC 4122, section 4.1.6: For systems with no IEEE address, a randomly or pseudo-randomly generated value may be used; see Section 4.5. The multicast bit must be set in such addresses, in order that they will never conflict with addresses obtained from network cards. This analysis may of use to the Python folks, but it certainly isn't a Wine bug. -- components: Tests messages: 97337 nosy: austin987 severity: normal status: open title: test_uuid is invalid versions: Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7650 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7649] u'%c' % char broken for chars in range '\x80'-'\xFF'
STINNER Victor victor.stin...@haypocalc.com added the comment: The problem is the cast char = Py_UNICODE in formatchar() function. char may be unsigned, but most of the time it's signed. signed = unsigned cast extend the sign. Example: (unsigned short)(signed char)0x80 gives 0xFF80. Attached patch fixes the issue and includes an unit test. -- keywords: +patch nosy: +haypo Added file: http://bugs.python.org/file15768/unicode_formatchar.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7649 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7649] u'%c' % char broken for chars in range '\x80'-'\xFF'
STINNER Victor victor.stin...@haypocalc.com added the comment: The problem is specific to Python 2.x. With Python3, %c expects one unicode character (eg. a). My patch fixes the char = Py_UNICODE conversion, but raising an error is maybe better to be consistent with u%s % \x80 (and prepare the migration the Python3). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7649 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7649] u'%c' % char broken for chars in range '\x80'-'\xFF'
Eric Smith e...@trueblade.com added the comment: Shouldn't it work the same as it does for integers? u'%c' % 0x7f u'\x7f' u'%c' % '\x7f' u'\x7f' u'%c' % 0x80 u'\x80' u'%c' % '\x80' u'\uff80' That would imply to me it shouldn't be an error, it should just return u'\x80'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7649 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7649] u'%c' % char broken for chars in range '\x80'-'\xFF'
Changes by Eric Smith e...@trueblade.com: -- keywords: +easy priority: high - normal stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7649 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7651] Python3: guess text file charset using the BOM
New submission from STINNER Victor victor.stin...@haypocalc.com: If the file starts with a BOM, open(filename) should be able to guess the charset. It would be helpful for many high level modules: - #7519: ConfigParser - #7185: csv - and any module using open() to read a text file Actually, the user have to choose between UTF-8 and UTF-8-SIG to skip the UTF-8 BOM. For UTF-16, the user have to specify UTF-16-LE or UTF-16-BE, even if the file starts with a BOM (which should be the case most the time). The idea is to delay the creation of the decoder and the encoder. Just after reading the first chunk: try to guess the charset by searching for a BOM (if the charset is unknown). If the BOM is found, fallback to current guess code (os.device_charset() or locale.getpreferredencoding()). Concerned charsets: UTF-8, UTF-16-LE, UTF-16-BE, UTF-32-LE, UTF-32-BE. Binary files are not concerned. If the encoding is specified to open(), the behaviour is unchanged. I wrote a proof of concept, but there are still open issues: - append mode: should we seek at zero to read the BOM? old=tell(); seek(0); bytes=read(4); seek(old); search_bom(bytes) - read+write: should we guess the charset using the BOM if the first action is a write? or only search for a BOM if the first action is a read? -- components: Unicode messages: 97341 nosy: haypo severity: normal status: open title: Python3: guess text file charset using the BOM versions: Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7651 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1034] [patch] Add 2to3 support for displaying warnings as Python comments
Brian Curtin cur...@acm.org added the comment: I think this would be a good addition so I took Adrian's patch and brought it up to date. I'll need to expand the testing, but I think Benjamin's 1 and 3 are covered. -- nosy: +brian.curtin Added file: http://bugs.python.org/file15769/issue1034.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1034 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7644] bug in nntplib.body() method with possible fix
Michael Mullins pabloonbr...@gmail.com added the comment: ('crash' is for the interpreter crashing) Sorry. Unless someone feels like creating an nntp test framework... This sounds like it is beyond me. But given the evidence, specifically the previous line: file.write(line + b'\n') ...the module is obviously writing as binary. I know that opening the files created by this method in 3.0 requires the 'rb' flag so it seems a safe bet. And I am actually using this module (as revised above) to get work done. ... I apologise if this isn't the place for this (should I open another ticket?) but as a larger issue with 3.x in general, it was very confusing about when to use binary data and when to use strings when using nntplib. It took a lot of trial and error. If there was someway to make this more clear, or perhaps the methods themselves could be made flexible, excepting both types but always outputing in binary. (Liberal with input but conservative in output.) This would allow anyone working with nntplib to interact with the module in a completely binary way, understanding that all output will be explicitly binary, and that if strings are necessary, it's for the user to decode(). Just a thought. MDMullins -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7644 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1034] [patch] Add 2to3 support for displaying warnings as Python comments
Changes by Brian Curtin cur...@acm.org: -- stage: - test needed versions: +Python 2.7, Python 3.2 -Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1034 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7319] Silence DeprecationWarning by default
Changes by Brett Cannon br...@python.org: Removed file: http://bugs.python.org/file15758/silence_deprecations.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7319 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7319] Silence DeprecationWarning by default
Brett Cannon br...@python.org added the comment: Latest patch adds fixes to test_exceptions test_ascii_formatd to pass. -- Added file: http://bugs.python.org/file15770/silence_deprecations.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7319 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com