[issue21583] use support.captured_stderr context manager - test_logging

2014-05-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset f1393e826608 by Vinay Sajip in branch 'default': Closes #21583: Improved test_logging. Thanks to Diana Joan Clarke for the patch. http://hg.python.org/cpython/rev/f1393e826608 -- nosy: +python-dev resolution: -> fixed stage: patch review ->

[issue21592] Make statistics.median run in linear time

2014-05-31 Thread Thomas Dybdahl Ahle
Thomas Dybdahl Ahle added the comment: I think "minimize expected-case time" is a good goal. If we wanted "minimize worst-case time" we would have to use k-means rather than quickselect. My trials on random data, where sort arguably has a disadvantage, suggests sorting is about twice as fast f

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please add a test with parse() raising an exception? Yet one nitpick. Instead of fp = openfile('msg_02.txt', 'rb') self.addCleanup(fp.close) ... you can write with openfile('msg_02.txt', 'rb') as fp: ...

[issue21619] Cleaning up a subprocess with a broken pipe

2014-05-31 Thread Martin Panter
New submission from Martin Panter: The documentation for the “subprocess” module says that a “with” statement will “wait for” the process, implying that it does not leave a zombie. However this is not the case if there is buffered input data: $ python3 -Wall -bt -q >>> import subprocess >>> wi

[issue21306] PEP 466: backport hmac.compare_digest

2014-05-31 Thread Donald Stufft
Donald Stufft added the comment: That's also a security sensitive thing, you don't want to compare two different encoding and have it accidentally fail. Strictly speaking you can only do a constant time comparison on bytes, the fact it accepts unicode at all (even on Python 3.x) is a convenien

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy, here is the latest patch incorporating your request. -- Added file: http://bugs.python.org/file35420/bytes_parser_dont_close_file_v3.patch ___ Python tracker ___

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I meant to test parser with invalid message, so that parse() raises an exception, and file shouldn't be closed after this. -- ___ Python tracker _

[issue21620] OrderedDict KeysView set operations not supported

2014-05-31 Thread Matthew Lauria
New submission from Matthew Lauria: I noticed that doing set operations on an OrderedDict KeysView only works when the KeysView is the first input to the expression, and not when it's the second input. This is not the case for dicts. Python 3.4.1 (default, May 31 2014, 11:25:02) [GCC 4.8.2] o

[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: Are you aware that the subprocess module does use /proc/self/fd in Python 3.2 and later? The fd closing is not done from Python code. See Modules/_posixsubprocess.c - http://hg.python.org/cpython/file/53fa2c9523d4/Modules/_posixsubprocess.c -- nosy

[issue21620] OrderedDict KeysView set operations not supported

2014-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Already fixed in issue8743. -- nosy: +serhiy.storchaka resolution: -> out of date status: open -> closed superseder: -> set() operators don't work with collections.Set instances ___ Python tracker

[issue21573] Clean up turtle.py code formatting

2014-05-31 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue21582] use support.captured_stdx context managers - test_asyncore

2014-05-31 Thread Ezio Melotti
Ezio Melotti added the comment: The patch includes two sets of changes: 1) uses support.captured_stderr() where appropriate; 2) removes some "from" import and uses support.x instead; The former looks OK to me and could be applied, the latter doesn't look very useful. -- nosy: +ezio.mel

[issue21592] Make statistics.median run in linear time

2014-05-31 Thread Ezio Melotti
Ezio Melotti added the comment: > I have written some proof of concept code here [1], I would appreciate > you commenting on it, before I turn it into a patch, as I haven't > contributed code to Python before. I would encourage you to consult the devguide, prepare a patch, and upload it here s

[issue21604] Misleading 2to3 fixer name in documentation: standard_error

2014-05-31 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +easy nosy: +jesstess stage: -> needs patch type: -> enhancement ___ Python tracker ___ ___ P

[issue21611] int() docstring - unclear what number is

2014-05-31 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti, zach.ware type: -> enhancement versions: -Python 3.1, Python 3.2, Python 3.3 ___ Python tracker ___ __

[issue21582] use support.captured_stdx context managers - test_asyncore

2014-05-31 Thread diana
diana added the comment: I removed some of the "from" imports and used support.x instead for consistency. "support" was already being imported, and many of the things imported from "support" were already using support.x. I just made them all the same. -- _

[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-31 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: -gps ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: regardless, the current C code for this does limit itself to the sysconf(_SC_OPEN_MAX) max_fd from module import time when closing fds found in /proc/self/fd so this code does still have a bug in that fds higher than that will remain unclosed (at which point

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: The Parse class does not throw exception if given invalid message: Assume /tmp/a.txt contains garbage, such as: "&" With this code: with open("/tmp/a.txt", "r") as fp: msg = email.parser.Parser().parse(fp) # does not throw exception print

[issue21573] Clean up turtle.py code formatting

2014-05-31 Thread Jessica McKellar
Jessica McKellar added the comment: Terry, thank you for all the time you've been putting into the GSoC and OPW tickets. > Questions: is there project link? are any of the mentors core developers, > with commit rights? or would you need commits from someone like me? https://wiki.python.org/mo

[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset e90024db8d6c by Benjamin Peterson in branch '2.7': openssl requires nasm (#21462) http://hg.python.org/cpython/rev/e90024db8d6c -- ___ Python tracker _

[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-31 Thread Benjamin Peterson
Benjamin Peterson added the comment: On Fri, May 30, 2014, at 12:54, Zachary Ware wrote: > > Zachary Ware added the comment: > > Looks like the AMD64 buildbot isn't happy with OpenSSL 1.0.1g: > http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%202.7/builds/1223/steps/compile/logs/s

[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7095a9bfbe76 by Steve Dower in branch '2.7': Issue #21462 PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds http://hg.python.org/cpython/rev/7095a9bfbe76 New changeset 8e2cda42b466 by Benjamin Peterson in branch '2.7': openssl requires nasm

[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-31 Thread Nick Coghlan
Nick Coghlan added the comment: Will this be in 2.7.7? If so, I'll update the draft What's New changes in issue #21569 accordingly (as well as the implementation status in PEP 466) -- ___ Python tracker __

[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-31 Thread Benjamin Peterson
Benjamin Peterson added the comment: Yes. On Sat, May 31, 2014, at 11:30, Nick Coghlan wrote: > > Nick Coghlan added the comment: > > Will this be in 2.7.7? If so, I'll update the draft What's New changes in > issue #21569 accordingly (as well as the implementation status in PEP > 466) > > --

[issue21462] PEP 466: upgrade OpenSSL in the Python 2.7 Windows builds

2014-05-31 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue21539] pathlib's Path.mkdir() should allow for "mkdir -p" functionality

2014-05-31 Thread Berker Peksag
Berker Peksag added the comment: Updated patch. Thank you Barry and Antoine. -- stage: -> patch review Added file: http://bugs.python.org/file35421/issue21539_v2.diff ___ Python tracker ___

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread R. David Murray
R. David Murray added the comment: Right, part of the parser contract is to not throw exceptions. Traditionally, a bug could result in an exception, but not an invalid message. However, using the new email policies, it is possible to *request* that it raise exceptions instead of registering d

[issue21569] PEP 466: Python 2.7 What's New preamble changes

2014-05-31 Thread Nick Coghlan
Nick Coghlan added the comment: New patch, with the new section moved to the end of the file, just before the acknowledgements. It now has subsections for each relevant PEP, as Ezio's comments made me realise that PEP 434 (the IDLE consistency PEP) also deserved a mention. I'm happy with this

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If the parser itself doesn't raise exceptions, we should test with input stream raising an exception. -- ___ Python tracker ___ _

[issue21621] Add note to 3.x What's New re Idle changes in bugfix releases

2014-05-31 Thread Terry J. Reedy
New submission from Terry J. Reedy: In #21569, revising What's New for 2.7, Nick is planning to add the following: +PEP 434: IDLE Enhancement Exception for All Branches + + +:pep:`434` describes a general exemption for changes made to the IDLE

[issue21569] PEP 466: Python 2.7 What's New preamble changes

2014-05-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think the Idle section is such a great idea I propose to add something similar to future What's New for 3.x. See #21621. -- ___ Python tracker __

[issue21604] Misleading 2to3 fixer name in documentation: standard_error

2014-05-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8fa8c290c165 by Benjamin Peterson in branch '2.7': give the correct fixer name (closes #21604) http://hg.python.org/cpython/rev/8fa8c290c165 New changeset 5d21491733d8 by Benjamin Peterson in branch '3.4': give the correct fixer name (closes #21604)

[issue21304] PEP 466: Backport hashlib.pbkdf2_hmac to Python 2.7

2014-05-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset e4da3ba9dcac by Benjamin Peterson in branch '2.7': backport hashlib.pbkdf2_hmac per PEP 466 (closes #21304) http://hg.python.org/cpython/rev/e4da3ba9dcac -- nosy: +python-dev resolution: -> fixed stage: -> resolved status: open -> closed

[issue21573] Clean up turtle.py code formatting

2014-05-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: I like the proposal and would like to see it happen. My concern is to avoid having interns write patches that get rejected for non-technical reasons. I won't make any specific suggestions until I get more information either from the pydev thread http://thread.

[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: There appear to be a two bugs here, depending on which platform subprocess is being used on. 1) on systems where it uses /prod/self/fd, /dev/fd or similar: It should not pay attention to end_fd at all. It knows the list of actual open fds and should use t

[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-31 Thread Steven Stewart-Gallus
Steven Stewart-Gallus added the comment: I agree that this is not a likely scenario but I can think of one mildly plausible scenario. Suppose some web server runs a Python CGI script but has a bug that leaks a file descriptor into the script. The web server sandboxes the Python CGI script a littl

[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-31 Thread akira
akira added the comment: > getrlimit and setrlimit are not exposed in the os module; you must use ctypes > or an extension module to call them from Python: There is `resource` module: >>> import resource >>> resource.getrlimit(resource.RLIMIT_NOFILE) (1024, 4096) -- nosy: +akir

[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-05-31 Thread Steven Stewart-Gallus
Steven Stewart-Gallus added the comment: I found another problem with _close_open_fd_range_safe. POSIX leaves the state of a file descriptor given to close undefined if the close fails with EINTR. I believe but haven't double checked that close should not be retried on EINTR on all of our support

[issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME

2014-05-31 Thread Jeremy Huntwork
New submission from Jeremy Huntwork: On my system, the C library (musl) intentionally does not include a SONAME entry. This method in particular fails: http://hg.python.org/cpython/file/076705776bbe/Lib/ctypes/util.py#l133 The function seems to jump through some hoops which may not be necessa

[issue21623] build ssl failed use vs2010 express

2014-05-31 Thread Mo Jia
New submission from Mo Jia: Here is the failed message . Project "D:\Hg\Python\Python\PCbuild\_ssl.vcxproj" (17) is building "D:\Hg\Python\Python\PCbuild\ssl.vcxproj" (18) on node 1 (default targets). Build:

[issue21592] Make statistics.median run in linear time

2014-05-31 Thread Steven D'Aprano
Steven D'Aprano added the comment: I've run some performance tests on six variations of the O(N) select algorithm, based on Tim Peters' and Thomas Ahle's code, comparing them to the naive O(N log N) "sort first" algorithm, and sorting is consistently faster up to the limit I tested. About the

[issue21477] Idle: improve idle_test.htest

2014-05-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 334b6725b2f7 by Terry Jan Reedy in branch '2.7': Issue #21477: Update htest docstring and remove extraneous differences between http://hg.python.org/cpython/rev/334b6725b2f7 New changeset e56c3585ea80 by Terry Jan Reedy in branch '3.4': Issue #21477

[issue21592] Make statistics.median run in linear time

2014-05-31 Thread Alex Gaynor
Alex Gaynor added the comment: I ran the script (modified very slightly for python 2 support) under PyPy 2.3: $ pypy select.py == Single call mode == Nsort select7 select23 select47 select97 select select2

[issue21624] Idle: polish htests

2014-05-31 Thread Terry J. Reedy
New submission from Terry J. Reedy: #21477 was about finishing the htest framework and creating at least a first draft of each human test. This issue is about refining individual tests. One remaining issue is placement of the master window and placement of test windows in relation to the maste

[issue21477] Idle: improve idle_test.htest

2014-05-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: I regard the goal of this issue as having been accomplished. I opened #21624 for any further work on htests. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed superseder: -> Idle: polish htests

[issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order

2014-05-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: I re-read turtledemo and it seems that is could exit without calling root.destroy. The 'if main' block follows: demo = DemoWindow() RUN = True while RUN: try: #print("ENTERING mainloop") demo.root.mainloop() e

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: Ok, here is the updated patch based on R. David Murray's help. Thanks! -- Added file: http://bugs.python.org/file35424/bytes_parser_dont_close_file_v4.patch ___ Python tracker _

[issue21623] build ssl failed use vs2010 express

2014-05-31 Thread Ned Deily
Changes by Ned Deily : -- nosy: +steve.dower, zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/