[issue21258] Add __iter__ support for mock_open

2014-06-12 Thread Paul Koning
Paul Koning added the comment: I created a fix for this. This also fixes a second issue in mock_open, which is that readline() raises StopIteration at EOF rather than returning empty strings. See attached diff. (Is there a better procedure for submitting fixes?) -- nosy: +pkoning

[issue21738] Enum docs claim replacing __new__ is not possible

2014-06-12 Thread Ethan Furman
New submission from Ethan Furman: Replacing __new__ in an Enum subclass is not possible /in the subclass definition/, but is easily replaced via monkey-patching after the class has been defined. Docs need to be updated to reflect this. -- assignee: ethan.furman messages: 220372 nosy:

[issue14074] argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple

2014-06-12 Thread Vasilis Vasaitis
Changes by Vasilis Vasaitis vvasai...@gmail.com: -- nosy: +vvas ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14074 ___ ___ Python-bugs-list

[issue21258] Add __iter__ support for mock_open

2014-06-12 Thread Paul Koning
Paul Koning added the comment: This is the corresponding patch to the test suite. -- Added file: http://bugs.python.org/file35598/testwith.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21258

[issue21739] Add hint about expression in list comprehensions (https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions)

2014-06-12 Thread Karl Richter
New submission from Karl Richter: It would be useful to have a short statement in the docs (https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions) that the expression in a list comprehension isn't put into a block, but evaluated against the same block where it is located

[issue21739] Add hint about expression in list comprehensions (https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions)

2014-06-12 Thread R. David Murray
R. David Murray added the comment: In 3.x a list comprehension (like a generator expression in 2.x) *is* a separate block: [x for x in range(3)] [0, 1, 2] x Traceback (most recent call last): File stdin, line 1, in module NameError: name 'x' is not defined I note that this is not in fact

[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-12 Thread Steven Stewart-Gallus
Steven Stewart-Gallus added the comment: Okay, I made a patch that I hoped dealt with all the criticisms and that fixed up a problem I noted myself. -- Added file: http://bugs.python.org/file35599/fixed-setcloexec.patch ___ Python tracker

[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-12 Thread Steven Stewart-Gallus
Changes by Steven Stewart-Gallus sstewartgallu...@mylangara.bc.ca: Removed file: http://bugs.python.org/file35599/fixed-setcloexec.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21627 ___

[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-12 Thread Steven Stewart-Gallus
Changes by Steven Stewart-Gallus sstewartgallu...@mylangara.bc.ca: Added file: http://bugs.python.org/file35600/fixed-setcloexec.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21627 ___

[issue21739] Add hint about expression in list comprehensions (https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions)

2014-06-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I wouldn't like to use the tutorial to highlight or draw attention a feature/bug that is going away. I recommend leaving the tutorial as-is. For a decade, it has worked well for introducing people to list comprehensions. More complete implementation

[issue21727] Ambiguous sentence explaining `cycle` in itertools documentation

2014-06-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: That's why the code example is there ;-) -- resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21727 ___

[issue21729] Use `with` statement in dbm.dumb

2014-06-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy, after reviewing this, consider backporting it. The original code doesn't have a try/finally around the close() call and that could be considered a bug. -- nosy: +rhettinger ___ Python tracker

[issue21726] Unnecessary line in documentation

2014-06-12 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21726 ___ ___

[issue14102] argparse: add ability to create a man page

2014-06-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I have been wanting this feature for quite a long time Me too. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14102 ___

[issue17911] Extracting tracebacks does too much work

2014-06-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think it makes sense to treat this as a completely new traceback introspection API and ignore the low level details of the legacy API. That would likely be the cleanest approach. -- nosy: +rhettinger ___

[issue21739] Add hint about expression in list comprehensions (https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions)

2014-06-12 Thread R. David Murray
R. David Murray added the comment: OK, I have no objection to leaving the 2.7 tutorial alone. It seems to me that the 3.x tutorial should be fixed, though, because it currently says the unrolled loop is equivalent, but it isn't. The fact that this applies to all other comprehensions in

[issue21652] Python 2.7.7 regression in mimetypes module on Windows

2014-06-12 Thread Ned Deily
Ned Deily added the comment: If there is a regression to be fixed, there needs to be a patch with a test. Anyone? -- nosy: +benjamin.peterson, ned.deily priority: normal - release blocker ___ Python tracker rep...@bugs.python.org

[issue20083] smtplib: support for IDN (international domain names)

2014-06-12 Thread Milan Oberkirch
Changes by Milan Oberkirch milan...@oberkirch.org: -- nosy: +jesstess, zvyn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20083 ___ ___

[issue21732] SubprocessTestsMixin.test_subprocess_terminate() hangs on AMD64 Snow Leop 3.x buildbot

2014-06-12 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- assignee: ronaldoussoren - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21732 ___ ___ Python-bugs-list

[issue21734] compilation of the _ctypes module fails on OpenIndiana: ffi_prep_closure_loc symbol is missing

2014-06-12 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21734 ___ ___ Python-bugs-list mailing list

[issue21740] doctest doesn't allow duck-typing callables

2014-06-12 Thread Antoine Pitrou
New submission from Antoine Pitrou: doctest uses inspect.isfunction() to detect callable objects on which to detect docstrings. Unfortunately, this prevents running doctests on functions which have been decorated to return other types of callables (for example numba's @jit decorator). In the

[issue21205] Add __qualname__ attribute to Python generators and change default __name__

2014-06-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Your patch doesn't have a review link. Perhaps it should be regenerated against updated default? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21205 ___

[issue21741] Convert most of the test suite to using unittest.main()

2014-06-12 Thread Zachary Ware
New submission from Zachary Ware: Attached is a quick-and-dirty script that converts a large chunk of the test suite away from support.run_unittest and test_main to unittest test discovery and unittest.main. Several files are marked as 'do not touch' due to various issues that the script

[issue21725] RFC 6531 (SMTPUTF8) support in smtpd

2014-06-12 Thread R. David Murray
R. David Murray added the comment: For some reason the diff shown by the review link is very different from the one show by the patch file itself. I'm not sure what is causing that, since the diff appears to be in the correct hg format. I don't even know where reitveld is getting the stuff

[issue21725] RFC 6531 (SMTPUTF8) support in smtpd

2014-06-12 Thread R. David Murray
R. David Murray added the comment: Correction on the XXX should we check this: I was thinking about the wrong section of the code. But it is still 'no': by postel's law we should accept dirty data. Currently the consumer of the library can then decide whether or not to reject the dirty data

[issue21205] Add __qualname__ attribute to Python generators and change default __name__

2014-06-12 Thread STINNER Victor
STINNER Victor added the comment: Updated patch, rebased on the default branch. I add a minor unit test (modify also gen.__name__). -- Added file: http://bugs.python.org/file35603/gen_qualname-2.patch ___ Python tracker rep...@bugs.python.org

[issue17911] Extracting tracebacks does too much work

2014-06-12 Thread STINNER Victor
STINNER Victor added the comment: While trying to fix a similar issue for the asyncio project, I wrote the following code: https://bitbucket.org/haypo/misc/src/ce48d7b3ea1d223691e496e41aca8f5784671cd5/python/suppress_locals.py?at=default I was not aware that a similar approach (attached

[issue11437] IDLE crash on startup with typo in config-keys.cfg

2014-06-12 Thread Tal Einat
Tal Einat added the comment: I don't think the patch should currently be committed. I agree with Terry: we should first fix the issue whereby the key config is read repeatedly. Given such a fix, the problematic known_invalid workaround in the patch would no longer be necessary. As a side

[issue13963] dev guide has no mention of mechanics of patch review

2014-06-12 Thread Mark Lawrence
Mark Lawrence added the comment: This strikes me as a sizable hole in our documentation. Are there any plans to implement this as I quick glance at the devguide has no references to rietveld that I can find? -- nosy: +BreamoreBoy ___ Python

[issue21709] logging.__init__ assumes that __file__ is always set

2014-06-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset bec6f18dd636 by Vinay Sajip in branch '3.4': Issue #21709: Improved implementation to cover the frozen module case. http://hg.python.org/cpython/rev/bec6f18dd636 New changeset bd44ad77013a by Vinay Sajip in branch 'default': Issue #21709: Merged

[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2014-06-12 Thread Mark Lawrence
Mark Lawrence added the comment: ping. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19873 ___ ___ Python-bugs-list mailing

[issue15934] flaky test in test_ftplib

2014-06-12 Thread Mark Lawrence
Mark Lawrence added the comment: Can it be assumed that this is no longer a problem? -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15934 ___

[issue18082] Inconsistent behavior of IOBase methods on closed files

2014-06-12 Thread Mark Lawrence
Mark Lawrence added the comment: Could we have a response for the record please. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18082 ___

[issue1724366] cPickle module doesn't work with universal line endings

2014-06-12 Thread Mark Lawrence
Mark Lawrence added the comment: Can this be closed as issue616013 was? -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1724366 ___

[issue21711] Remove site-python support

2014-06-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3852afce2ca3 by Antoine Pitrou in branch 'default': Issue #21711: support for site-python directories has now been removed from the site module (it was deprecated in 3.4). http://hg.python.org/cpython/rev/3852afce2ca3 -- nosy: +python-dev

[issue21711] Remove site-python support

2014-06-12 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21711 ___

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2014-06-12 Thread Mark Lawrence
Mark Lawrence added the comment: Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)] on win32 Type copyright, credits or license() for more information. '{0:d}'.format('a') Traceback (most recent call last): File pyshell#0, line 1, in module

[issue3931] codecs.charmap_build is untested and undocumented

2014-06-12 Thread Mark Lawrence
Mark Lawrence added the comment: msg120987 states the opposite to msg112747 so what do we do with this issue? -- nosy: +BreamoreBoy versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org

[issue19351] python msi installers - silent mode

2014-06-12 Thread Mark Lawrence
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: +steve.dower versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19351 ___

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2014-06-12 Thread Eric V. Smith
Eric V. Smith added the comment: I believe that comment was referring to the subject of this bug: $ ./python Python 3.4.1+ (3.4:bec6f18dd636, Jun 12 2014, 20:23:30) [GCC 4.8.1] on linux Type help, copyright, credits or license for more information. format([], 'd') Traceback (most recent call

[issue19495] Enhancement for timeit: measure time to run blocks of code using 'with'

2014-06-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: I have been using something like this for many years now and it is very handy. I have an early version of the code posted here: http://code.activestate.com/recipes/577896 Over the next week or so, I'll prepare a patch. Because it's a new feature, it must be

[issue21742] WatchedFileHandler can fail due to race conditions or file open issues.

2014-06-12 Thread Vishvananda Ishaya
New submission from Vishvananda Ishaya: If there is a failure during the re-opening of the file WatchedFileHandler can lose the ability to log and starts throwing IOErrors. -- messages: 220403 nosy: vishvananda priority: normal severity: normal status: open title: WatchedFileHandler

[issue21742] WatchedFileHandler can fail due to race conditions or file open issues.

2014-06-12 Thread Vishvananda Ishaya
Vishvananda Ishaya added the comment: The attached file illustrates the error when attempting to call handler.emit() from multiple threads at the same time. -- Added file: http://bugs.python.org/file35604/log.py ___ Python tracker

[issue21742] WatchedFileHandler can fail due to race conditions or file open issues.

2014-06-12 Thread Vishvananda Ishaya
Vishvananda Ishaya added the comment: The attached file illustrates the error when attempting to call handler.emit() when the file cannot be opened. Even if this situation is later remedied all future emit() calls will fail since stream.flush() is called on a fd that has already been closed.

[issue21230] imghdr does not accept adobe photoshop mime type

2014-06-12 Thread R. David Murray
R. David Murray added the comment: Closing this in favor of issue 16512, which I will expand to include this case. -- resolution: - duplicate stage: - resolved status: open - closed superseder: - imghdr doesn't support jpegs with an ICC profile

[issue3931] codecs.charmap_build is untested and undocumented

2014-06-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: I've found it rather ugly to even understand from the lack of code comments for the C level API it's wrapping. If nothing else, comments explaining the usage and purpose might be helpful. -- nosy: +josh.rosenberg

[issue21742] WatchedFileHandler can fail due to race conditions or file open issues.

2014-06-12 Thread Vishvananda Ishaya
Vishvananda Ishaya added the comment: Example diff against python 2.7.6 that fixes the issues -- keywords: +patch Added file: http://bugs.python.org/file35606/log.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21742

[issue16512] imghdr doesn't recognize variant jpeg formats

2014-06-12 Thread R. David Murray
R. David Murray added the comment: Issue 21230 reports a parallel problem with recognizing photoshop images. We need a patch with tests covering the variant types we know about. I don't have a strong opinion on the simple two byte test versus the more complex test in msg220346, but following

[issue21721] socket.sendfile() should use TransmitFile on Windows

2014-06-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Copying my comment from the previous issue: For TransmitFile support, the Windows function to turn an integer file descriptor into a WinAPI file HANDLE should be _get_osfhandle: http://msdn.microsoft.com/en-us/library/ks2530z6.aspx This was mentioned on the

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2014-06-12 Thread py.user
py.user added the comment: Python 2.7.7 is still printing. format([], 'd') Traceback (most recent call last): File stdin, line 1, in module ValueError: Unknown format code 'd' for object of type 'str' -- ___ Python tracker rep...@bugs.python.org

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2014-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Yes, the deprecation in 3.3 did not apply to 2.7. -- versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13790

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2014-06-12 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13790 ___ ___

[issue21656] Create test coverage for TurtleScreenBase in Turtle

2014-06-12 Thread Lita Cho
Changes by Lita Cho lita@gmail.com: -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21656 ___

[issue17172] Add turtledemo to IDLE menu

2014-06-12 Thread Lita Cho
Lita Cho added the comment: Hi Terry, can we close this issue? Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17172 ___ ___

[issue21743] Create tests for RawTurtleScreen

2014-06-12 Thread Lita Cho
New submission from Lita Cho: Create test coverage for the RawTurtleScreen class. -- messages: 220414 nosy: Lita.Cho, jesstess priority: normal severity: normal status: open title: Create tests for RawTurtleScreen ___ Python tracker

[issue21742] WatchedFileHandler can fail due to race conditions or file open issues.

2014-06-12 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21742 ___ ___ Python-bugs-list mailing list

[issue21694] IDLE - Test ParenMatch

2014-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I just discovered what I consider to be a bug in parenmatch. Consider (3 + 4 - 1) When I type the closing paren or put the cursor on the second line and hit ^0, the highlight extends from ( to ), inclusive, as it should. If I put the cursor on the first

[issue21719] Returning Windows file attribute information via os.stat()

2014-06-12 Thread Ben Hoyt
Ben Hoyt added the comment: I've got a patch for this. Need to finish the docs and add tests, and then I'll post here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21719 ___

[issue21744] itertools.islice() goes over all the pre-initial elements even if the iterable can seek

2014-06-12 Thread Jesús Cea Avión
New submission from Jesús Cea Avión: If L is a big sequence and I do itertool.islice(L, 100, None), islice will go over a million elements before returning the first that I actually cared. Since L is a sequence, islice could go directly to the element 100. My program performance

[issue21745] Devguide: mention requirement to install Visual Studio SP1 on Windows

2014-06-12 Thread Ben Hoyt
New submission from Ben Hoyt: Per my email on core-mentorship, the instructions for compiling CPython on Windows at https://docs.python.org/devguide/setup.html#windows are good, however I did have one issue where the dev guide didn't help. During the link step, I got this error: LINK : fatal

[issue21745] Devguide: mention requirement to install Visual Studio SP1 on Windows

2014-06-12 Thread Ben Hoyt
Changes by Ben Hoyt benh...@gmail.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21745 ___ ___ Python-bugs-list

[issue21745] Devguide: mention requirement to install Visual Studio SP1 on Windows

2014-06-12 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- components: +Devguide -Documentation nosy: +ezio.melotti, steve.dower, zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21745 ___

[issue11588] Add necessarily inclusive groups to argparse

2014-06-12 Thread paul j3
paul j3 added the comment: I have developed a UsageGroup class that can implement nested 'inclusive' tests. Using this, the original example in this issue could be coded as 3 groups, 2 mutually_exclusive and inclusive one. parser = ArgumentParser(prog='PROG',

<    1   2