[issue18943] argparse: default args in mutually exclusive groups
paul j3 added the comment: Changing the test from if argument_values is not action.default: to if argument_values is not action.default and \ (action.default is None or argument_values != action.default): makes the behavior more consistent. Strings and large ints behave like small ints, matching the default and not counting as present Simply using `argument_values != action.default` was not sufficient, since it raised errors in existing test cases (such as ones involving Nones). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18943 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18438] Obsolete url in comment inside decimal module
Roundup Robot added the comment: New changeset 44ed0cd3dc6d by Senthil Kumaran in branch '2.7': Fix the dead link of IEEE_854-1987 standard with the Wikipedia entry. http://hg.python.org/cpython/rev/44ed0cd3dc6d New changeset 0eef1670f316 by Senthil Kumaran in branch '3.3': Fix the dead link of IEEE_854-1987 standard with the Wikipedia entry. http://hg.python.org/cpython/rev/0eef1670f316 New changeset 44fa59286012 by Senthil Kumaran in branch 'default': merge from 3.3 http://hg.python.org/cpython/rev/44fa59286012 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18438 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18438] Obsolete url in comment inside decimal module
Senthil Kumaran added the comment: Fixed that in 2.7,3.3 and 3.4 -- nosy: +orsenthil resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18438 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18968] Find a way to detect incorrectly skipped tests
Ethan Furman added the comment: Run the test suite both with and without the patch, and compare the results. Additional skipped tests, additional failed tests, or less than the number of expected additional tests signal a problem. The first two should be automatable, the last depends on the human paying attention. ;) This should at least deal with problems created by a patch. -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18968 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9974] tokenizer.untokenize not invariant with line continuations
Dwayne Litzenberger added the comment: @amk: I'd appreciate it if you did. :) I ran into this bug while writing some code that converts b... into ... in PyCrypto's setup.py script (for backward compatibility with Python 2.5 and below). -- nosy: +DLitz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9974 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18967] Find a less conflict prone approach to Misc/NEWS
Nick Coghlan added the comment: The one I ran into earlier today tried to merge the entirety of the 3.3.x RC NEWS into the 3.4 NEWS :P -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18967 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18963] test_selectors test_above_fd_setsize cases fail on OS X due to infinite hard limit
Charles-François Natali added the comment: R. David Murray added the comment: See also issue issue 17409. The code isn't setting it to RLIM_INFINITY explicitly, though, so this must mean that OSX is reporting an infinite hard limit when the hard limit is not in fact infinite. Seems like this is an OSX bug that we will have to work around somehow. Indeed. I saw this while testing on custom buildbots, and opted for the simplest solution: I added a @require_mac_version decorator, hoping this would be solved in recent OSX versions. Apparently not :) As a simple check, does the following work on OSX ? limit = resource.getrlimit(resource.RLIMIT_NOFILE) resource.setrlimit(resource.RLIMIT_NOFILE, limit) Does the attached patch solve this? -- keywords: +patch Added file: http://bugs.python.org/file31660/selectors_osx.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18963 ___diff -r 14972c999e80 Lib/test/test_selectors.py --- a/Lib/test/test_selectors.pyFri Sep 06 21:12:22 2013 +0200 +++ b/Lib/test/test_selectors.pySun Sep 08 10:28:48 2013 +0200 @@ -301,7 +301,6 @@ class ScalableSelectorMixIn: -@support.requires_mac_ver(10, 5) @unittest.skipUnless(resource, Test needs resource module) def test_above_fd_setsize(self): # A scalable implementation should have no problem with more than @@ -313,7 +312,7 @@ self.addCleanup(resource.setrlimit, resource.RLIMIT_NOFILE, (soft, hard)) NUM_FDS = hard -except OSError: +except (OSError, ValueError): NUM_FDS = soft # guard for already allocated FDs (stdin, stdout...) ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18963] test_selectors test_above_fd_setsize cases fail on OS X due to infinite hard limit
Ned Deily added the comment: As a simple check, does the following work on OSX ? limit = resource.getrlimit(resource.RLIMIT_NOFILE) resource.setrlimit(resource.RLIMIT_NOFILE, limit) It doesn't produce an exception. Does the attached patch solve this? With the patch, test_selectors no longer fails. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18963 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18934] multiprocessing: use selectors module
Roundup Robot added the comment: New changeset 0e52b9f77dbf by Charles-François Natali in branch 'default': Issue #18934: Use poll/select-based selectors for multiprocessing.Connection, http://hg.python.org/cpython/rev/0e52b9f77dbf -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18934 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18963] test_selectors test_above_fd_setsize cases fail on OS X due to infinite hard limit
Roundup Robot added the comment: New changeset 9ba1432fdc5a by Charles-François Natali in branch 'default': Issue #18963: Fix test_selectors.test_above_fd_setsize on OS X, where the http://hg.python.org/cpython/rev/9ba1432fdc5a -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18963 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18957] PYTHONFAULTHANDLER enables faulthandler when the variable is empty
STINNER Victor added the comment: Do you mean something like *this*? this - the patch, pythonfaulthandler_env_var.patch. Thanks for the patch, I combined it with other changes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18957 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18957] PYTHONFAULTHANDLER enables faulthandler when the variable is empty
Roundup Robot added the comment: New changeset 5c2cf4349adc by Victor Stinner in branch 'default': Close #18957: The PYTHONFAULTHANDLER environment variable now only enables the http://hg.python.org/cpython/rev/5c2cf4349adc -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18957 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18904] Unnecessary test in file descriptor inheritance test
Roundup Robot added the comment: New changeset b13cec63b495 by Victor Stinner in branch 'default': Issue #18904: Improve os.get/set_inheritable() tests http://hg.python.org/cpython/rev/b13cec63b495 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18904 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18904] Unnecessary test in file descriptor inheritance test
STINNER Victor added the comment: Thanks for the report and the patch. I removed the duplicate test, but I also added new tests using fcntl and FD_CLOEXEC. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18904 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18969] test suite: enable faulthandler timeout in assert_python
New submission from Charles-François Natali: Currently, the test suite, as well as processes spawned by the script_helper.assert_python family, are run with faulthandler enabled. That's great to debug crashes, but it would be even better if those processes were started with faulthandler's timeout: 1) Most deadlock-prone tests are run in child processes, so in case of deadlock, you don't get any trace: http://buildbot.python.org/all/builders/AMD64 FreeBSD 10.0 3.x/builds/353/steps/test/logs/stdio [269/380] test_threading Timeout (1:00:00)! Thread 0x000801c06400: File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/subprocess.py, line 1615 in _communicate_with_poll File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/subprocess.py, line 1535 in _communicate File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/subprocess.py, line 945 in communicate File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/script_helper.py, line 36 in _assert_python File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/script_helper.py, line 55 in assert_python_ok File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/test_threading.py, line 617 in assertScriptHasOutput File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/test_threading.py, line 692 in test_4_joining_across_fork_in_worker_thread File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/unittest/case.py, line 496 in run File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/unittest/case.py, line 535 in __call__ File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/unittest/suite.py, line 117 in run File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/unittest/suite.py, line 79 in __call__ File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/unittest/suite.py, line 117 in run File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/unittest/suite.py, line 79 in __call__ File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/unittest/suite.py, line 117 in run File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/unittest/suite.py, line 79 in __call__ File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/unittest/runner.py, line 168 in run File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/support/__init__.py, line 1649 in _run_suite File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/support/__init__.py, line 1683 in run_unittest File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/regrtest.py, line 1275 in lambda File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/regrtest.py, line 1276 in runtest_inner File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/regrtest.py, line 965 in runtest File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/regrtest.py, line 761 in main File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/regrtest.py, line 1560 in main_in_temp_cwd File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/__main__.py, line 3 in module File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/runpy.py, line 73 in _run_code File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/runpy.py, line 160 in _run_module_as_main *** Error code 1 Here, we just see that the main process is waiting for its child to complete, but we don't know anything about the child process stack. 2) As an added benefit, this would prevent dangling child processes: when the parent is killed, they're reparented to init, and can keep running arbitrarily long, consuming memory/CPU/process table entry (well, maybe the buildbot scripts kill the whole process group, I don't know). -- components: Tests messages: 197239 nosy: haypo, neologix priority: normal severity: normal status: open title: test suite: enable faulthandler timeout in assert_python type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18969 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18904] Unnecessary test in file descriptor inheritance test
Roundup Robot added the comment: New changeset b7f6f6f59e91 by Victor Stinner in branch 'default': Issue #18904: test_socket: add inheritance tests using fcntl and FD_CLOEXEC http://hg.python.org/cpython/rev/b7f6f6f59e91 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18904 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18935] test_regrtest.test_timeout failure
Charles-François Natali added the comment: Anyone? (The patch is trivial, but I'm not familiar with regrtest). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18935 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18969] test suite: enable faulthandler timeout in assert_python
STINNER Victor added the comment: I see two options: * faulthandler calls killpg(SIGABRT) on timeout to kill child processes (but it should ignore temporary the signal to not kill itself) * use a timeout, but shorter than the global timeout, for child processes Not all tests use script_helper. But this is probably a different issue ;-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18969 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18935] test_regrtest.test_timeout failure
STINNER Victor added the comment: The patch looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18935 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18963] test_selectors test_above_fd_setsize cases fail on OS X due to infinite hard limit
Charles-François Natali added the comment: I knew this wouldn't be so easy with OS X... http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/6916/steps/test/logs/stdio == ERROR: test_above_fd_setsize (test.test_selectors.PollSelectorTestCase) -- Traceback (most recent call last): File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 56, in testPartExecutor yield File /Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/unittest/case.py, line 528, in doCleanups function(*args, **kwargs) ValueError: not allowed to raise maximum limit -- Basically, we can't restore RLIMIT_NOFILE to its original value (from the cleanup callback): since this works on Ned's machine, I assume this has been fixed in recent OS X versions. So I'll restore the requires_mac_vers() decorator. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18963 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18935] test_regrtest.test_timeout failure
Roundup Robot added the comment: New changeset 2982ac8b45bc by Charles-François Natali in branch 'default': Issue #18935: Fix test_regrtest.test_timeout when built --without-threads (the http://hg.python.org/cpython/rev/2982ac8b45bc -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18935 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18963] test_selectors test_above_fd_setsize cases fail on OS X due to infinite hard limit
Roundup Robot added the comment: New changeset fa735675e485 by Charles-François Natali in branch 'default': Issue #18963: skip test_selectors.test_above_fd_setsize on older OS X versions. http://hg.python.org/cpython/rev/fa735675e485 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18963 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Antoine Pitrou added the comment: Indeed the Ubuntu Shared buildbot started failing again. There's probably a timing-dependent behaviour here (which is why test_is_alive_after_fork() tries several times, after all). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Antoine Pitrou added the comment: I think I've found the answer: the thread is sometimes already stopped by the time the child is forked, so it doesn't appear in _enumerate() anymore (it left the _active dict). Therefore its locks are not reset in _after_fork(). Oh, I also get the following sporadic failure which is triggered by slight change in semantics with Thread.join(timeout) :-) == FAIL: test_various_ops (test.test_threading.ThreadTests) -- Traceback (most recent call last): File /home/antoine/cpython/default/Lib/test/test_threading.py, line 113, in test_various_ops self.assertTrue(not t.is_alive()) AssertionError: False is not true -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18829] csv produces confusing error message when passed a non-string delimiter
Vajrasky Kok added the comment: Well, what about None? $ python3 -c 'import csv; reader = csv.reader(foo, delimiter=None)' Traceback (most recent call last): File string, line 1, in module TypeError: delimiter must be set English grammatically speaking, we should get this kind of error: ValueError: delimiter must be string, not None But computer science-ly speaking, the exception message delimiter must be set is correct because setting null or None value to a variable can be considered as same as unsetting that variable, hence error message must be set. And I would argue the empty string can be considered as one of a kind with None in this case. But we'll see other people's opinions. I am also not sure about this case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18935] test_regrtest.test_timeout failure
Charles-François Natali added the comment: Committed. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18935 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Roundup Robot added the comment: New changeset 74dc664ad699 by Antoine Pitrou in branch 'default': Issue #18808 again: fix the after-fork logic for not-yet-started or already-stopped threads. http://hg.python.org/cpython/rev/74dc664ad699 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18418] Thread.isAlive() sometimes True after fork
koobs added the comment: For reference, this test is successfuly identifying failures on koobs-freebsd and koobs-freebsd10 buildbots: == FAIL: test_is_alive_after_fork (test.test_threading.ThreadTests) -- Traceback (most recent call last): File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/test_threading.py, line 478, in test_is_alive_after_fork self.assertEqual(0, status) AssertionError: 0 != 256 -- nosy: +koobs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
koobs added the comment: Adding reference to failing tests on koobs-freebsd9 and koobs-freebsd10 buildbots: == FAIL: test_is_alive_after_fork (test.test_threading.ThreadTests) -- Traceback (most recent call last): File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/test_threading.py, line 478, in test_is_alive_after_fork self.assertEqual(0, status) AssertionError: 0 != 256 -- nosy: +koobs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18418] Thread.isAlive() sometimes True after fork
Antoine Pitrou added the comment: I've identified a possible cause (and fix) for the sporadic test failures in 74dc664ad699. If the solution holds, it should be backported to 3.3 and 2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18903] IDLE file-completion is case-sensitive in Windows
Terry J. Reedy added the comment: A possible complication is that at least in part, the same code (AutoComplete.py) is used for both attribute completion and filename completion. Attribute completion is always case sensitive. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18903 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18962] Add special case for single iterator in heapq.merge function
Wouter Bolsterlee added the comment: An additional speedup would be to add a if len(h) == 1 check inside the while loop, and just yield from the remaining iterator if a single iterable remains. This would also speed up merges with multiple inputs, as it doesn't do the whole heapreplace() loop for the last remaining iterable. Example: merge([], [], [], range(10). This would involve some more refactoring inside the function though, since the current implementation only stores the .next() function for each iterable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18962 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18904] Unnecessary test in file descriptor inheritance test
Roundup Robot added the comment: New changeset aea58e1cae75 by Victor Stinner in branch 'default': Issue #18904: test_os and test_socket use unittest.skipIf() to check if fcntl http://hg.python.org/cpython/rev/aea58e1cae75 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18904 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18963] test_selectors test_above_fd_setsize cases fail on OS X due to infinite hard limit
Charles-François Natali added the comment: Alright, it should be fixed now, thanks for the report. -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18963 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12916] Add inspect.splitdoc
Changes by Ben Finney ben+pyt...@benfinney.id.au: -- nosy: +bignose ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12916 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18970] run_setup() behavior differs from cli invocation of setup.py
Changes by Lukas Wunner lu...@wunner.de: Added file: http://bugs.python.org/file31662/run_setup-py31.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18970] run_setup() behavior differs from cli invocation of setup.py
New submission from Lukas Wunner: The principle of least surprise suggests that run_setup() should behave equivalently to a command line invocation of setup.py. However there are currently (at least) two issues preventing this: (a) When calling exec(), both a globals and a locals dict is passed. According to the documentation: If exec gets two separate objects as globals and locals, the code will be executed as if it were embedded in a class definition. [1] Consequence: The scope of names defined in a class block is limited to the class block; it does not extend to the code blocks of methods. [2] One example where this is relevant is the MarkupSafe PyPI package [3]: Its setup.py defines a class BuildFailed which is used in other methods defined in setup.py. Calling run_setup() with this setup.py will therefore fail. Calling setup.py from the command line works. Solution: Only pass a globals dict to exec(). (b) The globals dict does not contain '__name__':'__main__'. Many setup.py scripts use the idiomatic 'conditional script' stanza if __name__ == '__main__'. An example is the PyYAML PyPI package. [4] In these cases, run_setup() will raise a RuntimeError exception ('distutils.core.setup()' was never called). Solution: Add '__name__':'__main__' to the globals dict. Attached are patches to fix these issues in Python 2.6 to 3.4. [1] http://docs.python.org/3/library/functions.html#exec [2] http://docs.python.org/reference/executionmodel.html#naming-and-binding [3] https://pypi.python.org/pypi/MarkupSafe [4] https://pypi.python.org/pypi/PyYAML -- assignee: eric.araujo components: Distutils files: run_setup-py32-py33-py34.diff keywords: patch messages: 197259 nosy: eric.araujo, l, tarek priority: normal severity: normal status: open title: run_setup() behavior differs from cli invocation of setup.py type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31661/run_setup-py32-py33-py34.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18970] run_setup() behavior differs from cli invocation of setup.py
Changes by Lukas Wunner lu...@wunner.de: Added file: http://bugs.python.org/file31664/run_setup-py26.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18970] run_setup() behavior differs from cli invocation of setup.py
Changes by Lukas Wunner lu...@wunner.de: Added file: http://bugs.python.org/file31663/run_setup-py27.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18454] distutils crashes when uploading to PyPI having only the username (no pw) defined
Changes by Andrea Corbellini corbellini.and...@gmail.com: -- versions: +Python 3.1, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18454 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18967] Find a less conflict prone approach to Misc/NEWS
R. David Murray added the comment: Were you changing something in core/builtins? I'm wondering if just making some same-between-versions space between the version header/date and the beginning of that section would be enough to solve 99% of the problems. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18967 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18829] csv produces confusing error message when passed a non-string delimiter
R. David Murray added the comment: delimiter must be a 1 character string would cover it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18971] Use argparse in the profile/cProfile modules
New submission from Serhiy Storchaka: Here is a patch which replaces optparse to argparse in the profile and cProfile modules. -- components: Library (Lib) files: profile_argparse.patch keywords: patch messages: 197262 nosy: bethard, georg.brandl, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Use argparse in the profile/cProfile modules type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31665/profile_argparse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18971 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18972] Use argparse in email example scripts
New submission from Serhiy Storchaka: Here is a patch which replaces optparse to argparse in the Doc/includes/email-dir.py and Doc/includes/email-unpack.py scripts. -- assignee: docs@python components: Documentation, email files: email_examples_argparse.patch keywords: patch messages: 197263 nosy: barry, docs@python, r.david.murray, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Use argparse in email example scripts type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31666/email_examples_argparse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18972 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18973] Use argparse in the calendar module
New submission from Serhiy Storchaka: Here is a patch which replaces optparse to argparse in the calendar modules. -- components: Library (Lib) messages: 197264 nosy: bethard, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Use argparse in the calendar module type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18973 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18829] csv produces confusing error message when passed a non-string delimiter
Vajrasky Kok added the comment: David R. Murray said, 'delimiter must be a 1 character string would cover it.' You mean $ ./python -c 'import csv; reader = csv.reader(foo, delimiter=)' should give this error 'delimiter must be a 1 character string'? Attached the patch to accommodate your request. I found out that: $ ./python -c 'import csv; reader = csv.reader(foo, quotechar=)' Traceback (most recent call last): File string, line 1, in module TypeError: quotechar must be set if quoting enabled This is not consistent with the cure. But since this ticket is about delimiter, we keep the status-quo about quotechar for now. After the patch is committed, we can open the ticket about the quotechar inconsistency. The fix for this quotechar is not straightforward, though, because of the quoting condition. -- Added file: http://bugs.python.org/file31667/fix_error_message_reader_csv_alternative_1_v8.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18829] csv produces confusing error message when passed a non-string delimiter
Vajrasky Kok added the comment: Sorry for typing your name wrongly. s/David R. Murray/R. David Murray/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1565525] tracebacks eat up memory by holding references to locals and globals when they are not wanted
A.M. Kuchling added the comment: Here's a patch implementing traceback.clear_tb_frames(). (Feel free to bikeshed about the name.) One more substantial question: the top frame of the traceback is possibly still running. Currently the code skips it by doing an initial 'tb = tb.tb_next'. Would it be better to catch and ignore the RuntimeError from frame.clear()? -- stage: needs patch - patch review Added file: http://bugs.python.org/file31668/clear-tb-frames.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1565525 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18973] Use argparse in the calendar module
Vajrasky Kok added the comment: I don't see any patches. You forgot to upload the patch? -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18973 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18974] Use argparse in the diff script
New submission from Serhiy Storchaka: Here is a patch which replaces optparse to argparse in the Tools/scripts/diff.py script. -- components: Demos and Tools files: diff_argparse.patch keywords: patch messages: 197269 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Use argparse in the diff script type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31669/diff_argparse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18974 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18974] Use argparse in the diff script
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +bethard ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18974 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18973] Use argparse in the calendar module
Serhiy Storchaka added the comment: You forgot to upload the patch? Again. -- keywords: +patch Added file: http://bugs.python.org/file31670/calendar_argparse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18973 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18829] csv produces confusing error message when passed a non-string delimiter
Vajrasky Kok added the comment: After contemplating for a while, I am not sure that we should treat empty string for delimiter with error message: 'delimiter must be an 1-character string'. The reason is to keep consistency with quotechar keyword. [sky@localhost cpython]$ ./python -c 'import csv; reader = csv.reader(foo, quotechar=)' Traceback (most recent call last): File string, line 1, in module TypeError: quotechar must be set if quoting enabled [sky@localhost cpython]$ ./python -c 'import csv; reader = csv.reader(foo, quotechar=, quoting=csv.QUOTE_NONE)' # No error, so implicitly quotechar is not set, but it is okay since we use quote none quoting. # In other word, quotechar is not set by giving empty string to quotechar. We could not change the behaviour of csv module, which is unsetting quotechar by giving empty string to quotechar and let it be if we use quote none quoting, to preserve backward compatibility. So the error message should be, The delimiter must be set for empty string for delimiter, I suppose. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18962] Add special case for single iterator in heapq.merge function
Raymond Hettinger added the comment: Try this patch. -- Added file: http://bugs.python.org/file31671/merge.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18962 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18829] csv produces confusing error message when passed a non-string delimiter
R. David Murray added the comment: Parsing a csv file with no delimiter would seem to be meaningless, unless I'm misunderstanding what 'delimeter' controls. So the error messages for delimiter and quotechar are necessarily different. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
New submission from Jakub Stasiak: This patch includes: * making code more PEP8-compatible and refactoring it a bit * printing number of loops per second when using command line interface * using thousands separators when printing numbers of loops (also in command line interface) * changing examples in the module documentation The output is changed from this: 1 loops, best of 3: 40.3 usec per loop to that: 10,000 loops, best of 3: 34.6 usec per loop, 28,870.783/s I'm still not sure about details of 28,870.783/s part: * whether it should always include the fractional part (in this example it doesn't make any sense) * maybe it should say loops/s rather than just /s -- components: Library (Lib) files: timeit.patch keywords: patch messages: 197274 nosy: jstasiak priority: normal severity: normal status: open title: timeit: Use thousands separators and print number of loops per second type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31672/timeit.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12317] inspect.getabsfile() is not documented
Changes by Akira Kitada akit...@gmail.com: -- nosy: +akitada ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12317 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18943] argparse: default args in mutually exclusive groups
paul j3 added the comment: A possibly unintended consequence to this `seen_non_default_actions` testing is that default values do not qualify as 'present' when testing for a required mutually exclusive group. p=argparse.ArgumentParser() g=p.add_mutually_exclusive_group(required=True) g.add_argument('--foo',default='test') g.add_argument('--bar',type=int,default=42) p.parse_args('--bar 42'.split()) raises an `error: one of the arguments --foo --bar is required` In the original code p.parse_args('--foo test'.split()) does not raise an error because 'test' does not qualify as default. But with the change I proposed, it does raise the error. This issue may require adding a `failures_when_required` category to the test_argparse.py MEMixin class. Currently nothing in test_argparse.py tests for this issue. Note that this contrasts with the handling of ordinarily required arguments. p.add_argument('--baz',type=int,default=42,required=True) '--baz 42' does not raise an error. It is 'present' regardless of whether its value matches the default or not. This argues against tightening the `seen_non_default_actions` test. Because the current testing only catches a few defaults (None and small ints) it is likely that no user has come across the required group issue. There might actually be fewer compatibility issues if we simply drop the default test (or limit it to the case where the default=None). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18943 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Jakub Stasiak added the comment: Oops, forgot to patch the tests, please find correct patch attached. -- Added file: http://bugs.python.org/file31673/timeit-v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18976] distutils/command/build_ext passes wrong linker flags
New submission from Benedikt Morbach: At http://hg.python.org/cpython/file/1043cc2cb0ff/Lib/distutils/command/build_ext.py#l247 build_ext.py compares sys.executable against sys.exec_prefix. When cross compiling cpython, it notices that the interpreter running the build is located at exec_prefix and concludes that it is building a third-party module. Thus, it passes '-L{HOST_LIBDIR}', instead of '-L.', which breaks the build. The attached patch reverses the logic, checking if sys.executable resides in ${PWD} and assuming a third-party module otherwise. This should also fix http://bugs.python.org/issue16326 -- assignee: eric.araujo components: Cross-Build, Distutils, Extension Modules, Library (Lib) files: 0001-make-sure-to-pass-L.-when-building-standard-extensio.patch keywords: patch messages: 197277 nosy: Benedikt.Morbach, eric.araujo, tarek priority: normal severity: normal status: open title: distutils/command/build_ext passes wrong linker flags type: compile error versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file31674/0001-make-sure-to-pass-L.-when-building-standard-extensio.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18976 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1565525] tracebacks eat up memory by holding references to locals and globals when they are not wanted
Antoine Pitrou added the comment: One more substantial question: the top frame of the traceback is possibly still running. Currently the code skips it by doing an initial 'tb = tb.tb_next'. Would it be better to catch and ignore the RuntimeError from frame.clear()? Yes, I think it would be better. Other than that, the doc lacks a versionadded tag. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1565525 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18977] The -t option has no effect in for uu command-line
New submission from Serhiy Storchaka: The uu module can be run as command-line tool. In Python 2, uu -t infile outfile opens input file in text mode, i.e. convert '\r\n' to '\n' on Windows and '\r' to '\n' on Mac Classic, and uu -d -t infile outfile opens output file in text mode, i.e. convert '\n' to '\r\n' on Windows and '\n' to '\r' on Mac Classic. In Python 3 this option has no effect. The proposed patch restores former behavior and extends it. Encoding with -t option now uses universal newlines for reading, and decoding with -t option now converts '\n' to os.linesep for writing. In additional text mode now works with standard input/output. This change perhaps is too large for the fix of such insignificant bug and that is why I propose it as a new feature. -- assignee: serhiy.storchaka components: Demos and Tools, Library (Lib) files: uu_text_mode.patch keywords: patch messages: 197279 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: The -t option has no effect in for uu command-line type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31675/uu_text_mode.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18929] inspect.classify_class_attrs ignores metaclass
Ethan Furman added the comment: Okay, taking a step back. It seems that currently inspect is geared towards instances and classes, not metaclasses. Consequently, so is help. So, how do we enhance inspect so that help can be metaclass aware? classify_class_attrs seems like an obvious choice, and it's docstring currently says this: def classify_class_attrs(cls): Return list of attribute-descriptor tuples. For each name in dir(cls), the return list contains a 4-tuple with these elements: 0. The name (a string). 1. The kind of attribute this is, one of these strings: 'class method'created via classmethod() 'static method' created via staticmethod() 'property'created via property() 'method' any other flavor of method 'data'not a method 2. The class which defined this attribute (a class). 3. The object as obtained directly from the defining class's __dict__, not via getattr. This is especially important for data attributes: C.data is just a data object, but C.__dict__['data'] may be a data descriptor with additional info, like a __doc__ string. We could add additional 'kind' of 'hidden class method', and 'hidden class attributes' and then have classify_class_attrs explicitly search metaclasses. Or, since we have to make a new getmembers (getmetaclassmembers?), we could also make a new classify_metaclass_attrs that handled both class and metaclass. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18929 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Ezio Melotti added the comment: I personally dislike the , as thousands separator, and if a separator is added at all I would prefer a space as defined in the SI standard[0]. The PEP8 changes should also me moved to a separate patch IMHO; the other changes are OK grouped together. [0]: http://en.wikipedia.org/wiki/ISO_31-0#Numbers -- nosy: +ezio.melotti stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18978] Allow urllib.request.Request subclasses to override method
New submission from Jason R. Coombs: In Python 2.x and 3.2, I used to use a Request subclass I created for overriding the method used: class MethodRequest(request.Request): def __init__(self, *args, **kwargs): Construct a MethodRequest. Usage is the same as for `urllib.request.Request` except it also takes an optional `method` keyword argument. If supplied, `method` will be used instead of the default. if 'method' in kwargs: self.method = kwargs.pop('method') return request.Request.__init__(self, *args, **kwargs) def get_method(self): return getattr(self, 'method', request.Request.get_method(self)) In Python 3.3, which now supports a method parameter, it broke this paradigm (because the method is stored in the instance and is always set to None in __init__ if not specified). I believe a paradigm where the method is stored as a class attribute and possibly overridden in an instance would be much better, allowing for subclasses to simply and directly override the method. For example: class HeadRequest(MethodRequest): method = 'HEAD' That straightforward example works very well if method is allowed to be a class attribute, but won't work at all if 'method' is always set as an instance attribute in __init__. And while it's possible for HeadRequest to override __init__, that requires HeadRequest to override that entire signature, which is less elegant than simply setting a class attribute. For Python 3.4, I'd like to adapt the Request class to allow the Method to be defined at the class level (while still honoring customization at the instance level). -- components: Library (Lib) messages: 197281 nosy: jason.coombs priority: normal severity: normal status: open title: Allow urllib.request.Request subclasses to override method versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18978] Allow urllib.request.Request subclasses to override method
Senthil Kumaran added the comment: Hi Jason, Agree with you. This design change could be valuable in extending urllib.request.Request Thanks! -- nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18978] Allow urllib.request.Request subclasses to override method
Jason R. Coombs added the comment: I've created a clone in which to draft this work. -- hgrepos: +208 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18929] inspect.classify_class_attrs ignores metaclass
Antoine Pitrou added the comment: It seems that currently inspect is geared towards instances and classes, not metaclasses. Consequently, so is help. I'm afraid I don't really understand what you're talking about. A metaclass is just a slightly different kind of class :-) def classify_class_attrs(cls): Return list of attribute-descriptor tuples. For each name in dir(cls), the return list contains a 4-tuple with these elements: [...] We could add additional 'kind' of 'hidden class method', and 'hidden class attributes' and then have classify_class_attrs explicitly search metaclasses. The docstring is clear: For each name in dir(cls). If you want stuff that hidden's in the cls.__class__ (and, consequently, not in dir(cls)), then you are not looking for the right function, I think. I can understand wanting to better automate lookup of methods on classes, rather than on instances, but it would probably deserve another function. But I have another question first: doesn't calling classify_class_attrs() on the metaclass already do what you want? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18929 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18978] Allow urllib.request.Request subclasses to override method
Changes by Jason R. Coombs jar...@jaraco.com: -- keywords: +patch Added file: http://bugs.python.org/file31676/6d6d68c068ad.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Jakub Stasiak added the comment: I agree with both notes. Splitting the patch won't be a problem. As much as I don't fancy , as thousands separator either - I just used what's in the standard library but I'll think about the best way of putting spaces there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18978] Allow urllib.request.Request subclasses to override method
Changes by Jason R. Coombs jar...@jaraco.com: Added file: http://bugs.python.org/file31677/2b2744cfb08f.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Antoine Pitrou added the comment: I personally dislike the , as thousands separator, and if a separator is added at all I would prefer a space as defined in the SI standard[0]. Then you really want a non-breaking space ;-) (as a French person who's used to commas as decimal points, count me in the commas as thousands separators are confusing camp ;-)) * whether it should always include the fractional part (in this example it doesn't make any sense) Indeed, it probably doesn't make sense unless the number is 100. I would also put that information inside parentheses, as it is redundant with the per-loop timing. * maybe it should say loops/s rather than just /s Yeah. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12317] inspect.getabsfile() is not documented
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brett.cannon versions: +Python 3.4 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12317 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18978] Allow urllib.request.Request subclasses to override method
Changes by Jason R. Coombs jar...@jaraco.com: Added file: http://bugs.python.org/file31678/061eb75339e2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18978] Allow urllib.request.Request subclasses to override method
Jason R. Coombs added the comment: I've added tests to capture the new behavior. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18978 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18979] Use argparse in the uu module
New submission from Serhiy Storchaka: Here is a patch which replaces optparse to argparse in the uu module. -- components: Demos and Tools, Library (Lib) files: uu_argparse.patch keywords: patch messages: 197289 nosy: bethard, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Use argparse in the uu module type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file31679/uu_argparse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18979 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18943] argparse: default args in mutually exclusive groups
paul j3 added the comment: I should add that defaults with required arguments (or groups?) doesn't make much sense. Still there's nothing in the code that prevents it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18943 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Tim Peters added the comment: [Antoine] Oh, I also get the following sporadic failure which is triggered by slight change in semantics with Thread.join(timeout) :-) == FAIL: test_various_ops (test.test_threading.ThreadTests) -- Traceback (most recent call last): File /home/antoine/cpython/default/Lib/test/test_threading.py, line 113, in test_various_ops self.assertTrue(not t.is_alive()) AssertionError: False is not true Really! In context, the test does: t.join() self.assertTrue(not t.is_alive()) (BTW, that would be clearer as self.assertFalse(t.is_alive()) ;-) ) It was the intent that this continue to work - the only intended change in Python-visible semantics had to do with join'ing with a timeout. Without a timeout, I confess I don't see how this can fail. join() is join(timeout=None), which does: self._stopped.wait(timeout) if self._stopped.is_set(): self._wait_for_tstate_lock(timeout is None) which is self._stopped.wait(None) if self._stopped.is_set(): self._wait_for_tstate_lock(True) which should be the same as self._stopped.wait() self._wait_for_tstate_lock(True) after which _stopped should be set and _tstate_lock should be None. The subsequent is_alive() should then return False, via its return self._tstate_lock is not None What's going wrong? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18964] test_tcl fails when _tkinter linked with Tcl 8.4
Roundup Robot added the comment: New changeset 03ee22236465 by Serhiy Storchaka in branch '3.3': Fixed tests with Tcl/Tk 8.5 (closes #18964). http://hg.python.org/cpython/rev/03ee22236465 New changeset 138e086e187d by Serhiy Storchaka in branch 'default': Fixed tests with Tcl/Tk 8.5 (closes #18964). http://hg.python.org/cpython/rev/138e086e187d New changeset a22cfd0bdc9a by Serhiy Storchaka in branch '2.7': Fixed tests with Tcl/Tk 8.5 (closes #18964). http://hg.python.org/cpython/rev/a22cfd0bdc9a -- nosy: +python-dev resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18964 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18966] Threads within multiprocessing Process terminate early
Antoine Pitrou added the comment: That's because multiprocessing exits child processes with os._exit(), not sys.exit(). The fix would be trivial (call threading._shutdown() before os._exit()), but I don't know if that's something we want to do. After all there are many things in the Python shutdown procedure that we may want to similarly replicate in multiprocessing children, such as calling atexit handlers. This screams for a more general solution, IMHO. -- nosy: +neologix, pitrou, sbt versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18966 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Antoine Pitrou added the comment: Le dimanche 08 septembre 2013 à 17:30 +, Tim Peters a écrit : Really! In context, the test does: t.join() self.assertTrue(not t.is_alive()) Ah, no, the failing test did `t.join(something)`. I removed the timeout to remove the failure :-) (BTW, that would be clearer as self.assertFalse(t.is_alive()) ;-) ) Yes, old coding style. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18943] argparse: default args in mutually exclusive groups
Armin Rigo added the comment: Fwiw I agree with you :-) I'm just relaying a bug report that originates on PyPy (https://bugs.pypy.org/issue1595). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18943 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18953] Typo in NEWS about fixed format specifiers for Py_ssize_t in debugging output in the _sre module
Roundup Robot added the comment: New changeset c08e92529f62 by Serhiy Storchaka in branch '3.3': Fix a typo. (closes #18953) http://hg.python.org/cpython/rev/c08e92529f62 New changeset 9dc5bdab157e by Serhiy Storchaka in branch 'default': Fix a typo. (closes #18953) http://hg.python.org/cpython/rev/9dc5bdab157e New changeset 6ecdf5de6252 by Serhiy Storchaka in branch '2.7': Fix a typo. (closes #18953) http://hg.python.org/cpython/rev/6ecdf5de6252 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18953 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18953] Typo in NEWS about fixed format specifiers for Py_ssize_t in debugging output in the _sre module
Serhiy Storchaka added the comment: Thank you Vajrasky. Actually there was no need to open a new issue for such minor bug. You can report on the same issue which caused this bug. I'm afraid there are a lot of more grave syntax and grammatic errors in my Misc/NEWS entries. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18953 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18606] Add statistics module to standard library
Guido van Rossum added the comment: Here's a combined patch. Hopefully it will code review properly. -- nosy: +gvanrossum Added file: http://bugs.python.org/file31680/statistics_combined.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18606 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18936] 2.7 distutils getopt chokes on unicode option names
Jason R. Coombs added the comment: oh. My mistake. I didn't realize the error was in 'distutils.fancy_getopt' and not in the getopt module itself. Indeed, the problem doesn't exist under getopt itself, so is specific to distutils and fancy_getopt. from __future__ import unicode_literals import getopt getopt.getopt('-x', 'x', ('--longx',)) ([], u'-x') -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18936 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18606] Add statistics module to standard library
Guido van Rossum added the comment: Nice docstrings, but those aren't automatically included in the Doc tree. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18606 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18973] Use argparse in the calendar module
R. David Murray added the comment: I think it is highly inadvisable to make changes like this without also adding tests. We broke compileall by doing this even though we *did* add tests. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18973 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Tim Peters added the comment: Ah - the test used to do t.join(NUMTASKS)! That's just bizarre ;-) I believe I can repair that too (well - there was never a _guarantee_ that waiting 10 seconds would be long enough), but I'll wait until this all settles down. join() and is_alive() are too complicated now, because of the 2-step dance to check whether the thread is done: we have both an Event (_stopped) and a lock (_tstate_lock) to check now. The Event doesn't serve a purpose anymore: it's almost always uninteresting to know _just_ that the Python part of the thread has ended. The only exception I can see is the perverse case of joining the main thread done in some of the tests (in that case we have to claim the main thread is done even though its tstate is still active). Anyway, after getting rid of the Event it should be dead easy to make join(10) appear to work the same as before, despite that it never really worked ;-). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Serhiy Storchaka added the comment: I'm afraid the adding any separators will make some people angry. With a comma or space it no more a valid number in Python and many other languages and can't be copy/pasted and parsed. Actually I sometimes use small shell scripts to run python -m timeit and parsing results with grep, sed and awk. It is easer in simplest cases than writing it on Python (especially when different Python binaries used). I'm -0,1. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Antoine Pitrou added the comment: join() and is_alive() are too complicated now, because of the 2-step dance to check whether the thread is done: we have both an Event (_stopped) and a lock (_tstate_lock) to check now. The Event doesn't serve a purpose anymore: it's almost always uninteresting to know _just_ that the Python part of the thread has ended. Yes, that crossed my mind too. The difficulty is that only plain lock objects are available from C code, not Events. But if the first join()er releases the lock just after taking it, it will be enough to make the code correct? (after all, it's an event that's never reset, which simplifies things) (also, why is the current Event implementation based on Condition? isn't an Event actually simpler than a Condition?) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
R. David Murray added the comment: I'm with Serhiy on this. So if separators are added, I would say they *must* be optional. Presumably if they are added they should be locale dependent :) All of which may well make it more complicated than it is worth. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Tim Peters added the comment: Without _stopped, join() can simply wait to acquire _tstate_lock (with or without a timeout, and skipping this if _tstate_lock is already None). Etc ;-) Of course details matter, but it's easy. I did it once, but the tests joining the main thread failed and I put the code on hold. I'll dust it off when the buildbots are all happy with the current changes. (also, why is the current Event implementation based on Condition? We'd have to ask Guido ;-) Best guess is that Condition supplied all the machinery to make Event.wait() work correctly, including waking all waiters up when the Event gets set. isn't an Event actually simpler than a Condition?) Events are indeed simple :-) There are many ways to implement them, but ain't broke, don't fix seems the right approach to me here. In effect, if we get rid of _stopped, the code remaining will be much like an Event implementation built on the plain _tstate_lock lock. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Antoine Pitrou added the comment: Without _stopped, join() can simply wait to acquire _tstate_lock (with or without a timeout, and skipping this if _tstate_lock is already None). Etc ;-) Of course details matter, but it's easy. I did it once, but the tests joining the main thread failed and I put the code on hold. Ah, of course. The main thread needs the event, since the thread state will only be deleted at the end of Py_Finalize(). The MainThread class could override is_alive() and join(), then. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18975] timeit: Use thousands separators and print number of loops per second
Tim Peters added the comment: -1 from me, and I'm a comma-loving American ;-) I'm sure lots of code in the wild parses this output - Serhiy isn't the only one doing it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18975 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17741] event-driven XML parser
Stefan Behnel added the comment: While refactoring the iterparse() implementation in lxml to support this new interface, I noticed that the close() method of the XMLPullParser does not behave like the close() method of the XMLParser. Instead of setting some .root attribute on the parser instance, the method should return the root element that the tree builder generated. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17741 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18808] Thread.join returns before PyThreadState is destroyed
Tim Peters added the comment: The MainThread class could override is_alive() and join(), then. I think it will be easier than that, but we'll see ;-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18962] Add special case for single iterator in heapq.merge function
Changes by Raymond Hettinger raymond.hettin...@gmail.com: Added file: http://bugs.python.org/file31681/merge2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18962 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18962] Add special case for single iterator in heapq.merge function
Changes by Raymond Hettinger raymond.hettin...@gmail.com: Removed file: http://bugs.python.org/file31671/merge.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18962 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com