[issue23792] help crash leaves terminal in raw mode
R. David Murray added the comment: Here is a version that keeps things clean by not diplaying the traceback. The ctl-c does have an effect, but not a visible one unless one pays careful attention :) -- Added file: http://bugs.python.org/file38731/catch_additional_interrupt.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23792 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23809] RFE: emit a warning when a module in a traceback shadows a stdlib module
Robert Collins added the comment: Implementation wise: this is not part of the generic rendering-of-tracebacks; I'd like to make the traceback new stuff be tastefully extensible - I'd be inclined to do this with a per-frame-callback on render (so we don't pay overhead on unrendered tb's) and a global variable that controls the default hooks loaded into the objects. That would: - allow folk using the raw API to control what hooks are at play - allow third-parties to install additional things globally, to influence code using the existing old tb apis - make testing of the warning specific code be very straight forward and isolated -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23809 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22117] Rewrite pytime.h to work on nanoseconds
Roundup Robot added the comment: New changeset f6b41566ca28 by Victor Stinner in branch 'default': Issue #22117: Add _PyTime_ROUND_CEILING rounding method for timestamps https://hg.python.org/cpython/rev/f6b41566ca28 New changeset 0a8015a4ff97 by Victor Stinner in branch 'default': Issue #22117: Replace usage of _PyTime_ROUND_UP with _PyTime_ROUND_CEILING https://hg.python.org/cpython/rev/0a8015a4ff97 New changeset 350eb1ca561a by Victor Stinner in branch 'default': Issue #22117: Remove _PyTime_ROUND_DOWN and _PyTime_ROUND_UP rounding methods https://hg.python.org/cpython/rev/350eb1ca561a -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22117 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23745] Exception when parsing an email using email.parser.BytesParser
R. David Murray added the comment: The issue arose from the duplicated parameter name. I fixed it by (mostly) copying the error recovery used by the older api (get_param). Note that you don't need to specify both policy and _class. If you use the new policies (such as default), it automatically uses EmailMessage for the _class. -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23745 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23793] Support __add__, __mul__, and __imul__ for deques.
Raymond Hettinger added the comment: Also incorporate __mul__ and __imul__. d = deque('abc') d * 3 deque(['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c']) d *= 2 d deque(['a', 'b', 'c', 'a', 'b', 'c']) -- keywords: +needs review -patch title: Support __add__ for deques. - Support __add__, __mul__, and __imul__ for deques. Added file: http://bugs.python.org/file38734/deque_mul_and_add.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23793 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22117] Rewrite pytime.h to work on nanoseconds
STINNER Victor added the comment: I rewrite the implementation of this issue 2 or 3 times. At the end, I decided to rewrite it again with a more incremental approach: add the new API, use the new API, and then drop slowly the old API. I was used to rewrite the implementation multiple times to fix issues in the API and enhance the implementation. The new API now handles better rounding with more unit tests. The datetime module only uses the new API for the datetime.datetime() constructor. It's not used for datetime.datetime.fromtimestamp(), because _PyTime_t is limited to a range of [-292 years; 292 years]. The datetime module supports a much large range: year in range [1; ]. So some parts of the old API will survive for the datetime module. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22117 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23754] Add a new os.read_into() function to avoid memory copies
STINNER Victor added the comment: Why do you want to optimize the pure Python FileIO? I gave more examples than FileIO in this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23754 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23752] Cleanup io.FileIO
Roundup Robot added the comment: New changeset bc2a22eaa0af by Victor Stinner in branch 'default': Issue #23752: When built from an existing file descriptor, io.FileIO() now only https://hg.python.org/cpython/rev/bc2a22eaa0af -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23618] PEP 475: handle EINTR in the socket module (connect)
Changes by STINNER Victor victor.stin...@gmail.com: -- title: PEP 475: handle EINTR in the socket module - PEP 475: handle EINTR in the socket module (connect) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23618 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23485] PEP 475: handle EINTR in the select and selectors module
STINNER Victor added the comment: Ok, here is a first patch just for select.select(). It took me some time to write this small patch, because I wanted first to push my new API to handle time in pytime.h (Issue #22117). The new time C API has been merged. -- keywords: +patch Added file: http://bugs.python.org/file38732/select_eintr.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23485 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23694] PEP 475: handle EINTR in fileutils.c
Roundup Robot added the comment: New changeset 2e1234208bab by Victor Stinner in branch 'default': Issue #23694: Fix usage of _Py_open() in the _posixsubprocess module https://hg.python.org/cpython/rev/2e1234208bab -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23694 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22390] test.regrtest should complain if a test doesn't remove temporary files
Roundup Robot added the comment: New changeset 6ef2cacec2e9 by Victor Stinner in branch '2.7': Issue #22390: Fix test_gzip if unicode filename doesn't work https://hg.python.org/cpython/rev/6ef2cacec2e9 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22390 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23809] RFE: emit a warning when a module in a traceback shadows a stdlib module
New submission from Nick Coghlan: A colleague just ran into the issue where they created a json.py module in their local directory and broke a previously working program. I picked up on the mistake when I saw the following traceback snippet: Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.7/site-packages/praw/__init__.py, line 27, in module import json File json.py, line 1, in module r = requests.get(http://www.reddit.com/user/spilcm/about/.json;) However, actually making the connection required thinking Wait, why is the stdlib JSON module calling out to Reddit? followed immediately by Oh, that's not the stdlib json module. That connection would potentially be easier for new Python users to make if there was an inline notification printed after the traceback warning of the stdlib module shadowing. If nothing else, it would give them something specific to search for to lead them to a discussion of name shadowing and the problems that can arise when you name one of your local modules the same as a standard library module. Offering such a feature would necessarily rely on having a standard way of getting a programmatic list of the standard library modules available to the running interpreter version without actually loading them all, a question which is discussed further in https://stackoverflow.com/questions/6463918/how-can-i-get-a-list-of-all-the-python-standard-library-modules and https://github.com/jackmaney/python-stdlib-list Since the contents of the standard library for a given release is immutable, and we'd like to keep any such mechanism (if we decide to provide it) very simple so we can easily access it from the low level interpreter traceback machinery, my suggestion would be along the lines of: 1. Update the interpreter build process to emit a flat text file containing a complete list of fully qualified stdlib module names (including submodules), one name per line (this will be generated at build time, so it *won't* contain filenames, just the module names - however, it could theoretically be combined with importlib.util.find_spec to generate a PEP 376 style RECORD file for the non-builtin parts of the standard library at installation time) 2. Rather than exposing the underlying machinery to end users directly, instead expose a function in sysconfig to read that list of modules into memory via a read-only line based iterator. (There may be an internal API to allow access to the content without going through sysconfig) 3. Updating the two main traceback display mechanisms (the builtin traceback display and the traceback module) to check that list for potential conflicts after displaying a traceback (This idea could benefit from discussion on python-ideas and potentially even escalate into a full PEP, but I don't currently have the personal bandwidth available to pursue that course. Accordingly, I'm just filing the idea here in case someone else finds it intriguing and has more time available to pursue it) -- messages: 239543 nosy: georg.brandl, larry, ncoghlan, rbcollins priority: normal severity: normal status: open title: RFE: emit a warning when a module in a traceback shadows a stdlib module type: enhancement versions: Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23809 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22117] Rewrite pytime.h to work on nanoseconds
STINNER Victor added the comment: Ok, I'm quite API with the new API and I have what I need to rework the select module for the PEP 475, so I close this issue. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22117 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23571] Raise SystemError if a function returns a result with an exception set
Serhiy Storchaka added the comment: The second (exception == NULL) check in _Py_PrintFatalError() looks suspicious. When it is possible? And if it is possible, can it cause leaks? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23571 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19023] ctypes docs: Unimplemented and undocumented features
Changes by Berker Peksag berker.pek...@gmail.com: -- components: -Tests nosy: +berker.peksag versions: +Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19023 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22117] Rewrite pytime.h to work on nanoseconds
Roundup Robot added the comment: New changeset d938533b43f7 by Victor Stinner in branch 'default': Issue #22117: Fix usage of _PyTime_AsTimeval() https://hg.python.org/cpython/rev/d938533b43f7 New changeset 49d3ff81f31f by Victor Stinner in branch 'default': Issue #22117: Add assertions to _PyTime_AsTimeval() and _PyTime_AsTimespec() to https://hg.python.org/cpython/rev/49d3ff81f31f -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22117 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23792] help crash leaves terminal in raw mode
Martin Panter added the comment: I think your patch should be fine for all practical cases I can think of. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23792 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23752] Cleanup io.FileIO
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23752 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23809] RFE: emit a warning when a module in a traceback shadows a stdlib module
Nick Coghlan added the comment: I had an idea for a possible importlib.util API to support this capability: an ignore_entries=0 default arg to https://docs.python.org/dev/library/importlib.html#importlib.util.find_spec The new arg would say how many found entries to skip when looking for the module, defaulting to returning the first hit as it does now. The challenging part would be that all the implicit import system caching is currently built around the notion of there can be only one, so we'd likely want to introduce something like a new name shadowing cache that mapped (modname, ignored_entries) pairs to module specs (and was cleared by importlib.invalidate_caches() along with everything else). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23809 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23466] PEP 461: Inconsistency between str and bytes formatting of integers
Ethan Furman added the comment: Patch looks good. Changing the raised exceptions to ValueError would require deprecation periods. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23466 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23466] PEP 461: Inconsistency between str and bytes formatting of integers
STINNER Victor added the comment: Changing the raised exceptions to ValueError would require deprecation periods. bytes%args is not a new feature of python 3.5? It sounds strange to deprecate a part of a new feature. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23466 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23755] tempfile.NamedTemporaryFile should be able to toggle delete
Martin Panter added the comment: I think I have often passed delete=False because of the documented deficiency with Windows (see Issue 14243). Depending on the outcome of that issue, allowing for deletion after close() might be useful too. BTW, monkey-patching __del__() probably won’t work if you only set an attribute on the “f” instance, instead of modifying the class itself. See file:///home/proj/python/cpython/Doc/build/html/reference/datamodel.html#special-method-lookup. -- nosy: +vadmium type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23755 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22117] Rewrite pytime.h to work on nanoseconds
Serhiy Storchaka added the comment: May be rename _PyTime_AsTimeval_impl() to _PyTime_AsTimeval_noraise() and check a result to raise an exception in _PyTime_AsTimeval()? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22117 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23758] Improve documenation about num_params in sqlite3 create_function and create_aggregate
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag, ghaering stage: - patch review versions: +Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23758 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23809] RFE: emit a warning when a module in a traceback shadows a stdlib module
Robert Collins added the comment: Why limit this to just stdlib shadowing? A local module can shadow a top level module-or-package across the board. If we don't limit it to stdlib names, it becomes a lot easier to implement. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23809 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23571] Raise SystemError if a function returns a result with an exception set
STINNER Victor added the comment: That last commit fixed compatibility with Django. Good. Instead of an assert(), you could use Py_FatalError() at the end of _Py_CheckFunctionResult(). _Py_CheckFunctionResult() now calls Py_FatalError() in debug mode. By the way, I fixed various issues in Py_FatalError() to be able to display the exception and the traceback in more cases. @Serhiy: Are you ok with that? Can I close the issue? FYI I write the PEP 490 as a spin off of this issue, to continue my work on the enhancement of exceptions in the C code: PEP 490 - Chain exceptions at C level. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23571 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23810] Suboptimal stacklevel of deprecation warnings for formatter and imp modules
New submission from Arfrever Frehtes Taifersar Arahesis: https://hg.python.org/cpython/rev/2a336cc29282 changed stacklevel of some deprecation warnings. However new value is still not useful, because either _frozen_importlib or importlib/_bootstrap.py is now mentioned in deprecation warnings: $ cat test.py import formatter import imp $ python3.4 -Wd test.py /usr/lib64/python3.4/formatter.py:24: PendingDeprecationWarning: the formatter module is deprecated and will be removed in Python 3.6 'Python 3.6', PendingDeprecationWarning) /usr/lib64/python3.4/imp.py:32: PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses PendingDeprecationWarning) $ python3.5 -Wd test.py _frozen_importlib:321: DeprecationWarning: the formatter module is deprecated and will be removed in Python 3.6 /usr/lib64/python3.5/importlib/_bootstrap.py:321: PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses return f(*args, **kwds) -- assignee: brett.cannon components: Library (Lib) messages: 239554 nosy: Arfrever, brett.cannon priority: normal severity: normal status: open title: Suboptimal stacklevel of deprecation warnings for formatter and imp modules versions: Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23810 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23804] SSLSocket.recv(0) receives up to 1024 bytes
Changes by Ned Deily n...@acm.org: -- nosy: +alex, christian.heimes, dstufft ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23804 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22390] test.regrtest should complain if a test doesn't remove temporary files
STINNER Victor added the comment: On Windows, test_idle modifies os.environ: TCL_xxx and TIX_xxx (sorry for xxx, I don't remember the full variable name) are added. And test_platform modifies os.environ['PATH']. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22390 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21076] Turn signal.SIG* constants into enums
Ethan Furman added the comment: Okay, in a perfect world that _enum_to_int function would be unnecessary, but as Serhiy pointed out the C code is doing pointer comparison, so unless the exact same int is passed in it does not work. I'm looking at adjusting the C code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21076 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23745] Exception when parsing an email using email.parser.BytesParser
Roundup Robot added the comment: New changeset dc10c52c6539 by R David Murray in branch '3.4': #23745: handle duplicate MIME parameter names in new parser. https://hg.python.org/cpython/rev/dc10c52c6539 New changeset fe9a578d5f38 by R David Murray in branch 'default': Merge: #23745: handle duplicate MIME parameter names in new parser. https://hg.python.org/cpython/rev/fe9a578d5f38 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23745 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23729] Import ElementTree documentation for namespaces and XPath
Martin Panter added the comment: Reopening because I think there are some review comments that need addressing, at least the fromstring() one. I’m happy to make a patch if necessary. -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23729 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23802] patch: __deepcopy__ memo dict argument usage
New submission from Daniel Shahaf: In the 'copy' module documentation, it wasn't fully clear to me how __deepcopy__ implementations should treat the memo dict argument. The attached patch clarifies that __deepcopy__ implementations should treat the memo dict argument as an opaque type. -- assignee: docs@python components: Documentation files: opaque.diff keywords: patch messages: 239473 nosy: danielsh, docs@python priority: normal severity: normal status: open title: patch: __deepcopy__ memo dict argument usage type: enhancement Added file: http://bugs.python.org/file38723/opaque.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23802 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23458] [2.7] random: make the file descriptor non-inheritable (on POSIX)
Serhiy Storchaka added the comment: The test_urandom_fd_non_inheritable is constantly failed on AMD64 OpenIndiana 2.7 buildbot. http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%202.7/builds/2727/steps/test/logs/stdio == FAIL: test_urandom_fd_non_inheritable (test.test_os.URandomTests) -- Traceback (most recent call last): File /export/home/buildbot/64bits/2.7.cea-indiana-amd64/build/Lib/test/test_support.py, line 387, in wrapper return func(*args, **kw) File /export/home/buildbot/64bits/2.7.cea-indiana-amd64/build/Lib/test/test_os.py, line 601, in test_urandom_fd_non_inheritable self.assertEqual(open_fds - set(range(3)), set()) AssertionError: Items in the first set but not the second: 4 -- -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23458 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23796] BufferedReader.peek() crashes if closed
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23796 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23797] Mac OS X locale setup in thread happens sometime after run() is called
Barry Alan Scott added the comment: I should point out using Python2.7 with wxPython I do not see this issue. This issue was exposed during my efforts to port pysvn from py2.7+wxPython to py3.4+wxpython-phoenix. I do setup locale on the main thread very early before starting the background thread. I have attached the initLocale() I use. The background thread needs the locale setup and I use getlocale() to prove that it is setup. I do not see this as a duplicate of Issue18378 as I can init the locale. The problem, and I could believe its an OSX bug, is that new threads do not return the expected locale from _locale.setlocale() for a period of time, approx 2s after starting up. -- Added file: http://bugs.python.org/file38725/initLocale.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23797 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23806] documentation for no_proxy is missing from the python3 urllib documentation
New submission from R. David Murray: no_proxy (and what notation it supports) is mentioned in the python2 urllib docs, but not in the python3 docs. -- assignee: docs@python components: Documentation messages: 239493 nosy: docs@python, r.david.murray priority: normal severity: normal stage: needs patch status: open title: documentation for no_proxy is missing from the python3 urllib documentation type: behavior versions: Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23806 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23805] _hashlib compile error?
R. David Murray added the comment: Well, you'll need to look in your build log to see why _hashlib failed to compile or failed to be usable. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23805 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23803] str.partition() is broken in 3.4
Benjamin Peterson added the comment: lgtm -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23803 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23807] Improved test coverage for calendar.py command line
New submission from Thana Annis: Added a test to ensure that --locale cannot be called without --encoding. This is targeting lines 654-656 of calendar.py. -- components: Tests files: test_calendar.patch keywords: patch messages: 239494 nosy: Bwaffles priority: normal severity: normal status: open title: Improved test coverage for calendar.py command line type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file38727/test_calendar.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23807 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23602] Implement __format__ for Fraction
Tuomas Suutari added the comment: Thanks for the comments again! I fixed the format(F(4, 27), '.1f') - 0.2 issue Serhiy Storchaka reported. Fix for that was as simple as adding one to the precision the decimals are calculated in, but while adding test cases for that I realized two new things: (a) I don't want f specifier to mean infinite precision, but instead some predefined value. I chose 6. (b) How about rounding? I don't want the current decimal context to affect that, since it's not logical that formatting of Fractions depends on the decimal context. The rounding thing made things harder, since there was no way to pass decimal context for Decimal.__format__ without changing the local context -- at least with the C implementation; the Python implementation (_pydecimal) provided nicer API with optional context keyword argument. So I decided to unify the C and Py API's of Decimal.__format__ and add the keyword argument support to the C API too. This is done in this v4 of the patch. There's no docs for the added Decimal.__format__ kwargs, since I want some comments on that change first. -- Added file: http://bugs.python.org/file38728/issue23602v4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23602 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23803] str.partition() is broken in 3.4
Roundup Robot added the comment: New changeset c23713af8be7 by Serhiy Storchaka in branch '3.4': Issue #23803: Fixed str.partition() and str.rpartition() when a separator https://hg.python.org/cpython/rev/c23713af8be7 New changeset c48637f57e2b by Serhiy Storchaka in branch 'default': Added explicit tests for issue #23803. https://hg.python.org/cpython/rev/c48637f57e2b -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23803 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23771] Timeouts on x86 Ubuntu Shared 3.x buildbot
STINNER Victor added the comment: This build was only triggered by one changeset 0b99d7043a99: Issue #23694: Enhance _Py_open(), it now raises exceptions. I was reproduce to issue on a buildbot and I got access to the buildbot. Using gdb, I saw that a process was stuck in _close_open_fds_safe(). The problem is that this function is called after fork() to run a child process. It's not safe to play with the GIL here. This bug is the regression which makes some buildbots to hang. I fixed the bug in the changeset 2e1234208bab. I keep the issue open a few days to check if buildbots are repaired or not. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23771 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23809] RFE: emit a warning when a module in a traceback shadows a stdlib module
Nick Coghlan added the comment: On the implementation front, +1 for looking at a per-frame callback API rather than hardcoding this directly into the existing traceback rendering code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23809 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23809] RFE: emit a warning when a module in a traceback shadows a stdlib module
Nick Coghlan added the comment: I proposed limiting it to stdlib names as that's the case where we see the most beginner confusion (experimenting with sockets in a file named socket.py, etc), and the one where we can generate a comprehensive list of known module names ahead of time (so in most cases we won't need to touch the filesystem to determine there's no shadowing happening once the list of stdlib modules has been pulled in to memory). Handling the general case means we have to instead rely on rescanning the import system at runtime. On the other hand, we're already doing something along those lines through linecache to handle retrieving source lines, and the import system itself already has caches everywhere (hence importlib.invalidate_caches()), so adding yet-another-cache to be able to check for module shadowing efficiently wouldn't be that big a deal. Adding Brett Eric to get some additional perspectives on the idea of doing checks for name shadowing through a new importlib.util API rather than a separate stdlib specific mechanism. -- nosy: +brett.cannon, eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23809 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23770] Rework how exceptions are handled in the parser module (in validate_repeating_list())
Changes by STINNER Victor victor.stin...@gmail.com: -- title: Rework of exceptions are handled in the parser module (in validate_repeating_list()) - Rework how exceptions are handled in the parser module (in validate_repeating_list()) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23770 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File
Martin Panter added the comment: Patch v9: * Incorporated _PaddedFile.rewind() into seek() for simplicity * Reverted to support fast-forwarding in non-seekable streams again * Factored common checks into _check_can_seek() * Documented “mtime” attribute and implemented it as a read-only decompression-only property Antoine highlighted the fact that BufferedReader.peek() does not guarantee how much data it returns, so I removed the code trying to return at least 100 bytes. I revisited merging the gzip read() loop with the others, but gave up again. I tried adding calls to _start_member() and _end_member(), with more “if” statements and flags to account for the different edge cases. But then I remembered the “needs_input” flag of LZMA and bzip versus the “unconsumed_tail” of zlib. Handling this would probably require another delegation to a new _decompress_chunk() method, at which point I think the whole read() method will probably just be a mess of hacks trying to marry the two not-quite-compatible implementations. So I think it is better to override read() with a gzip-specific implementation, unless someone wants to prove me wrong with their own patch :) -- Added file: http://bugs.python.org/file38733/LZMAFile-etc.v9.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23529 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23805] _hashlib compile error?
New submission from Freddy: I just installed Python 3.5.0a2 from Source. Debian 3.2.65-1+deb7u1 x86_64 GNU/Linux [264/392] test_hashlib /root/Downloads/Python-3.5.0a2/Lib/test/test_hashlib.py:52: UserWarning: Did a C extension fail to compile? No module named '_hashlib' warnings.warn('Did a C extension fail to compile? %s' % error) Sorry, I'm not sure if it is an issue. -- components: Installation messages: 239487 nosy: SinusAlpha priority: normal severity: normal status: open title: _hashlib compile error? versions: Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23805 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23802] patch: __deepcopy__ memo dict argument usage
R. David Murray added the comment: I would rather say simply The memo dictionary should be treated as an opaque object. On the other hand, I doubt we will ever change the structure of the memo dict, because I'm sure that somewhere out there there is code that is *not* treating it as opaque :) -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23802 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23746] sysconfg.is_python_build() is buggy
Changes by Anand B Pillai anandpil...@letterboxes.org: -- nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23746 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22390] test.regrtest should complain if a test doesn't remove temporary files
Serhiy Storchaka added the comment: Victor? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22390 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23746] sysconfg.is_python_build() is buggy
Changes by Anand B Pillai anandpil...@letterboxes.org: -- assignee: - docs@python components: +Documentation ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23746 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
Benjamin Peterson added the comment: The loop might be more elegantly expressed as for line in self.fp: self.bytes_read += len(line) if line.strip() != b-- + self.innerboundary: break but otherwise lgtm -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
R. David Murray added the comment: The code you are modifying looks completely wrong-headed to me. Unfortunately I don't have time to rewrite the cgi module right now :). Given that, your fix looks fine: the first part of a multipart (up to the first inner boundary) is the 'preamble', which can contain pretty much arbitrary content, and in the context of cgi should indeed be completely ignored. Benjamin's suggested modification has the if logic reversed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23602] Implement __format__ for Fraction
Stefan Behnel added the comment: Meaning, something like this should work: x = (nom * 10**(prec+1)) // den if x % 10 5: x = x // 10 else: x = x // 10 + 1 print('%s.%s' % (x[:-prec], x[-prec:])) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23602 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23602] Implement __format__ for Fraction
Stefan Behnel added the comment: Or, speaking of division with remainder: n, r = divmod(nom * 10**prec, den) if r * 5 = den: n += 1 x = str(n) print('%s.%s' % (x[:-prec], x[-prec:])) ... minus the usual off-by-one that the tests would quickly find :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23602 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23602] Implement __format__ for Fraction
Serhiy Storchaka added the comment: I think that Decimal is not needed for Fraction.__format__ (and I'm not sure that issue23602v4.patch is correct). The correct way to format Fraction as fixed-precision decimal is to use Fraction.__round__() or similar algorithm. The implementation can look like: f = self.__round__(prec) i = int(f) return '%d.%0*d' % (i, prec, abs(f - i) * 10**prec) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23602 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23808] Symlink to directory on Windows 8
New submission from Serhiy Storchaka: Looks as a symlink on Windows 8 can has the FILE_ATTRIBUTE_DIRECTORY flag. http://buildbot.python.org/all/builders/AMD64%20Windows8%203.4/builds/348/steps/test/logs/stdio == FAIL: test_walk_bottom_up (test.test_os.WalkTests) -- Traceback (most recent call last): File #34;D:\buildarea\3.4.bolen-windows8\build\lib\test\test_os.py#34;, line 802, in test_walk_bottom_up self.sub2_tree) AssertionError: Tuples differ: (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;broken_link#39;, #39;link#39;], [#39;tmp3#39;]) != (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;link#39;], [#39;broken_link#39;, #39;tmp3#39;]) First differing element 1: [#39;broken_link#39;, #39;link#39;] [#39;link#39;] - (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;broken_link#39;, #39;link#39;], [#39;tmp3#39;]) ? -- + (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;link#39;], [#39;broken_link#39;, #39;tmp3#39;]) ? ++ == FAIL: test_walk_prune (test.test_os.WalkTests) -- Traceback (most recent call last): File #34;D:\buildarea\3.4.bolen-windows8\build\lib\test\test_os.py#34;, line 782, in test_walk_prune self.assertEqual(all[1], self.sub2_tree) AssertionError: Tuples differ: (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;broken_link#39;, #39;link#39;], [#39;tmp3#39;]) != (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;link#39;], [#39;broken_link#39;, #39;tmp3#39;]) First differing element 1: [#39;broken_link#39;, #39;link#39;] [#39;link#39;] - (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;broken_link#39;, #39;link#39;], [#39;tmp3#39;]) ? -- + (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;link#39;], [#39;broken_link#39;, #39;tmp3#39;]) ? ++ == FAIL: test_walk_topdown (test.test_os.WalkTests) -- Traceback (most recent call last): File #34;D:\buildarea\3.4.bolen-windows8\build\lib\test\test_os.py#34;, line 765, in test_walk_topdown self.assertEqual(all[3 - 2 * flipped], self.sub2_tree) AssertionError: Tuples differ: (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;broken_link#39;, #39;link#39;], [#39;tmp3#39;]) != (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;link#39;], [#39;broken_link#39;, #39;tmp3#39;]) First differing element 1: [#39;broken_link#39;, #39;link#39;] [#39;link#39;] - (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;broken_link#39;, #39;link#39;], [#39;tmp3#39;]) ? -- + (#39;@test_3872_tmp\\TEST1\\SUB2#39;, [#39;link#39;], [#39;broken_link#39;, #39;tmp3#39;]) ? ++ -- Create broken link: os.symlink('non_existing_patch', 'broken_link', target_is_directory=True) What return os.path.isdir('broken_link')? -- components: Tests, Windows messages: 239506 nosy: paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Symlink to directory on Windows 8 versions: Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22500] Argparse always stores True for positional arguments
Changes by Berker Peksag berker.pek...@gmail.com: -- resolution: - not a bug stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22500 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23807] Improved test coverage for calendar.py command line
Berker Peksag added the comment: Thanks for the patch! I thought line 654-656 was already tested by self.assertFailure('-L', 'en'). -- nosy: +berker.peksag, serhiy.storchaka stage: - patch review versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23807 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23548] TypeError in event loop finalizer, new in Python 3.4.3
Joshua Bronson added the comment: Quoting Victor Stinner: I may workaround the bug during Python finalization if more users report this issue. Read the above so reporting I'm hitting this too fwiw. Thanks for the great work on asyncio. -- nosy: +jab ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23548] TypeError in event loop finalizer, new in Python 3.4.3
Joshua Bronson added the comment: Not sure if it's related / helpful but just in case, since upgrading from 3.4.2 to 3.4.3, I'm now seeing this printed to stderr sometimes when my program exits: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: Exception ignored in: -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23602] Implement __format__ for Fraction
Tuomas Suutari added the comment: On 29 March 2015 at 19:54, Serhiy Storchaka wrote: I think that Decimal is not needed for Fraction.__format__ (and I'm not sure that issue23602v4.patch is correct). Of course it's not needed. I'm using it to avoid re-implementing all the various formatting variations that can be controlled with the fill/align/sign/width/,/precision/type parameters (https://docs.python.org/3/library/string.html#formatspec). IMHO those should be supported as they are with floats and Decimals. The correct way to format Fraction as fixed-precision decimal is to use Fraction.__round__() or similar algorithm. The implementation can look like: f = self.__round__(prec) i = int(f) return '%d.%0*d' % (i, prec, abs(f - i) * 10**prec) Why this would be more correct than delegating the rounding (and formatting) to Decimal.__format__? (Then we just have to make sure that we have enough precision in the decimal context we're operating in. That's what I got wrong in the previous round.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23602 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23602] Implement __format__ for Fraction
Stefan Behnel added the comment: But these parameters could also be partly delegated to normal string (not number) formatting, right? One of the advantages of not depending on Decimal is, well, to not depend on Decimal, which is a rather uncommon dependency when using Fractions in an application. I think it could avoid some more calculations to first multiply the nominator by 10**prec, then round(), int() and str() the result, and then split the string at -prec. BTW, if division with remainder wasn't (sadly) linear time, that would definitely be the most beautiful algorithm here. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23602 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23798] NameError in the encode fixer
Serhiy Storchaka added the comment: Oh, sorry, this was my local file. -- resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23798 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23803] str.partition() is broken in 3.4
Serhiy Storchaka added the comment: Here is a patch that should fix the bug. Can it be committed in 3.3 Georg? The patch is simple and fixes a bug in basic type. -- keywords: +patch nosy: +georg.brandl stage: needs patch - patch review Added file: http://bugs.python.org/file38724/str_partition_kind.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23803 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23804] SSLSocket.recv(0) receives up to 1024 bytes
New submission from Martin Panter: The documentation claims that SSL socket objects provide some of the same methods as plain socket objects, including recv(), and that the “bufsize” parameter specifies the maximum amount of data to be received. With ordinary sockets, socket.recv(0) always seems to return zero bytes (b), as expected. But not so with SSL sockets: import socket, ssl s = ssl.wrap_socket(socket.create_connection((localhost, 631))) s.sendall(bGET / HTTP/1.1\r\nHost: localhost\r\n\r\n) 35 len(s.recv(0)) 263 len(s.recv(0)) 1024 The call will hang or raise SSLWantReadError when no data is actually available. Looking at the code, the value of zero seems to be used as a placeholder for a default of 1024 in SSLObject.read(). Either the SSL module should be fixed to return no bytes (my preference), or the documentation needs to warn that the recv(0) is not supported, or does not work the same as for plain sockets. SSLSocket.read() might also be affected. -- components: Library (Lib) messages: 239483 nosy: vadmium priority: normal severity: normal status: open title: SSLSocket.recv(0) receives up to 1024 bytes type: behavior versions: Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23804 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English
Barry Alan Scott added the comment: Mac OS X use the __CF_USER_TEXT_ENCODING env var to setup the locale in for native libraries. I found that for GUI python code I needed to convert the value in __CF_USER_TEXT_ENCODING into a suitable call to setlocale(). The code I use is attached to Issue23797. -- nosy: +barry-scott ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18378 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23803] str.partition() is broken in 3.4
STINNER Victor added the comment: The patch lacks unit test. You showed a test which fails also on little endian. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23803 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
Donald Stufft added the comment: Also adding Berker Peksag because they've touched this module recently :) -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23803] str.partition() is broken in 3.4
Serhiy Storchaka added the comment: Added tests that fail on little and big endianess. -- Added file: http://bugs.python.org/file38726/str_partition_kind_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23803 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23803] str.partition() is broken in 3.4
New submission from Serhiy Storchaka: Tests added in b923eeaf8162 exposed a bug in str.partition() and str.rpartition() in 3.4 on big-endian platforms. It should exist in 3.3 too. It likely was fixed in 3.5 in issue23573. http://buildbot.python.org/all/builders/PPC64%20PowerLinux%203.4/builds/913/steps/test/logs/stdio == FAIL: test_partition (test.test_unicode.UnicodeTest) -- Traceback (most recent call last): File /home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/test_unicode.py, line 383, in test_partition left + right, 'partition', delim) File /home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/string_tests.py, line 63, in checkequal realresult AssertionError: Tuples differ: ('ba', '', '') != ('', '̂', '\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00') First differing element 0: ba - ('ba', '', '') + ('', '̂', '\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00') == FAIL: test_rpartition (test.test_unicode.UnicodeTest) -- Traceback (most recent call last): File /home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/test_unicode.py, line 399, in test_rpartition left + right, 'rpartition', delim) File /home/shager/cpython-buildarea/3.4.edelsohn-powerlinux-ppc64/build/Lib/test/string_tests.py, line 63, in checkequal realresult AssertionError: Tuples differ: ('', '', 'ba') != ('\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00', '̂', '') First differing element 0: - ('', '', 'ba') + ('\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00', '̂', '') -- 'ba'.partition('\U00010302') returns ('', '̂', '\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00') 'ba'.rpartition('\U00010302') returns ('\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00\x00\x00b\x00', '̂', '') -- assignee: serhiy.storchaka components: Interpreter Core messages: 239475 nosy: benjamin.peterson, ezio.melotti, haypo, lemburg, pitrou, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: str.partition() is broken in 3.4 type: behavior versions: Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23803 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23713] intermittent failure of multiprocessing unit test test_imap_unordered_handle_iterable_exception
Serhiy Storchaka added the comment: Why not use just self.assertEqual(sorted(it), list(map(sqr, list(range(10) or self.assertCountEqual(list(it), list(map(sqr, list(range(10) ? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23713 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23803] str.partition() is broken in 3.4
Serhiy Storchaka added the comment: The bug can be reproduced on little-endian platform. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.partition('Ā') ('A', 'Ā', 'B\x00C\x00D\x00E\x00F\x00G\x00H\x00I\x00J\x00K\x00L\x00M\x00') 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.rpartition('Ā') ('A\x00B\x00C\x00D\x00E\x00F\x00G\x00H\x00I\x00J\x00K\x00L\x00M', 'Ā', '') -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23803 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
Donald Stufft added the comment: Added R David Murray to the nosy list because this is kinda similar to the email stuff and there doesn't seem to be anyone better to look at this patch that I can find... -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23796] BufferedReader.peek() crashes if closed
Martin Panter added the comment: Happy to when I get a chance. It should be easy to do, though it is not high on my priority list because I don’t think the scenario is very important in real world usage. I only encountered it when testing edge cases in another patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23796 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22941] IPv4Interface arithmetic changes subnet mask
Søren Løvborg added the comment: As mentioned python-dev, I'm not entirely sold on raising an exception on overflow. To recap the mailing list discussion, there was general agreement that the current behavior is a bug, suggesting that there's no need to go through the depreciation process. There's been three proposals for correct behavior, though: A) To simply ignore the subnet mask: 10.0.0.255/24 + 1 = 10.0.1.0/24 B) To wrap around inside the subnet: 10.0.0.255/24 + 1 = 10.0.0.0/24 C) To raise exception. First, note what happens if we overflow an IPv4Address: ipaddress.IPv4Address('255.255.255.255') + 1 Traceback (most recent call last): ... ipaddress.AddressValueError: 4294967296 (= 2**32) is not permitted as an IPv4 address At least that suggests a type of exception to use in proposal C. There was not much support for the idea of wrapping (B); for which I see three reasons: 1) No identified use case where this effect would be desirable. 2) It's implicit rather than explicit: The addition operator usually does not imply modular arithmetic. 3) It's inconsistent with IPv4Address, which doesn't wrap. That leaves the question of raising an exception (C), or not (A). Now, I used IPv4Interface + 1 to mean Give me the IP next to the current one in the current subnet, knowing from the context that the address would be valid and available. host = ipaddress.IPv4Interface('10.0.0.2/24') peer = host + 1 In this context, an exception makes a lot of sense, as it would certainly have been an error if I'd overflowed the subnet. However, I can also imagine situations in which overflowing would be valid and expected, e.g. as a way to skip to the same IP in the next subnet: ip = ipaddress.IPv4Interface('10.0.0.1/24') ip + ip.network.num_addresses IPv4Interface('10.0.1.1/24') There's an additional issue with raising an exception, and that is that it still won't catch the errors as intended. In my use case: host = ipaddress.IPv4Interface('10.0.0.254/24') peer = host + 1 This wouldn't overflow and not trigger an exception, but the resulting peer address is still invalid (it's the subnet broadcast address, not a host address). As for consistency with IPv4Address, I can argue for either proposal: A) An IPv4Interface behaves exactly like an IPv4Address, except that it also has an associated subnet mask. (This is essentially how it's currently documented). C) Overflowing an IPv4Interface raises AddressValueError just like with IPv4Address. All in all, I'm in favor of keeping things simple and go with solution A, since C prevents a reasonable use, and doesn't actually catch out of bounds errors anyway. I'm open to being convinced otherwise, though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22941 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21398] LC_CTYPE=C: pydoc leaves terminal in an unusable state
R. David Murray added the comment: The KeybaordInterrupt problem has been dealt with in issue 23792. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21398 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23602] Implement __format__ for Fraction
Wolfgang Maier added the comment: Initially, I also thought that this should be addressable with Fraction.__round__ or an optimized variation of it, but Tuomas is right that it gets complicated by the fact that you need to cope with the different format specifiers and not all of them fit the algorithm. In particular, scientific notation poses a problem because it may require a lot more precision in the calculation than the one finally used for formatting. Consider: float(round(Fraction(4, 27000), 6)) 0.000148 but format(4/27000, 'e') '1.481481e-04' Trying to deal with this in pure Python quickly slows your code (at least a few naive attempts of mine) unacceptably compared to Tuomas' patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23602 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
Roundup Robot added the comment: New changeset b9364903d91c by Benjamin Peterson in branch 'default': merge 3.4 (#23801) https://hg.python.org/cpython/rev/b9364903d91c -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23787] sum() function docstring lists arguments incorrectly
Valentine Sinitsyn added the comment: Seems like mentioning string was really a bad idea. They were only used as (poor) example, forget them if they are confusing in any way. In my understanding, any sequence in Python is iterable, bit not all iterables are sequences (correct me if I'm wrong). Then, the purpose of my suggestion is to explicitly say that sum() accepts iterables. In its current form, it seems like it doesn't, that's why I considered the docstring [subtly] wrong. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23787 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23792] help crash leaves terminal in raw mode
Roundup Robot added the comment: New changeset 77c04e949b4b by R David Murray in branch '3.4': #23792: Ignore KeyboardInterrupt when the pydoc pager is active. https://hg.python.org/cpython/rev/77c04e949b4b New changeset fe0c830b43bb by R David Murray in branch 'default': Merge: #23792: Ignore KeyboardInterrupt when the pydoc pager is active. https://hg.python.org/cpython/rev/fe0c830b43bb -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23792 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23808] Symlink to directory on Windows 8
Serhiy Storchaka added the comment: Then tests should be adapted for Windows 8. -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
Donald Stufft added the comment: @Benjamin The reason I didn't do that to begin with, was the code currently checks if the first line is a bytes object or not in order to be able to raise an error if it's returning str instead of bytes. I didn't want to redo that check on every iteration, so I left the original part alone and then used the while loop to handle doing more if needed. Would you prefer the code written your way and either drop the bytes check or incur the cost of doing the type check on every line? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
Benjamin Peterson added the comment: Oh, I see. I think your way is fine then. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
Roundup Robot added the comment: New changeset 3af77d1c5c47 by Donald Stufft in branch '3.4': Closes #23801 - Ignore entire preamble to multipart in cgi.FieldStorage https://hg.python.org/cpython/rev/3af77d1c5c47 -- nosy: +python-dev resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
Changes by Donald Stufft don...@stufft.io: -- stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23808] Symlink to directory on Windows 8
Paul Moore added the comment: It returns True. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23808 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23792] help crash leaves terminal in raw mode
R. David Murray added the comment: I've committed the fix. If someone wants to argue in favor of also handling SIGQUIT, they can open a new issue. -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23792 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2
Donald Stufft added the comment: Thanks everyone for taking a look at this! -- stage: resolved - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23801 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Roundup Robot added the comment: New changeset 09f22b5d6cea by R David Murray in branch 'default': #2211: properly document the Morsel behavior changes. https://hg.python.org/cpython/rev/09f22b5d6cea -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
R. David Murray added the comment: I made several changes to the patch. The whatsnew docs didn't format correctly: there's an extra space on all the lines after the first (a three space indent is apparently required there which I don't understand, but it is also our standard for docs). Also none of the links work, because in the whatsnew document (unlike in the doc page itself) you have to fully qualify the names (eg: ~http.cookies.Morsel to display 'Morsel' and link to the right place). The line about LegalChars was in the wrong section. I rewrote both as a single bullet item with working links. The 'update' and 'copy' methods were not documented. I added them and moved the relevant 'versionchanged' phrases under the newly documented methods. In addition, I decided that the deprecation for key, value, and coded_value would be clearer if phrased as : assignment to XXX; use set instead. A couple of other notes: while functionally it doesn't (currently) make any difference to Sphinx if you use :func: vs :meth:, :meth: is the correct one for all these cases. And you had an extra blank line after the versionchanged directive. I've uploaded the changeset I applied as a diff so that you can more easily see what I changed if you wish. -- Added file: http://bugs.python.org/file38729/http_cookies_morsel_deprecated_set_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
R. David Murray added the comment: Now, anyone want to place bets on someone getting bitten by the new errors that update will raise? :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2211 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14260] re.groupindex is available for modification and continues to work, having incorrect data inside it
Roundup Robot added the comment: New changeset 4d5826fa77a1 by Serhiy Storchaka in branch 'default': Issue #14260: The groupindex attribute of regular expression pattern object https://hg.python.org/cpython/rev/4d5826fa77a1 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14260 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22390] test.regrtest should complain if a test doesn't remove temporary files
Roundup Robot added the comment: New changeset f40984e7ceea by Serhiy Storchaka in branch '2.7': Issue #22390: test.regrtest now emits a warning if temporary files or https://hg.python.org/cpython/rev/f40984e7ceea New changeset 05e6bab4db8f by Serhiy Storchaka in branch '3.4': Issue #22390: test.regrtest now emits a warning if temporary files or https://hg.python.org/cpython/rev/05e6bab4db8f New changeset bed806c9eb4c by Serhiy Storchaka in branch 'default': Issue #22390: test.regrtest now emits a warning if temporary files or https://hg.python.org/cpython/rev/bed806c9eb4c -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22390 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22117] Rewrite pytime.h to work on nanoseconds
Roundup Robot added the comment: New changeset e93eeadef0c3 by Victor Stinner in branch 'default': Issue #22117: Use the _PyTime_t API in _datetime.datetime() constructor https://hg.python.org/cpython/rev/e93eeadef0c3 New changeset b16fc95b66e4 by Victor Stinner in branch 'default': Issue #22117: Cleanup pytime.c/.h https://hg.python.org/cpython/rev/b16fc95b66e4 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22117 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23548] TypeError in event loop finalizer, new in Python 3.4.3
STINNER Victor added the comment: Exception ignored in: Exception ignored in: ... Hum, I already saw such issues when exiting an asyncio application. It's probably because they are some pending tasks or transports which are never closed. You can try to list tasks at exit using: loop.close() print(Task.all_tasks(loop=loop)) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23806] documentation for no_proxy is missing from the python3 urllib documentation
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23806 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22390] test.regrtest should complain if a test doesn't remove temporary files
STINNER Victor added the comment: regrtest_warn_lost_files2.patch looks good to me. I just ran the test suite with ./python -m test -j0 -rW on Linux, I didn't get any warning. When I modified test_os to create a file x, it was noticed by your patch. Go ahead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22390 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com