[issue6526] importlib.import_module affects permissions of .pyc files subsequently created by import

2009-07-29 Thread Brett Cannon
Brett Cannon added the comment: So removing the built-in, frozen, and extension importers did not stop the bug from happening. Calling importlib._bootstrap._PyFileFinder directly does not trigger the bug, even when trying with a finder for '.' first. And having sys.path be only '.' for filein

[issue4606] Passing 'None' if argtype is set to POINTER(...) doesn't always result in NULL

2009-07-29 Thread Andrew McNabb
Andrew McNabb added the comment: I ran into this problem, too. It took me a long time to track down the segfaults. It's really bad to pass in None and have the system pick some random address instead of 0. I looked at the attached patch, and it seems to me the only alternative approach would

[issue6600] MemoryError in AiX 64-bit build

2009-07-29 Thread Sridhar Ratnakumar
Sridhar Ratnakumar added the comment: This is strange .. the attached patch (reverses operands to +) fixes the issue. -- Added file: http://bugs.python.org/file14605/patch ___ Python tracker __

[issue6526] importlib.import_module affects permissions of .pyc files subsequently created by import

2009-07-29 Thread Brett Cannon
Changes by Brett Cannon : Removed file: http://bugs.python.org/file14527/unnamed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue6600] MemoryError in AiX 64-bit build

2009-07-29 Thread Sridhar Ratnakumar
Sridhar Ratnakumar added the comment: Interesting. If add the line: newmode = PyMem_MALLOC(4); next to the existing line: newmode = PyMem_MALLOC(strlen(mode) + 3); there is no MemoryError! -- ___ Python tracker

[issue6600] MemoryError in AiX 64-bit build

2009-07-29 Thread Sridhar Ratnakumar
Sridhar Ratnakumar added the comment: I localized the error to line 248 in http://svn.python.org/view/python/ branches/release26-maint/Objects/fileobject.c?annotate=68135#248 (brandl's change made 3 years ago) static PyObject * open_the_file(PyFileObject *f, char *name, char *mode) { [

[issue6600] MemoryError in AiX 64-bit build

2009-07-29 Thread Sridhar Ratnakumar
Sridhar Ratnakumar added the comment: I suspect this is related to http://mail.python.org/pipermail/python- bugs-list/2003-November/021158.html -- ___ Python tracker ___

[issue5093] 2to3 with a pipe on non-ASCII script

2009-07-29 Thread James Abbatiello
James Abbatiello added the comment: The --no-diffs option was recently added which looks like a good workaround. Here's an attempt at a solution. If sys.stdout has an encoding set then use that, just as is being done now. If there is no encoding (implying "ascii") then use the encoding of the

[issue6600] MemoryError in AiX 64-bit build

2009-07-29 Thread Sridhar Ratnakumar
New submission from Sridhar Ratnakumar : (currently investigating the root cause of this issue...) bash-2.04$ build/py2_6_2-aix5-powerpc-apy26-rrun/python/python -c "open ('/tmp/test', 'w')" Traceback (most recent call last): File "", line 1, in MemoryError bash-2.04$ build/py2_6_2-aix5-powe

[issue6599] 2to3 test_print_function_option fails on Windows

2009-07-29 Thread James Abbatiello
New submission from James Abbatiello : test_print_function_option is failing on Windows. Patch attached. Output of failure: C:>python test.py test_all_project_files (lib2to3.tests.test_all_fixers.Test_all) ... \2to3\lib2to3\refactor.py:194: DeprecationWarning: the 'print_function' option is de

[issue6598] calling email.utils.make_msgid frequently has a non-trivial probability of generating colliding ids

2009-07-29 Thread Michael Hudson
Michael Hudson added the comment: A higher resolution timer would also help, of course. (Thanks to James Knight for the prod). -- ___ Python tracker ___

[issue6598] calling email.utils.make_msgid frequently has a non-trivial probability of generating colliding ids

2009-07-29 Thread Michael Hudson
New submission from Michael Hudson : If you call email.utils.make_msgid a number of times within the same second, the uniqueness of the results depends on random.randint(10) returning different values each time. A little mathematics proves that you don't have to call make_msgid *that* often

[issue6597] Deprecate iterable.next in Python > 2.6.x when called with -3 option ?

2009-07-29 Thread Matthew Russell
Changes by Matthew Russell : -- title: Depricate iterable.next in Python > 2.6.x when called with -3 option -> Deprecate iterable.next in Python > 2.6.x when called with -3 option ? ___ Python tracker _

[issue6597] Depricate iterable.next in Python > 2.6.x when called with -3 option

2009-07-29 Thread Matthew Russell
New submission from Matthew Russell : Not sure if this should be (tentative) feature request or behavior... It might help new comers and those preparing to port to Python 3. -- assignee: georg.brandl components: 2to3 (2.x to 3.0 conversion tool), Documentation, Interpreter Core messages

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mail

[issue5738] multiprocessing example wrong

2009-07-29 Thread Justin MacCallum
Justin MacCallum added the comment: I think this should either be fixed or removed from the documentation. It is very confusing as is. I have next to no idea what I'm doing, but I've attached a patch that allows this code to function, at least sort of. You can now create cluster and pool obje

[issue1975] signals not always delivered to main thread, since other threads have the signal unmasked

2009-07-29 Thread John Levon
John Levon added the comment: Any progress on this regression? A patch is available... thanks. -- ___ Python tracker ___ ___ Python-bu

[issue6596] urllib2 bug on CentOS

2009-07-29 Thread Anton
Anton added the comment: % gcc -v Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man -- infodir=/usr/share/info --enable-shared --enable-threads=posix --enable- checking=release --with-system-zlib --enable-__cxa_atexit --disable- l

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: Attached a documentation/unit-test/solution patch that adds a validate=False parameter to the b64decode function of Lib/base64.py, which may be set to True to have invalid base64 content be rejected with a TypeError. Patch built against Python 2.7, r74261. Note:

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: Attached a documentation/unit-test/solution patch that adds a validate=False parameter to the b64decode function of Lib/base64.py, which may be set to True to have invalid base64 content be rejected with a TypeError. Patch built against Python 3.2, r74261. --

[issue5833] readline update

2009-07-29 Thread Dror Levin
Dror Levin added the comment: Arch Linux devs have split the patch and applied only the extra-space fix, which is what I'm attaching now. I've compiled Python 2.6.2 on Gentoo with this patch and can report it works well (I tested with ipython). -- Added file: http://bugs.python.org/file

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Changes by Neil Tallim : Removed file: http://bugs.python.org/file14598/1466065[3.2].diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Changes by Neil Tallim : Removed file: http://bugs.python.org/file14597/1466065[2.7].diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue6275] let unittest.assertRaises() return the exception object caught

2009-07-29 Thread Raghuram Devarakonda
Changes by Raghuram Devarakonda : -- nosy: +draghuram ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread R. David Murray
R. David Murray added the comment: And if the flag defaults to the current behavior that should satisfy the backward compatiblity issues. -- ___ Python tracker ___ ___

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > If the documentation is clear, then all future application developers > will know to check for validity using a regular expression like > '^[A-Za-z0-9+/\r\n]+={0,2}$'. Any existing applications in which > validity matters should already have a similar workarou

[issue6596] urllib2 bug on CentOS

2009-07-29 Thread Martin v . Löwis
Martin v. Löwis added the comment: What C compiler have you been using? -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list m

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: It isn't written that only MIME may ignore such content. The key terms there are 'may' and 'explicitly states otherwise'. If the documentation is clear, then all future application developers will know to check for validity using a regular expression like '^[A-Za-

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread R. David Murray
R. David Murray added the comment: Hmm. But if the module is used outside of MIME (which it can be, and in fact is in the stdlib itself), then an error must be raised in order to comply with that RFC. So it sounds like we really ought to have that flag. And I was even wrong about the appropri

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mail

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: Attached a documentation patch indicating that the ignore-invalid-characters behaviour is intentional, citing relevant RFCs for support. Patch built against Python 3.2, r74261. -- Added file: http://bugs.python.org/file14598/1466065[3.2].diff ___

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: Attached a documentation patch indicating that the ignore-invalid-characters behaviour is intentional, citing relevant RFCs for support. Patch built against Python 2.7, r74261. -- Added file: http://bugs.python.org/file14597/1466065[2.7].diff ___

[issue6550] asyncore incorrect failure when connection is refused and using async_chat channel

2009-07-29 Thread Josiah Carlson
Changes by Josiah Carlson : Removed file: http://bugs.python.org/file14585/asyncore_fix_refused-2.patch ___ Python tracker ___ ___ Python-bugs-

[issue6550] asyncore incorrect failure when connection is refused and using async_chat channel

2009-07-29 Thread Josiah Carlson
Changes by Josiah Carlson : Removed file: http://bugs.python.org/file14581/asyncore_fix_refused.patch ___ Python tracker ___ ___ Python-bugs-li

[issue6550] asyncore incorrect failure when connection is refused and using async_chat channel

2009-07-29 Thread Josiah Carlson
Josiah Carlson added the comment: Originally, handle_expt_event() was described as "handles OOB data or exceptions", but over-using handle_expt_event() as an error/close handler is a bad idea. The function asyncore.readwrite() (called by asyncore.poll2()) does the right thing WRT handle_expt

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: RFC 3548, referenced by the base64 module's docs, has a rather different statement on how invalid characters should be treated. >From 2.3 Interpretation of non-alphabet characters in encoded data: Implementations MUST reject the encoding if it contains characte

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread R. David Murray
R. David Murray added the comment: It turns out that the RFC is unambiguous on this point. Quoting the base64 section of RFC 2045: The encoded output stream must be represented in lines of no more than 76 characters each. All line breaks or other characters not found in Table 1 must

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Guido van Rossum
Guido van Rossum added the comment: It strikes me as simply a documentation bug. Maybe whoever wrote the docs just assumed it would work that way. I expect that changing it to insist on valid input would break some use cases. If you want a validating API, perhaps a new API could be added that va

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: I'll hold off on uploading new patches until someone makes a decision, then. It seems like, perhaps, simply amending the documentation would be sufficient, since this behaviour shouldn't break any valid messages that might reach this module. At worst, it'll just t

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps Guido remembers why the decision was made. -- nosy: +gvanrossum, pitrou versions: +Python 2.7, Python 3.2 -Python 2.6, Python 3.0 ___ Python tracker

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I've dig into the history of the file and found this change: http://svn.python.org/view?view=rev&revision=13939 "- Illegal padding is now ignored. (Recommendation by GvR.)" The motivation at the time was based on "the general Internet philosophy": http:/

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 Also, I would like to see this backported. We've long promised that any variance with the spec will be treated as a bugfix. The change won't break any existing code. -- nosy: +rhettinger ___ Python tracker

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Changes by Neil Tallim : Removed file: http://bugs.python.org/file14589/1466065[3.2-pure-python].diff ___ Python tracker ___ ___ Python-bugs

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Changes by Neil Tallim : Removed file: http://bugs.python.org/file14588/1466065[2.7-pure-python].diff ___ Python tracker ___ ___ Python-bugs

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Changes by Neil Tallim : Removed file: http://bugs.python.org/file14587/1466065[3.2].diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Changes by Neil Tallim : Removed file: http://bugs.python.org/file14586/1466065[2.7].diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread R. David Murray
R. David Murray added the comment: Amaury is probably better qualified to answer that question, but I would think the C code version is preferable. -- ___ Python tracker ___ _

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: > Therefore, '!' should fail with a TypeError Here is your test case! "Errors should never pass silently." -- ___ Python tracker ___ __

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: R. David Murray, should I update the patches for both the pure-Python solution and the C solution, or is one domain preferable here? The Python-based solution keeps all of the invalid-character TypeErrors collected in the same module, but the C-based solution allow

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: According to the documentation cited by Seo Sanghyeon in the first post, "A TypeError is raised if s were incorrectly padded or if there are non-alphabet characters present in the string." The valid range of characters is [A-Za-z0-9], and one or two '='s may appea

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: What is the correct behavior for something like this? base64.b64decode('!') 2.6 silently returns ''. -- ___ Python tracker ___ _

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread R. David Murray
R. David Murray added the comment: If "it may be noisy where it was silent before", then add one of those cases and make sure the noise doesn't happen before your fix, and does happen after. If you have to check the value of the exception string for other tests, then do so. There are plenty of

[issue6336] nb_divide missing in docs

2009-07-29 Thread Georg Brandl
Georg Brandl added the comment: Thanks, fixed in r74256. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Neil Tallim
Neil Tallim added the comment: I can't add a test for that without changing unrelated behaviour in the library that is already known to work fine or checking the string value of the raised exception, which seems like a bad idea, even though it would work. If a character is ignored and this lead

[issue6586] Documentation of os.write and os.read are inaccurate.

2009-07-29 Thread Georg Brandl
Georg Brandl added the comment: Thanks, fixed in r74254. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue6591] add reference to fcntl.ioctl in the socket module

2009-07-29 Thread Georg Brandl
Georg Brandl added the comment: Thanks, committed in r74253. -- resolution: -> accepted status: open -> closed ___ Python tracker ___ ___

[issue6593] Documentation: gettext install link

2009-07-29 Thread Georg Brandl
Georg Brandl added the comment: Thanks, fixed in r74252. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue1466065] base64 module ignores non-alphabet characters

2009-07-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The new unit tests pass without modifying the library. Could you include a case that fails with the current version? -- nosy: +amaury.forgeotdarc ___ Python tracker __

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-07-29 Thread Ezio Melotti
Ezio Melotti added the comment: Apparently Perl has a quite comprehensive set of tests at http://perl5.git.perl.org/perl.git/blob/HEAD:/t/op/re_tests . If we want the engine to be Perl-compatible, it might be a good idea to reuse (part of) their tests (if their license allows it). -- _

[issue6550] asyncore incorrect failure when connection is refused and using async_chat channel

2009-07-29 Thread Nir Soffer
Nir Soffer added the comment: I'll check the patch this week. The asyncore framework has low level events - handle_read_event, handle_write_event and handle_expt_event - these events are not used for reading, writing and OOB - they are just responsible to call the high level events. The hi

[issue1544339] _ctypes fails to build on Solaris x86 32-bit (Sun compiler)

2009-07-29 Thread Nick
Nick added the comment: I've stumbled head-first into this bug trying to build ctypes 1.0.2, as required by the python Shapely GIS library for an important Zope project I've been working on. It's a real surprise to see this bug even exists (since 2006!). I don't understand the cause, but it

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-07-29 Thread Matthew Barnett
Matthew Barnett added the comment: Unfortunately I found a bug in regex.py, caused when I made it compatible with Python 2.5. :-( issue2636-20090729.zip is now corrected. -- Added file: http://bugs.python.org/file14594/issue2636-20090729.zip

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-07-29 Thread Matthew Barnett
Changes by Matthew Barnett : Removed file: http://bugs.python.org/file14592/issue2636-20090729.zip ___ Python tracker <http://bugs.python.org/issue2636> ___ ___ Python-bug

[issue6596] urllib2 bug on CentOS

2009-07-29 Thread Anton
Changes by Anton : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue6596] urllib2 bug on CentOS

2009-07-29 Thread Anton
New submission from Anton : This code gives HTTP Error 500 on CentOS: - import urllib2 url = 'http://wm.exchanger.ru/asp/XMLWMList.asp?exchtype=1' t = urllib2.urlopen(url).read() - tcpdump: --

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Eric Smith
Eric Smith added the comment: Since you're calling int() on the result, can't this code: self._int = str(int((intpart+fracpart).lstrip('0') or '0')) just be: self._int = str(int(intpart+fracpart)) ? And here, you already know diag is not None, so do you need the "or '0'" part? self._int = str(i

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Eric Smith
Eric Smith added the comment: +1 The standard recommends it, and the other numeric types support it, so Decimal should as well. -- nosy: +eric.smith ___ Python tracker ___ _

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch -- keywords: +patch Added file: http://bugs.python.org/file14593/issue6595.patch ___ Python tracker ___ _

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-29 Thread Mark Dickinson
New submission from Mark Dickinson : Ezio Melotti asked (on #python-dev) why the Decimal constructor doesn't accept decimal digits other than 0-9. As far as I can tell there's no good reason for it not to. Moreover, the standard on which the decimal module is based says[1]: """It is recomme