[issue1466065] base64 module ignores non-alphabet characters

2010-09-10 Thread Neil Tallim
Neil Tallim added the comment: I agree that it does look like RFC 3548 implicitly denies the use of \r and \n. A few *very* simple tests also makes it look like ommitting them breaks nothing, but we'd need to add a test that includes them before applying the patch. Other than that, I

[issue9747] os.getresgid() documentation mentions "user ids", not "group ids"

2010-09-02 Thread Neil Tallim
New submission from Neil Tallim : Super-low-priority (it's obvious from context and unlike to confuse anyone who knows what they're looking at), but the os module's description for getresgid() is "Return a tuple (rgid, egid, sgid) denoting the current process’s real, effec

[issue1512791] module wave does no rounding

2010-08-28 Thread Neil Tallim
Neil Tallim added the comment: I use the wave module a fair bit and never once encountered this issue, so, yeah, it's probably a pretty low priority for backporting. It's definitely an edge-case sort of thing, the likes of which anyone affected has already handled in their applica

[issue1512791] module wave does no rounding

2010-08-25 Thread Neil Tallim
Neil Tallim added the comment: The differences are small enough that it probably doesn't matter which one of us makes the extra changes. It'll take one step less for you to implement them while applying the fixes, so it's probably easiest if I leave that in your court. Thanks

[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

[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 <http://bugs.python.org/issue1466065> ___ ___ Python-bug

[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 <http://bugs.python.org/issue1466065> ___ ___ Python-bug

[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 regula

[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

[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

[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,

[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 <http://bugs.python.org/issue1466065> ___ ___

[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 <http://bugs.python.org/issue1466065> ___ ___

[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 <http://bugs.python.org/issue1466065> ___ ___ Python-bug

[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 <http://bugs.python.org/issue1466065> ___ ___ Python-bug

[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

[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 tw

[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

[issue1512791] module wave does no rounding

2009-07-28 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch with a unit test and solution for this problem. Patch built against Python 3.2, r74246. Note: with Python 3.2, an error was thrown if the input value wasn't an integer because a deprecated struct-related cast was removed. It's debatab

[issue1512791] module wave does no rounding

2009-07-28 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch with a unit test and solution for this problem. Patch built against Python 2.7, r74246. Note: It may make more sense to just have wave.setframerate() assert that it is being fed an integer, and that's a simple fix that won't requ

[issue1466065] base64 module ignores non-alphabet characters

2009-07-28 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch that modifies Lib/base64.py to raise a TypeError on any unrecognized base64 input, rather than continuing silently. Also includes unit tests. Patch built against Python 3.2, r74246. Correction to previous text: base64 continues silently

[issue1466065] base64 module ignores non-alphabet characters

2009-07-28 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch that modifies Lib/base64.py to raise a TypeError on any unrecognized base64 input, rather than failing silently. Also includes unit tests. Patch built against Python 2.7, r74246. -- Added file: http://bugs.python.org/file14588/1466065

[issue1466065] base64 module ignores non-alphabet characters

2009-07-28 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch that modifies Modules/binascii.c to raise a TypeError on any unrecognized base64 input, rather than failing silently. Also includes unit tests. Patch built against Python 3.2, r74246. TypeError was preserved over ValueError, despite the lack of

[issue1466065] base64 module ignores non-alphabet characters

2009-07-28 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch that modifies Modules/binascii.c to raise a TypeError on any unrecognized base64 input, rather than failing silently. Also includes unit tests. Patch built against Python 2.7, r74246. TypeError was preserved over ValueError, despite the lack of

[issue1721862] email.FeedParser.BufferedSubFile improperly handles "\r\n"

2009-07-27 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch containing a unit test based on Sye van der Veen's example and a solution for issue 1721862. Written against Python 3.2, r74225. -- Added file: http://bugs.python.org/file14580/1721862[3.2]

[issue1721862] email.FeedParser.BufferedSubFile improperly handles "\r\n"

2009-07-27 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch containing a unit test based on Sye van der Veen's example and a solution for issue 1721862. Written against Python 3.1, r74225. -- Added file: http://bugs.python.org/file14579/1721862[3.1]

[issue1721862] email.FeedParser.BufferedSubFile improperly handles "\r\n"

2009-07-27 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch containing a unit test based on Sye van der Veen's example and a solution for issue 1721862. Written against Python 2.7, r74225. -- Added file: http://bugs.python.org/file14578/1721862[2.7]

[issue1721862] email.FeedParser.BufferedSubFile improperly handles "\r\n"

2009-07-27 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch containing a unit test based on Sye van der Veen's example and a solution for issue 1721862. Written against Python 2.6, r74225. -- Added file: http://bugs.python.org/file14577/1721862[2.6]

[issue1721862] email.FeedParser.BufferedSubFile improperly handles "\r\n"

2009-07-27 Thread Neil Tallim
Neil Tallim added the comment: Confirmed in trunk and all current branches (r74225: 2.6, 2.7, 3.1, 3.2). Patches for all four active versions will be added momentarily. Note: my submission yesterday was mistagged, claiming to be for trunk while it was really for 2.6, which is what this bug

[issue1721862] email.FeedParser.BufferedSubFile improperly handles "\r\n"

2009-07-27 Thread Neil Tallim
Changes by Neil Tallim : Removed file: http://bugs.python.org/file14572/1721862.diff ___ Python tracker <http://bugs.python.org/issue1721862> ___ ___ Python-bugs-list m

[issue1721862] email.FeedParser.BufferedSubFile improperly handles "\r\n"

2009-07-26 Thread Neil Tallim
Neil Tallim added the comment: Attached a patch containing a unit test based on Sye van der Veen's example and a solution for this problem. Written against Python 2.6 (trunk), r74214, which was current at the time of submission. This is my first patch, so please let me know if I did some