[issue14339] Optimizing bin, oct and hex

2012-03-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : This patch slightly optimize conversion int to string with base 2, 8 or 16 by calculating exactly number of digits and avoiding unnecessary memory allocation. The code is similar to used for decimal conversion. Without patch: $ ./python -m timeit -s 'x=1'

[issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat

2012-03-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'm opening another issue to track updating the embedded copy of expat within Python. FWIW, Python 2.7 & 3.2 and later support a --with-system-expat option which is what I'd *hope* that any OS distro is building their Python with rather than using the olde

[issue14340] Update embedded copy of expat - fix security & crash issues

2012-03-16 Thread Gregory P. Smith
New submission from Gregory P. Smith : As pointed out in #14234, our embedded copy of expat used by pyexpat for xml parsing in Modules/expat/ is out of date. There have been many fixes to expat that we have not applied including a few potential crash and security fixes. We should upgrade it w

[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2012-03-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > _eintr_retry is currently unused. AFAICT it's still used in forking.py. -- versions: +Python 3.3 ___ Python tracker ___

[issue14315] zipfile.ZipFile() unable to open zip File

2012-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: .apk is primarily used for Android Package files https://en.wikipedia.org/wiki/APK_%28file_format%29 which are zipped JAR-based archives. By changing .apk to .zip, I can open the file in Win7 explorer, which has zip built in. A 'crash' is a segfault or equvale

[issue14323] Normalize math precision in RGB/YIQ conversion

2012-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: The idea seems reasonable. Do you have a link or reference to a Matlab doc with the coefficients? Enhancements only go in new versions. -- nosy: +terry.reedy versions: -Python 2.7, Python 3.2 ___ Python tracker

[issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN

2012-03-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: Updated per review (style changes). -- Added file: http://bugs.python.org/file24892/malloc-import-pathbufs-py27.002.diff ___ Python tracker

[issue14340] Update embedded copy of expat - fix security & crash issues

2012-03-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: What would be awesome is if we could just kill embedded versions of libraries like expat. -- ___ Python tracker ___ ___

[issue14340] Update embedded copy of expat - fix security & crash issues

2012-03-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: Indeed! How do we do that on windows and osx where these may not exist outside of Python? We already require a set of external dependency libraries on windows, could we just add expat to the list? -- ___ Python

[issue14340] Update embedded copy of expat - fix security & crash issues

2012-03-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > What would be awesome is if we could just kill embedded versions of libraries > like expat. It practically wouldn't change much, since we still bundle them as part of Windows binaries. -- ___ Python tracker

[issue14340] Update embedded copy of expat - fix security & crash issues

2012-03-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: It is much less effort for us to simply take a new version of an external library and recompile rather than consider it part of our code that shouldn't change within a release and manually deal with patching it and cherry picking patches onto it. -

[issue13903] New shared-keys dictionary implementation

2012-03-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: The latest patch has a significant (negative) effect on some benchmarks: ### silent_logging ### Min: 0.057927 -> 0.068228: 1.18x slower Avg: 0.058218 -> 0.068660: 1.18x slower Significant (t=-36.06) ### mako ### Min: 0.118240 -> 0.140451: 1.19x slower Avg: 0.1

[issue14302] Move python.exe to bin/

2012-03-16 Thread Éric Araujo
Éric Araujo added the comment: IIUC this is about two changes: - Moving python.exe to the scripts subdirectory instead of the top-level install dir - Renaming that subdir from Scripts to bin The first change will reduce the number of dirs to add to PATH from two to one, which sounds nice; the

[issue14323] Normalize math precision in RGB/YIQ conversion

2012-03-16 Thread Brian Landers
Brian Landers added the comment: Matlab docs are here: - http://www.mathworks.com/help/toolbox/images/ref/rgb2ntsc.html - http://www.mathworks.com/help/toolbox/images/ref/ntsc2rgb.html Should these be referenced in the source itself? re new versions: sure, I'll create a separate patch for addi

[issue2377] Replace __import__ w/ importlib.__import__

2012-03-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: There are also reference leaks: $ ./python -m test -R 3:2 test_bz2 [1/1] test_bz2 beginning 5 repetitions 12345 . test_bz2 leaked [-1, -1] references, sum=-2 $ ./python -m test -R 3:2 test_hashlib [1/1] test_hashlib beginning 5 repetitions 12345 . test

[issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN

2012-03-16 Thread Thomas Wouters
Thomas Wouters added the comment: For the record, as I said in the review of 002.diff: LGTM. -- ___ Python tracker ___ ___ Python-bug

[issue14313] zipfile does not unpack files from archive (files extracted have zero length)

2012-03-16 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +alanmcintyre, eric.araujo stage: needs patch -> ___ Python tracker ___ ___ Python-bugs-list mailin

[issue14335] Reimplement multiprocessing's ForkingPickler using dispatch_table

2012-03-16 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +alexandre.vassalotti, jnoller, pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue14313] zipfile should raise an exception for unsupported compression methods

2012-03-16 Thread Éric Araujo
Éric Araujo added the comment: The requested change is arguably a new feature, but it seems to me that the current behavior is not acceptable and should be changed. -- title: zipfile does not unpack files from archive (files extracted have zero length) -> zipfile should raise an excep

[issue14336] Difference between pickle implementations for function objects

2012-03-16 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +alexandre.vassalotti, pitrou versions: +Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mail

[issue14302] Move python.exe to bin/

2012-03-16 Thread Brian Curtin
Brian Curtin added the comment: If that thread ever comes to a conclusion, can someone summarize it here? Also, is there a reason distutils even matters here? -- ___ Python tracker ___

[issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect

2012-03-16 Thread Éric Araujo
Éric Araujo added the comment: Continued in #14338. -- resolution: invalid -> works for me stage: patch review -> committed/rejected ___ Python tracker ___ _

[issue14337] Recent refleaks

2012-03-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: Okay, hopefuly fixed now. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue14335] Reimplement multiprocessing's ForkingPickler using dispatch_table

2012-03-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset b2a8310de718 by Antoine Pitrou in branch 'default': Issue #14335: multiprocessing's custom Pickler subclass now inherits from the C-accelerated implementation. http://hg.python.org/cpython/rev/b2a8310de718 -- nosy: +python-dev ___

[issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN

2012-03-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: Updated to use PyErr_NoMemory(). Thanks Antoine! I'm now working on this for 3.2 as well before I commit. -- Added file: http://bugs.python.org/file24893/malloc-import-pathbufs-py27.003.diff ___ Python tracker

[issue14335] Reimplement multiprocessing's ForkingPickler using dispatch_table

2012-03-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for this! Committed now. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue14339] Optimizing bin, oct and hex

2012-03-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- components: +Interpreter Core -Library (Lib) nosy: +mark.dickinson, skrah stage: -> patch review ___ Python tracker ___ __

[issue14338] Document how to forward POST data on redirects

2012-03-16 Thread Éric Araujo
Éric Araujo added the comment: The idea is to add a short example in Doc/howto/urllib2.rst. Senthil explained how to do things on #14144 (“obtain the redirected URL and then POST to [it]”), and the example should be introduced by a clear warning about security/misbehavior risks (this is why

[issue14315] zipfile.ZipFile() unable to open zip File

2012-03-16 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue13512] ~/.pypirc created insecurely

2012-03-16 Thread Éric Araujo
Éric Araujo added the comment: Barry, Benjamin: I’d like to fix this but am not sure if it should apply to 2.6 and 3.1 too. It does not look like a major flaw (see for example the assessment on the Red Hat bug page). -- components: +Distutils2 keywords: +easy nosy: +alexis, benjamin.

[issue14315] zipfile.ZipFile() unable to open zip File

2012-03-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is print from *other* _decodeExtra call. Add print('start') at start of _decodeExtra and you will see it. start b'\xfe\xca\x00\x00' 51966 0 b'' start start b'\x00' -- nosy: +storchaka ___ Python tracker

[issue14341] sporadic (?) test_urllib2 failures

2012-03-16 Thread Antoine Pitrou
New submission from Antoine Pitrou : == FAIL: test_method_deprecations (test.test_urllib2.OpenerDirectorTests) -- Traceback (most recent call last): File "/ho

[issue14342] In re's examples the example with recursion doesn't work

2012-03-16 Thread py.user
New submission from py.user : http://docs.python.org/py3k/library/re.html#avoiding-recursion >>> import sys >>> sys.getrecursionlimit() 1000 >>> import re >>> s = 'Begin ' + 1000*'a very long string ' + 'end' >>> re.match('Begin (\w| )*? end', s).end() 19009 >>> -- assignee: docs@python

[issue14302] Move python.exe to bin/

2012-03-16 Thread Mark Hammond
Mark Hammond added the comment: To clarify the second comment from Eric: it is actually the first of the proposals that I consider controversial - moving where python.exe lives (regardless of to where) will break 3rd party tools. If a decision was made to move it anyway, then renaming "Scrip

[issue14343] In re's examples the example with re.split() overlaps builtin input()

2012-03-16 Thread py.user
New submission from py.user : http://docs.python.org/py3k/library/re.html#making-a-phonebook input -> text -- assignee: docs@python components: Documentation, Regular Expressions messages: 156114 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal stat

[issue14302] Move python.exe to bin/

2012-03-16 Thread Brian Curtin
Brian Curtin added the comment: It'll break tools who just look for "C:\\Python%d%d\python.exe" % (x, y) or some variation, but that's not a very dependable solution. If you're using the registry to find actual install locations, I think you'll be alright. What other solutions for finding pyt

[issue14337] Recent refleaks

2012-03-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: I think I've nailed them all now. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue14302] Move python.exe to bin/

2012-03-16 Thread Mark Hammond
Mark Hammond added the comment: Tools that use the registry will typically look up the InstallPath key and look for python.exe there. They will not look in sub-directories (except some may look in PCBuild and PCBuild/amd64). It is exactly those tools I'm concerned about. -- __

[issue14302] Move python.exe to bin/

2012-03-16 Thread Brian Curtin
Brian Curtin added the comment: A suggested solution to that was to add BinaryPath to give them the proper path. We could potentially expose BinaryPath in older installers, just pointing at the same value as InstallPath. It's an installer-only change and very low (no?) risk, just preparing us

[issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN

2012-03-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: attaching the equivalent patch against python 3.2. that could also use a pair of eyeballs for review. it should show up as 'patch 4' in the rietveld reviews. -- Added file: http://bugs.python.org/file24894/malloc-import-pathbufs-py32.003.diff ___

[issue12788] test_email fails with -R

2012-03-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 474338602bd8 by R David Murray in branch 'default': #12788: fix error in test_policy when run under refleak detection http://hg.python.org/cpython/rev/474338602bd8 -- nosy: +python-dev ___ Python tracker

[issue12788] test_email fails with -R

2012-03-16 Thread R. David Murray
Changes by R. David Murray : -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue14339] Optimizing bin, oct and hex

2012-03-16 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue11780] email.encoders are broken

2012-03-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1be426a555ca by R David Murray in branch '3.2': #11780: document that email.encoders throw TypeError on multipart messages. http://hg.python.org/cpython/rev/1be426a555ca New changeset 060eda590fa0 by R David Murray in branch 'default': Merge #11780

[issue11780] email.encoders are broken

2012-03-16 Thread R. David Murray
R. David Murray added the comment: Nope, those errors are correct. The encodings functions do not apply to Multipart messages. I've updated the docs to reflect that. -- components: +Documentation -Library (Lib) resolution: -> fixed stage: -> committed/rejected status: open -> close

[issue11780] email.encoders are broken

2012-03-16 Thread Éric Araujo
Éric Araujo added the comment: I think it’s best to always say that exceptions are raised, and keep “throw” for the generator method. It’s consistent and avoids confusion. -- nosy: +eric.araujo ___ Python tracker

[issue11780] email.encoders are broken

2012-03-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 195b67c26ce7 by R David Murray in branch '3.2': #11780: s/throw/raise/ http://hg.python.org/cpython/rev/195b67c26ce7 New changeset 63c46a8547fb by R David Murray in branch 'default': Merge #11780: s/throw/raise/ http://hg.python.org/cpython/rev/63c

[issue11780] email.encoders are broken

2012-03-16 Thread R. David Murray
R. David Murray added the comment: Thanks, fixed. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue14342] In re's examples the example with recursion doesn't work

2012-03-16 Thread Matthew Barnett
Matthew Barnett added the comment: As far as I can tell, back in 2003, changes were made to replace the recursive scheme which used stack allocation with a non-recursive scheme which used heap allocation in order to the improve the behaviour. To me it looks like an oversight and that the exam

[issue14343] In re's examples the example with re.split() shadows builtin input()

2012-03-16 Thread Matthew Barnett
Changes by Matthew Barnett : -- title: In re's examples the example with re.split() overlaps builtin input() -> In re's examples the example with re.split() shadows builtin input() ___ Python tracker _

[issue11686] Update of some email/ __all__ lists

2012-03-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 63a6d35fcac8 by R David Murray in branch '3.2': #11686: add missing entries to email __all__ lists. http://hg.python.org/cpython/rev/63a6d35fcac8 New changeset 561fc3b4cc2a by R David Murray in branch 'default': Merge #11686: add missing entries to

[issue11686] Update of some email/ __all__ lists

2012-03-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 32d3ecacdabf by R David Murray in branch '3.2': #11686: news entry. http://hg.python.org/cpython/rev/32d3ecacdabf New changeset 26c8c43dd774 by R David Murray in branch 'default': Merge #11686: news entry. http://hg.python.org/cpython/rev/26c8c43dd

[issue11686] Update of some email/ __all__ lists

2012-03-16 Thread R. David Murray
R. David Murray added the comment: Thanks for the patch, Steffen. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker __

[issue14344] repr of email policies is wrong

2012-03-16 Thread Éric Araujo
New submission from Éric Araujo : >>> import email.policy as p >>> p.default Policy() >>> p.HTTP Policy(["linesep='\\r\\n'", 'max_line_length=None']) I think you wanted Policy(linesep='\r\n', max_line_length=None); the problem comes from __repr__ where a format field is replaced by a list, whic

[issue14323] Normalize math precision in RGB/YIQ conversion

2012-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Yes, put reference in source. I checked that you copied correctly. I think there is some controversy, which I do not understand, about adding tests to maintenance releases without a bug fix. I will ask, so do not do it yet. -- ___

[issue14323] Normalize math precision in RGB/YIQ conversion

2012-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Mark, I know you have worked on numerical algorithms. 1. Do you agree that this is a reasonable change? 2. Should new tests go in maintenance release? -- nosy: +mark.dickinson ___ Python tracker

[issue14323] Normalize math precision in RGB/YIQ conversion

2012-03-16 Thread Brian Landers
Brian Landers added the comment: Updated to add Matlab refs, also added a roundtrip RGB-YIQ-RGB test to match the other conversions. -- Added file: http://bugs.python.org/file24895/colorlib.patch ___ Python tracker

[issue14322] More test coverage for hmac

2012-03-16 Thread Brian Landers
Brian Landers added the comment: Updated to use the correct assert* methods. -- Added file: http://bugs.python.org/file24896/test_hmac.patch ___ Python tracker ___ _

[issue14315] zipfile.ZipFile() unable to open zip File

2012-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thanks. There must be multiple extra fields allowed. This output suggests that a) zipfile mis-parses the extra field in some peculiar case (which I doubt) or b) the file either gives a bad field length or third extra field is mal-formed and that other tools c

[issue14250] for string patterns regex.flags is never equal to 0

2012-03-16 Thread Eli Bendersky
Changes by Eli Bendersky : -- nosy: -eli.bendersky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument

2012-03-16 Thread Eli Bendersky
Eli Bendersky added the comment: Link to related python-dev discussion: http://mail.python.org/pipermail/python-dev/2012-March/117715.html -- ___ Python tracker ___ ___

[issue1683368] object.__init__ shouldn't allow args/kwds

2012-03-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 25b71858cb14 by Benjamin Peterson in branch 'default': make extra arguments to object.__init__/__new__ to errors in most cases (finishes #1683368) http://hg.python.org/cpython/rev/25b71858cb14 -- nosy: +python-dev

[issue1683368] object.__init__ shouldn't allow args/kwds

2012-03-16 Thread Guido van Rossum
Guido van Rossum added the comment: Please don't add python-...@python.org to the nosy list. -- nosy: -python-dev ___ Python tracker ___ _

[issue1683368] object.__init__ shouldn't allow args/kwds

2012-03-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: python-dev is just the name of the robot which notes records changesets. -- ___ Python tracker ___ ___

[issue14345] Document socket.SOL_SOCKET

2012-03-16 Thread anatoly techtonik
New submission from anatoly techtonik : socket.get/setsockopt() docs can be improved by providing description for SOL_SOCKET constant, and link to source code for other level constants and socket level options. -- assignee: docs@python components: Documentation messages: 156140 nosy: d

[issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument

2012-03-16 Thread Eli Bendersky
Eli Bendersky added the comment: Attaching a patch that sets the record straight in 3.3 - the 3 methods will raise TypeError, in both C and Python implementations. Also adds a test that verifies this, and updating the documentation. Note that in the C implementation extend wasn't actually typ

[issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument

2012-03-16 Thread Eli Bendersky
Changes by Eli Bendersky : Removed file: http://bugs.python.org/file24897/issue13782.1.patch ___ Python tracker ___ ___ Python-bugs-list maili

[issue13782] xml.etree.ElementTree: Element.append doesn't type-check its argument

2012-03-16 Thread Eli Bendersky
Changes by Eli Bendersky : Added file: http://bugs.python.org/file24898/issue13782.1.patch ___ Python tracker ___ ___ Python-bugs-list mailing

<    1   2