[issue19871] json module won't parse a float that starts with a decimal point
New submission from picomancer: Try the following in your favorite Python version: import json json.loads(.5) On my Python (2.7.4 and 3.3.1 on Ubuntu Saucy Salamander), I get an exception. However, x = .5 is a valid Python number. With respect to the parsing of floats by the json module, the docs state: By default, this is equivalent to ``float(num_str)``. This statement does not match the behavior I have observed in every version of Python I have tried, and is still in the bleeding-edge (as of this writing) at http://hg.python.org/cpython/file/9283a9c5d0ce/Doc/library/json.rst I think it's clear that the following changes should definitely be implemented: (1) The docs and behavior should match (2) Whatever the desired behavior is, there is a unit test specifically for this corner case Of course, to implement (1), there are two routes: (1a) Leading decimal floats should be accepted by the json module; the behavior should be changed to match the docs. Supported by Postel's Law -- be liberal in what [your program] accept[s]), see http://en.wikipedia.org/wiki/Postel%27s_law and the slightly relaxed attitude toward standards compliance detailed in the json module documentation. (1b) Leading decimal floats should be rejected by the json module; the docs should be changed to match the behavior. This fits with a strict standards compliance worldview. I think (1a) is better. In my particular use case, I was manually writing a json file with several numerical parameters. The backtrace given by json.load(open(whatever.json, r)) is uninformative and merely says No JSON object could be decoded; finding the token the parser considered to be malformed was fairly easy since there were only six or seven keys. It could have been much worse if I was making manual changes to a larger JSON file. -- components: Library (Lib) messages: 205080 nosy: picomancer priority: normal severity: normal status: open title: json module won't parse a float that starts with a decimal point type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19872] Remove unused imports in pathlib
New submission from Vajrasky Kok: Attached the patch to remove unused imports in pathlib. -- components: Library (Lib) files: remove_unused_import_in_pathlib.patch keywords: patch messages: 205081 nosy: pitrou, vajrasky priority: normal severity: normal status: open title: Remove unused imports in pathlib type: performance versions: Python 3.4 Added file: http://bugs.python.org/file32948/remove_unused_import_in_pathlib.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19873] There is a duplicate function in Lib/test/test_pathlib.py
New submission from Vajrasky Kok: Here it is (Lib/test/test_pathlib.py, line 1240): def _check_resolve_relative(self, p, expected): q = p.resolve() self.assertEqual(q, expected) def _check_resolve_absolute(self, p, expected): q = p.resolve() self.assertEqual(q, expected) -- components: Tests messages: 205082 nosy: pitrou, vajrasky priority: normal severity: normal status: open title: There is a duplicate function in Lib/test/test_pathlib.py type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19873 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19871] json module won't parse a float that starts with a decimal point
Antoine Pitrou added the comment: I think it would be better to adhere to the JSON spec, which doesn't allow numbers to start with a decimal point: http://json.org/ If we go this way, the documentation should at least be fixed; and, as you say, we could also add a unit test for it. -- assignee: - docs@python components: +Documentation, Tests -Library (Lib) nosy: +docs@python, pitrou stage: - needs patch versions: -Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19871] json module won't parse a float that starts with a decimal point
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19871] json module won't parse a float that starts with a decimal point
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19850] asyncio: limit EINTR occurrences with SA_RESTART
Anthony Baire added the comment: The patch is fine, but it is hard to rely on it to prevent bugs from happening because that requires cooperation from all modules registering signal handlers. Anyway it facilitates reusing code that was not written for an event-driven context (and many will do that through .run_in_executor()). If the patch is accepted, it would be wise to write a note in .run_in_executor()'s doc saying that asyncio uses SA_RESTART by default in all its handler and that EINTR is prevented *as long as* no other handlers are registered elsewhere. -- nosy: +aba ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19850 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19872] Remove unused imports in pathlib
Roundup Robot added the comment: New changeset a6245b10e8b6 by Antoine Pitrou in branch 'default': Issue #19872: remove unused imports in pathlib. Patch by Vajrasky Kok. http://hg.python.org/cpython/rev/a6245b10e8b6 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19872] Remove unused imports in pathlib
Antoine Pitrou added the comment: Thank you :) -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19872 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19800] Write more detailed framing tests
Roundup Robot added the comment: New changeset 1c04427fff07 by Antoine Pitrou in branch 'default': Issue #19800: make the pickle framing tests more precise. http://hg.python.org/cpython/rev/1c04427fff07 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19800] Write more detailed framing tests
Antoine Pitrou added the comment: Committed with offset replaced with pos. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19873] There is a duplicate function in Lib/test/test_pathlib.py
Antoine Pitrou added the comment: Well, it's not really a duplicate function (the code is the same, but the intent is different). I'm not sure it's worth deduplicating. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19873 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7105] weak dict iterators are fragile because of unpredictable GC runs
Kristján Valur Jónsson added the comment: Strictly speaking b) is not a semantic change. Depending on your semantic definition of semantics. At any rate it is even less so than a) since the temporary list is hidden from view and the only side effect is additional memory usage. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7105 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19871] json module won't parse a float that starts with a decimal point
Serhiy Storchaka added the comment: Agree with Antoine. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7105] weak dict iterators are fragile because of unpredictable GC runs
Kristján Valur Jónsson added the comment: d), We could also simply issue a (documentation) warning, that the iterator methods of these dictionares are known to be fragile, and recommend that people use the keys(), values() and items() instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7105 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7105] weak dict iterators are fragile because of unpredictable GC runs
Antoine Pitrou added the comment: d) sounds like a good enough resolution at this point. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7105 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19873] There is a duplicate function in Lib/test/test_pathlib.py
Vajrasky Kok added the comment: These functions are only being used in test_resolve_common. def test_resolve_common(self): P = self.cls p = P(BASE, 'foo') with self.assertRaises(OSError) as cm: p.resolve() self.assertEqual(cm.exception.errno, errno.ENOENT) # These are all relative symlinks p = P(BASE, 'dirB', 'fileB') self._check_resolve_relative(p, p) p = P(BASE, 'linkA') self._check_resolve_relative(p, P(BASE, 'fileA')) p = P(BASE, 'dirA', 'linkC', 'fileB') self._check_resolve_relative(p, P(BASE, 'dirB', 'fileB')) p = P(BASE, 'dirB', 'linkD', 'fileB') self._check_resolve_relative(p, P(BASE, 'dirB', 'fileB')) # Now create absolute symlinks d = tempfile.mkdtemp(suffix='-dirD') self.addCleanup(shutil.rmtree, d) os.symlink(os.path.join(d), join('dirA', 'linkX')) os.symlink(join('dirB'), os.path.join(d, 'linkY')) p = P(BASE, 'dirA', 'linkX', 'linkY', 'fileB') self._check_resolve_absolute(p, P(BASE, 'dirB', 'fileB')) Why not just combine them to _check_resolve to avoid confusion? It did confuse me. I was not sure whether I had to check the absolute link differently than the relative link. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19873 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19717] resolve() fails when the path doesn't exist
Serhiy Storchaka added the comment: The readlink utility has different modes for canonization: -f, --canonicalize canonicalize by following every symlink in every component of the given name recursively; all but the last component must exist -e, --canonicalize-existing canonicalize by following every symlink in every component of the given name recursively, all components must exist -m, --canonicalize-missing canonicalize by following every symlink in every component of the given name recursively, without requirements on components existence I think every mode has use cases. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19717 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19850] asyncio: limit EINTR occurrences with SA_RESTART
STINNER Victor added the comment: SA_RESTART doesn't need to be enforced. It's better to use it, but selectors and asyncio modules already handle EINTR error. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19850 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux
Vinay Sajip added the comment: Since 3.4 entered beta last week, it is now in feature freeze, so only bug fixes are allowed, unfortunately. Since I did the ld patch I didn't want to commit it before getting another developer to review it, and it looks as if it just dropped under everyone's radar. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9998 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19874] test_logging failures on Snow Leopard
New submission from Antoine Pitrou: test_race in test_logging fails intermittently on the Snow Leopard buildbot: http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/741 == ERROR: test_race (test.test_logging.HandlerTest) -- Traceback (most recent call last): File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_logging.py, line 613, in test_race h.handle(r) File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/logging/__init__.py, line 835, in handle self.emit(record) File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/logging/handlers.py, line 468, in emit self.stream = self._open() File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/logging/__init__.py, line 1005, in _open return open(self.baseFilename, self.mode, encoding=self.encoding) PermissionError: [Errno 1] Operation not permitted: '/tmp/test_logging-3-0my8mx_f.log' During handling of the above exception, another exception occurred: Traceback (most recent call last): File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_logging.py, line 616, in test_race h.close() File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/logging/__init__.py, line 990, in close self.flush() File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/logging/__init__.py, line 937, in flush self.stream.flush() ValueError: I/O operation on closed file. -- components: Library (Lib), Tests messages: 205098 nosy: pitrou, r.david.murray, vinay.sajip priority: normal severity: normal stage: needs patch status: open title: test_logging failures on Snow Leopard type: behavior versions: Python 2.7, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19875] test_getsockaddrarg occasional failure
New submission from Antoine Pitrou: It's on the FreeBSD 10.0 buildbot: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%203.x/builds/1169 == ERROR: test_getsockaddrarg (test.test_socket.GeneralModuleTests) -- Traceback (most recent call last): File /usr/home/buildbot/koobs-freebsd10/3.x.koobs-freebsd10/build/Lib/test/test_socket.py, line 1159, in test_getsockaddrarg sock.bind((host, port)) OSError: [Errno 48] Address already in use -- components: Library (Lib), Tests messages: 205099 nosy: koobs, neologix, pitrou priority: normal severity: normal status: open title: test_getsockaddrarg occasional failure type: behavior versions: Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19875 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19665] test_logging fails with SMTPHandler timeout
Vinay Sajip added the comment: I think the test is fragile, but I'll bump the timeout as suggested. -- nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19665 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19717] resolve() fails when the path doesn't exist
Antoine Pitrou added the comment: I think every mode has use cases. Probably, but which ones are the most likely? A ternary flag leads to a clumsier API than a simple binary flag. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19717 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19665] test_logging fails with SMTPHandler timeout
Roundup Robot added the comment: New changeset 4c5fc9f08b4d by Vinay Sajip in branch '3.3': Issue #19665: Increased timeout for SMTPHandler test. http://hg.python.org/cpython/rev/4c5fc9f08b4d New changeset bfd45dc46569 by Vinay Sajip in branch 'default': Closes #19665: Merged fi from 3.3. http://hg.python.org/cpython/rev/bfd45dc46569 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19665 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19874] test_logging failures on Snow Leopard
Vinay Sajip added the comment: I think this is the same as #19690. -- resolution: - duplicate status: open - closed superseder: - test_logging test_race failed with PermissionError ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19869] BaseCookie does not complain if a non RFC compliant cookie header was given
R. David Murray added the comment: RFCs and cookies don't have much to do with each other in real life. The 'httponly' flag bug was fixed in issue 16611. For backward compatibility reasons we can't start raising errors where we didn't raise them before, so if anything is going to be done it will have to be a bit more complicated, and a be a new feature. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19869 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19870] Backport Cookie fix to 2.7 (httponly / secure flag)
R. David Murray added the comment: I'm not sure why that fix was not backported, so I think it should be OK to do so. 3.2 is in security fix only mode. No one argued that it was a securty issue when it was fixed in 3.3. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19870 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19734] venv and ensurepip are affected by pip environment variable settings
Nick Coghlan added the comment: Issue for the failure to detect a native venv: https://github.com/pypa/pip/issues/1358 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19734 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19734] venv and ensurepip are affected by pip environment variable settings
Nick Coghlan added the comment: Issue for the lack of attention paid to sys.flags.ignore_environment: https://github.com/pypa/pip/issues/1359 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19734 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19734] venv and ensurepip are affected by pip environment variable settings
Changes by Nick Coghlan ncogh...@gmail.com: -- priority: deferred blocker - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19734 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19744] ensurepip should refuse to install pip if SSL/TLS is not available
Nick Coghlan added the comment: Relevant pip issue: https://github.com/pypa/pip/issues/1165 -- nosy: +larry priority: high - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19744 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19347] PEP 453 implementation tracking issue
Nick Coghlan added the comment: Issue 19766 covers the fact that the vendored urllib3 needs to be updated in order to handle the case where Python is built without threading support. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19347 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19347] PEP 453 implementation tracking issue
Nick Coghlan added the comment: Upgrading to release blocker status, since we'd prefer to have everything we can sorted before beta 2 -- nosy: +larry priority: normal - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19347 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19766] test_venv: test_with_pip() failed on AMD64 Fedora without threads 3.x buildbot: urllib3 dependency requires the threading module
Donald Stufft added the comment: The urllib3 in requests VCS was updated, I just need to bother Kenneth to make a new release of requests or update pip to an unreleased requests. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19766 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19744] test_venv fails if SSL/TLS is not available
Changes by Nick Coghlan ncogh...@gmail.com: -- title: ensurepip should refuse to install pip if SSL/TLS is not available - test_venv fails if SSL/TLS is not available ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19744 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19690] test_logging test_race failed with PermissionError
Vinay Sajip added the comment: Unfortunately, the race condition can't be removed completely - it was reduced by the patch in #14632 but could not be eliminated altogether. So this test can fail sporadically - tweaking the timeouts might give some temporary respite, but doesn't guarantee the issue won't return when e.g. machines are unusually heavily loaded. I'll add some diagnostics for now and see what they show. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19690 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19690] test_logging test_race failed with PermissionError
Roundup Robot added the comment: New changeset 8fe3022af4b3 by Vinay Sajip in branch 'default': Added some diagnostics to help with #19690. http://hg.python.org/cpython/rev/8fe3022af4b3 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19690 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19871] json module won't parse a float that starts with a decimal point
Mark Dickinson added the comment: In context, the doc is correct: parse_float, if specified, will be called with the string of every JSON float to be decoded. By default, this is equivalent to float(num_str). IIUC, parse_float only comes into play once the JSON source has already been tokenized, and the tokenization stage has already rejected things like '.5' by that point. (The point of parse_float is that you can choose to turn numeric strings into decimal.Decimal instances instead of floats if you so wish.) I agree it could use clarification. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9709] test_distutils warning: initfunc exported twice on Windows
Roundup Robot added the comment: New changeset 97fb852c5c26 by Stefan Krah in branch 'default': Issue #9709: Stop adding PyInit_ + module_name' to export_symbols. This is http://hg.python.org/cpython/rev/97fb852c5c26 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9709 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19734] venv and ensurepip are affected by pip environment variable settings
Nick Coghlan added the comment: 1358 (failing to detect native virtual environments) will be resolved upstream, but for 1359 (telling pip to ignore the environment variables), I've decided I agree with Paul's suggestion on the pip issue that it makes sense for venv to just strip all environment variables starting with PIP_ from the environment passed to the subprocess. -- components: +Library (Lib) -Tests ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19734 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9709] test_distutils warning: initfunc exported twice on Windows
Stefan Krah added the comment: Éric, thanks for taking a look. -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9709 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets
New submission from STINNER Victor: I remember a discussion about EBADF, but I don't remember the conclusion. The documentation of the asyncio doesn't explain the behaviour of selectors when a file/socket is closed, without unregistering it from the selector. I should be explicitly documented. I would accept an undefined behaviour if it's documented :-) -- assignee: docs@python components: Documentation messages: 205118 nosy: docs@python, gvanrossum, haypo, neologix priority: normal severity: normal status: open title: selectors (and asyncio?): document behaviour on closed files/sockets versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19744] test_venv fails if SSL/TLS is not available
Changes by Piotr Dobrogost p...@bugs.python.dobrogost.net: -- nosy: +piotr.dobrogost ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19744 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19871] json module won't parse a float that starts with a decimal point
Ned Batchelder added the comment: There are other forms of numbers allowed by Python that are not allowed by JSON: 001.1 Oddly, with all of the strictness in JSON, the exponent-marker e can be upper- or lower-case: 1e1 and 1E1 are both valid JSON. -- nosy: +nedbat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19859] functools.lru_cache keeps objects alive forever
Radomir Dopieralski added the comment: I prepared a proof of concept solution at: https://bitbucket.org/thesheep/cpython-lru_cache-weakref/commits/66c1c9f3256785552224ca177ed77a8312de6bb8 -- hgrepos: +215 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19859 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19850] asyncio: limit EINTR occurrences with SA_RESTART
Guido van Rossum added the comment: Please answer this question. Under what circumstances can a signal handler interrupt a blocking system call in a thread that is not the main thread? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19850 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19864] multiprocessing Proxy docs need locking semantics explained
Richard Oudkerk added the comment: From what I remember a proxy method will be thread/process-safe if the referent's corresponding method is thread safe. It should certainly be documented that the exposed methods of a proxied object should be thread-safe. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19864 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets
Guido van Rossum added the comment: Yeah, the behavior is at least different for each type of polling system calls, and possibly also for different platforms. It would be good to describe at least all the different possible behaviors. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16594] SocketServer should set SO_REUSEPORT along with SO_REUSEADDR when present
Guido van Rossum added the comment: Note: it is possible that SO_REUSEPORT is defined yet not implemented (and you'll get an OSError when using it). -- nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16594 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7105] weak dict iterators are fragile because of unpredictable GC runs
Guido van Rossum added the comment: I'm not sure I understand the hesitation about backporting the Python 3 solution. We're acknowledging it's a bug, so the fix is not a feature. The Python 3 solution is the future. So why not fix it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7105 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19850] asyncio: limit EINTR occurrences with SA_RESTART
STINNER Victor added the comment: 2013/12/3 Guido van Rossum rep...@bugs.python.org: Please answer this question. Under what circumstances can a signal handler interrupt a blocking system call in a thread that is not the main thread? There is no guarantee that the signal handler is called in the main thread. On FreeBSD, if I remember correctly, it is called in a random thread. You can control which thread gets the signal using signal.pthread_sigmask() (block signals in other threads) and signal.pthread_kill() (send a signal a specific thread). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19850 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19877] test_resolve_dot of test_pathlib.py fails on Windows Vista
New submission from Vajrasky Kok: You must run this test as administrator. C:\Users\vajrasky\Code\cpythonPCbuild\python.exe Lib\test\test_pathlib.py ..s..s..s..s.s.E ...s..s..s..s.s.E... .. == ERROR: test_resolve_dot (__main__.PathTest) -- Traceback (most recent call last): File Lib\test\test_pathlib.py, line 1281, in test_resolve_dot self.assertEqual(q.resolve(), p) File C:\Users\vajrasky\Code\cpython\lib\pathlib.py, line 1017, in resolve s = self._flavour.resolve(self) File C:\Users\vajrasky\Code\cpython\lib\pathlib.py, line 179, in resolve return self._ext_to_normal(_getfinalpathname(s)) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\\vajrasky\\Code\\cpython\\@test_5860_tmp\\2' == ERROR: test_resolve_dot (__main__.WindowsPathTest) -- Traceback (most recent call last): File Lib\test\test_pathlib.py, line 1281, in test_resolve_dot self.assertEqual(q.resolve(), p) File C:\Users\vajrasky\Code\cpython\lib\pathlib.py, line 1017, in resolve s = self._flavour.resolve(self) File C:\Users\vajrasky\Code\cpython\lib\pathlib.py, line 179, in resolve return self._ext_to_normal(_getfinalpathname(s)) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\\vajrasky\\Code\\cpython\\@test_5860_tmp\\2' -- Windows does not like / in its name for the file. Attached the patch to fix the test. -- components: Tests files: fix_test_resolve_dot_on_windows.patch keywords: patch messages: 205126 nosy: pitrou, vajrasky priority: normal severity: normal status: open title: test_resolve_dot of test_pathlib.py fails on Windows Vista type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file32949/fix_test_resolve_dot_on_windows.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19877] test_resolve_dot of test_pathlib.py fails on Windows Vista
Antoine Pitrou added the comment: Wow, thank you. It's a pity none of the Windows buildbots runs in administrator mode. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19877] test_resolve_dot of test_pathlib.py fails on Windows Vista
Roundup Robot added the comment: New changeset 076824de7650 by Antoine Pitrou in branch 'default': Issue #19877: fix regression in test_pathlib when Windows has symlink support available (i.e. in administrator mode). http://hg.python.org/cpython/rev/076824de7650 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19877] test_resolve_dot of test_pathlib.py fails on Windows Vista
Antoine Pitrou added the comment: Now committed. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19871] json module won't parse a float that starts with a decimal point
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19833] asyncio: patches to document EventLoop and add more examples
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19833 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future?
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18699 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19875] test_getsockaddrarg occasional failure
Charles-François Natali added the comment: This test is inherently subject to a race condition: port = support.find_unused_port() [...] try: self.assertRaises(OverflowError, sock.bind, (host, big_port)) self.assertRaises(OverflowError, sock.bind, (host, neg_port)) sock.bind((host, port)) finally: sock.close() The buildbot being set up ton run the test suite with -j4 is probably the most important factor. A possibility would be to try the find_unused_port() + bind() in a loop a couple times. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19875 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19866] tests aifc, sunau and wave failures on a fresh Win64 installation
Zachary Ware added the comment: Francis, would you like to work on a patch for this? The change should go in Tools/msi/msi.py, if I'm not mistaken. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19866 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future?
Guido van Rossum added the comment: I see no point in keeping this open. -- resolution: - works for me stage: - committed/rejected status: open - closed type: enhancement - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18699 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets
Charles-François Natali added the comment: Well, unregister() documentation currently contains this: .. method:: unregister(fileobj) Unregister a file object from selection, removing it from monitoring. A file object shall be unregistered prior to being closed. I'm not sure what else to say (I don' like the idea of documenting possible behaviors, because it's non-portable, and really might change in a future version). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets
Guido van Rossum added the comment: I think we should give the reader some kind of hint, since a bug in this area may cause a lot of pain when it has to be debugged on porting from a system where the issue is silent to one where it causes a crash. These docs (unlike a PEP) are not a formal standard but documentation for users. Maybe we can add a separate section of caveats? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets
STINNER Victor added the comment: (I don' like the idea of documenting possible behaviors, because it's non-portable, and really might change in a future version). The description doesn't need to be precise, you can just say depending on the platform, closing a file descriptor while selector.select() is polling may be ignored or raise an exception. Which can of exception is raised? It is possible to catch it and find the closed file descriptor? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19878] PyFile_DecUseCount() SIGSEGV
New submission from Matthew Bergin: [level@removed fuzz]# cat pyfile.py import bz2 obj = bz2.BZ2File('/tmp/fileName') obj.__init__(fileName) obj.__reduce__ [level@removed fuzz]# gdb --args python pyfile.py GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type show copying and show warranty for details. This GDB was configured as x86_64-redhat-linux-gnu. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /usr/bin/python...(no debugging symbols found)...done. Missing separate debuginfos, use: debuginfo-install python-2.6.6-37.el6_4.i686 python-2.6.6-37.el6_4.x86_64 (gdb) r Starting program: /usr/bin/python pyfile.py [Thread debugging using libthread_db enabled] Traceback (most recent call last): File pyfile.py, line 3, in module obj.__init__(fileName) IOError: [Errno 2] No such file or directory: 'fileName' Program received signal SIGSEGV, Segmentation fault. 0x77a98170 in PyFile_DecUseCount () from /usr/lib64/libpython2.6.so.1.0 (gdb) -- components: Interpreter Core messages: 205137 nosy: Level priority: normal severity: normal status: open title: PyFile_DecUseCount() SIGSEGV versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19878 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19879] PyCFunction_NewEx() SIGABRT
New submission from Matthew Bergin: [level@removed fuzz]# cat PyCFunction.py # # PyCFunction_NewEx crach poc (sigabrt) # import imageop imageop.rgb82rgb(u%J8CBej uFBi-,True,8.36) imageop.grey2grey(None,5,uCRi) [level@removed fuzz]# gdb --args python PyCFunction.py GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type show copying and show warranty for details. This GDB was configured as x86_64-redhat-linux-gnu. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /usr/bin/python...(no debugging symbols found)...done. Missing separate debuginfos, use: debuginfo-install python-2.6.6-37.el6_4.i686 python-2.6.6-37.el6_4.x86_64 (gdb) r Starting program: /usr/bin/python PyCFunction.py [Thread debugging using libthread_db enabled] PyCFunction.py:5: DeprecationWarning: integer argument expected, got float imageop.rgb82rgb(u%J8CBej uFBi-,True,8.36) Fatal Python error: GC object already tracked Program received signal SIGABRT, Aborted. 0x76e2e8e5 in raise () from /lib64/libc.so.6 (gdb) bt #0 0x76e2e8e5 in raise () from /lib64/libc.so.6 #1 0x76e300c5 in abort () from /lib64/libc.so.6 #2 0x77b2823e in Py_FatalError () from /usr/lib64/libpython2.6.so.1.0 #3 0x77ab3175 in PyCFunction_NewEx () from /usr/lib64/libpython2.6.so.1.0 #4 0x77b24b18 in Py_InitModule4_64 () from /usr/lib64/libpython2.6.so.1.0 #5 0x70b66abe in initsyslog () from /usr/lib64/python2.6/lib-dynload/syslog.so #6 0x77b21865 in _PyImport_LoadDynamicModule () from /usr/lib64/libpython2.6.so.1.0 #7 0x77b1f8a5 in ?? () from /usr/lib64/libpython2.6.so.1.0 #8 0x77b1fb24 in ?? () from /usr/lib64/libpython2.6.so.1.0 #9 0x77b2017d in ?? () from /usr/lib64/libpython2.6.so.1.0 #10 0x77b20ee4 in PyImport_ImportModuleLevel () from /usr/lib64/libpython2.6.so.1.0 #11 0x77b0671f in ?? () from /usr/lib64/libpython2.6.so.1.0 #12 0x77a7ac63 in PyObject_Call () from /usr/lib64/libpython2.6.so.1.0 #13 0x77b06c93 in PyEval_CallObjectWithKeywords () from /usr/lib64/libpython2.6.so.1.0 #14 0x77b0a33f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0 #15 0x77b0db8f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0 #16 0x77b0e657 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0 #17 0x77aa1cb0 in ?? () from /usr/lib64/libpython2.6.so.1.0 #18 0x77a7ac63 in PyObject_Call () from /usr/lib64/libpython2.6.so.1.0 #19 0x77b06c93 in PyEval_CallObjectWithKeywords () from /usr/lib64/libpython2.6.so.1.0 #20 0x77b29cc2 in PyErr_PrintEx () from /usr/lib64/libpython2.6.so.1.0 #21 0x77b2a287 in PyRun_SimpleFileExFlags () from /usr/lib64/libpython2.6.so.1.0 #22 0x77b368a2 in Py_Main () from /usr/lib64/libpython2.6.so.1.0 #23 0x76e1acdd in __libc_start_main () from /lib64/libc.so.6 #24 0x00400649 in _start () (gdb) q -- components: Interpreter Core messages: 205138 nosy: Level priority: normal severity: normal status: open title: PyCFunction_NewEx() SIGABRT type: crash versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19879 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19878] PyFile_DecUseCount() SIGSEGV
Changes by Matthew Bergin mber...@coresecurity.com: -- type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19878 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19877] test_resolve_dot of test_pathlib.py fails on Windows Vista
Brian Curtin added the comment: My build slave ran as admin in order to make sure symlinks were covered, but I don't have the hardware anymore. I'll see if I can get another machine up and running. -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19850] asyncio: limit EINTR occurrences with SA_RESTART
Charles-François Natali added the comment: The patch is fine, but it is hard to rely on it to prevent bugs from happening because that requires cooperation from all modules registering signal handlers. Once again, that's why the bug report says *limit* EINTR occurrences. We all know this won't prevent all occurrences. Anyway it facilitates reusing code that was not written for an event-driven context (and many will do that through .run_in_executor()). If the patch is accepted, it would be wise to write a note in .run_in_executor()'s doc saying that asyncio uses SA_RESTART by default in all its handler and that EINTR is prevented *as long as* no other handlers are registered elsewhere. The single most common cause of signals is SIGCHLD (in a normal code). Since asyncio setups up the SIGCHLD handler, this should cover most of the cases (BTW, just set up a SIGCHLD handler in any Python process spawning subprocesses, and it becomes unusable since EINTR isn't handled in the stdlib). Please answer this question. Under what circumstances can a signal handler interrupt a blocking system call in a thread that is not the main thread? I answered in my prevous message: POSIX makes no guarantee whatsoever as to which thread will receive the signal (except of course in case of synchronous signales like SIGSEGV/SIGFPE). The Linux kernel makes it best to deliver it to the main thread when possible, but in certains cases it can't, and other OS just don't bother. See e.g. issue #19857 for an occurrence on FreeBSD. Also, even the main thread can sometimes make blocking calls subject to EINTR (e.g. acquiring a lock). So the possibility of breakage are real, but if people prefer to wait see, that's fine :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19850 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19850] asyncio: limit EINTR occurrences with SA_RESTART
Guido van Rossum added the comment: OK, I've harassed you enough. Sorry. Go ahead and commit this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19850 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets
Guido van Rossum added the comment: I think you're looking for the discussion in issue 19017. IIRC the conclusion is that not only do you not get the same error everywhere, but you get it at different points -- sometimes register() of a bad FD passes and then [Selector.]select() fails, other times register() of a bad FD fails; when the FD is initially good and then gets closed, sometimes select() may fail, sometimes select() will silently ignore the FD. Sometimes unregister() of a closed FD will return False, sometimes True. Another consequence is that registering an FD, then closing it, then calling select(), then reopening it may keep reporting events for the FD or not. I think these are all things to call out in a section on caveats or common bugs. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19878] PyFile_DecUseCount() SIGSEGV
Ned Deily added the comment: Sorry, the Python 2.6 series is now officially retired. As of 2.6.9, All official maintenance for Python 2.6, including security patches, has ended. If you can reproduce the problem with a currently supported version of Python, such as Python 2.7.6 or 3.3.3, please reopen with similar documentation. http://www.python.org/download/releases/2.6.9/ -- nosy: +ned.deily resolution: - rejected stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19878 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19859] functools.lru_cache keeps objects alive forever
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file32950/66c1c9f32567.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19859 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19859] functools.lru_cache keeps objects alive forever
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +ncoghlan, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19859 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19138] doctest.IGNORE_EXCEPTION_DETAIL doesn't match when no detail exists
Tim Peters added the comment: I agree this is a bug, and at a first scan your fix looks good. I'll make it a priority to pay more attention to it now ;-) -- assignee: - tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19138 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19859] functools.lru_cache keeps objects alive forever
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19859 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19862] Unclear xpath caching for custom namespaces
Stefan Behnel added the comment: This is a duplicate of issue17011. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19862 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19859] functools.lru_cache keeps objects alive forever
Serhiy Storchaka added the comment: Weak references make no sense in most cases when arguments disappear just after function call. For the self argument of a method it makes more sense. Perhaps lru_cache can return not a function, but a descriptor. This will allow implement special processing of first argument. Or new decorator lru_cache_method should be added. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19859 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19859] functools.lru_cache keeps objects alive forever
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- type: resource usage - enhancement versions: -Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19859 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19859] functools.lru_cache keeps objects alive forever
Serhiy Storchaka added the comment: Perhaps following technique can be used to prevent object's life prolongation: def spam(self, *args, **kwargs): @lru_cache(maxsize=20) def spam(foo, bar=1, *, baz=None): ... self.spam = spam return self.spam(*args, **kwargs) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19859 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19859] functools.lru_cache keeps objects alive forever
Raymond Hettinger added the comment: I don't think this is an appropriate use of an LRU cache. There are other ways to freeze a method return value (typically by storing the result in an instance). Here's one way of doing it (taken from the source code for Itty https://pypi.python.org/pypi/itty/0.8.2 ): class lazyproperty(object): A property whose value is computed only once. def __init__(self, function): self._function = function def __get__(self, obj, _=None): if obj is None: return self value = self._function(obj) setattr(obj, self._function.func_name, value) return value Here is how it is used: class Request(object): An object to wrap the environ bits in a friendlier way. ... @lazyproperty def POST(self): return self.build_complex_dict() ... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19859 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19878] bz2.BZ2File.__init__() cannot be called twice
STINNER Victor added the comment: I can reproduce the issue with Python 2.7. The problem is that BZ2File.__init__() doesn't reset the object when __init__() is called twice. For example, the following script fails with too many open files error, before the previous file is not called: --- import bz2 obj = bz2.BZ2File('bla.bz2') for loop in range(1024*10): obj.__init__('bla.bz2') --- By the way, why do you call __init__() twice? Why not creating a new object? BZ2File was rewritten in pure Python in Python 3.3. Python 3.3+ is not affected by this issue. -- nosy: +haypo, serhiy.storchaka resolution: rejected - stage: committed/rejected - status: closed - open title: PyFile_DecUseCount() SIGSEGV - bz2.BZ2File.__init__() cannot be called twice versions: +Python 2.7 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19878 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19879] imageop: bug in error handler
STINNER Victor added the comment: I cannot test the issue, imageop cannot be compiled on 64-bit system and is not present in Python 3. (I don't have access to 32-bit system right now.) Can you reproduce the issue with Python 2.7? I'm interested by your fuzzer, is it public? -- nosy: +haypo, serhiy.storchaka title: PyCFunction_NewEx() SIGABRT - imageop: bug in error handler ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19879 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19878] bz2.BZ2File.__init__() cannot be called twice
Matthew Bergin added the comment: I was fuzzing the interpreter otherwise it would init itself -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19878 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19879] imageop: bug in error handler
Matthew Bergin added the comment: I am going to test it against 2.7 a little later on this afternoon. I typically host all of the code I write at https://github.com/levle but atm the github repo I use to host the project is private. Once I work out some of the kinks I will set it to Public. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19879 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19879] imageop: bug in error handler
Ned Deily added the comment: On 2.7 tip, it fails up front with a TypeError: File /home/nad/PyCFunction.py, line 5, in module imageop.rgb82rgb(u%J8CBej uFBi-,True,8.36) TypeError: integer argument expected, got float [18330 refs] -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19879 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19879] imageop: bug in error handler
STINNER Victor added the comment: I typically host all of the code I write at https://github.com/levle but atm the github repo I use to host the project is private. Once I work out some of the kinks I will set it to Public. I worked on a Python fuzzer some years ago and fixed a lot of similar crashes in Python. See my fuzzer: https://bitbucket.org/haypo/fusil/src/tip/fuzzers/fusil-python It uses the Fusil library: https://bitbucket.org/haypo/fusil/ @Ned: Did you run the script more than once? It looks like a random bug (Heisenbug). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19879 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19879] imageop: bug in error handler
Matthew Bergin added the comment: Sweet, I will check it out -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19879 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19817] tracemalloc add a memory limit feature
STINNER Victor added the comment: This feature cannot be used without a reliable PyErr_NoMemory(): I add issue #19835 as a dependency. -- dependencies: +Add a MemoryError singleton to fix an unlimited loop when the memory is exhausted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19817 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19827] Optimize socket.settimeout() and socket.setblocking(): avoid syscall
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +gvanrossum, neologix, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19827 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19879] imageop: bug in error handler
Ned Deily added the comment: @Victor: On 2.6, it gets a DeprecationWarning. On 2.7, that is now a TypeError. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19879 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19787] tracemalloc: set_reentrant() should not have to call PyThread_delete_key()
STINNER Victor added the comment: Kristján Only that issue #10517 mentions reasons to keep the old behavior, specifically http://bugs.python.org/issue10517#msg134573 (...) @Kristján: The behaviour of PyThread_set_key() discussed in this issue is unrelated to the pthread bug related to fork() fixed in #10517. When it comes to threads and fork, I trust neologix because he knows them better than me and he wrote AFAICT, there's no link. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19787 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19878] bz2.BZ2File.__init__() cannot be called twice
Nadeem Vawda added the comment: It appears that this *does* affect 2.7 (though not 3.2, 3.3 or 3.4, fortunately): ~/src/cpython/2.7☿ gdb --ex run --args ./python -c 'import bz2; obj = bz2.BZ2File(/dev/null); obj.__init__()' «... snip banner ...» Starting program: /home.u/nadeem/src/cpython/2.7/./python -c import\ bz2\;\ obj\ =\ bz2.BZ2File\(\/dev/null\\)\;\ obj.__init__\(\\\) [Thread debugging using libthread_db enabled] Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1. Traceback (most recent call last): File string, line 1, in module IOError: [Errno 2] No such file or directory: '' Program received signal SIGSEGV, Segmentation fault. 0x00431d3e in PyFile_DecUseCount (fobj=0x0) at Objects/fileobject.c:89 89 fobj-unlocked_count--; -- assignee: - nadeem.vawda nosy: +nadeem.vawda stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19878 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets
Charles-François Natali added the comment: Guido van Rossum added the comment: I think you're looking for the discussion in issue 19017. IIRC the conclusion is that not only do you not get the same error everywhere, but you get it at different points -- sometimes register() of a bad FD passes and then [Selector.]select() fails, other times register() of a bad FD fails; when the FD is initially good and then gets closed, sometimes select() may fail, sometimes select() will silently ignore the FD. Sometimes unregister() of a closed FD will return False, sometimes True. Another consequence is that registering an FD, then closing it, then calling select(), then reopening it may keep reporting events for the FD or not. Exactly, it's a mess. I think these are all things to call out in a section on caveats or common bugs. What I don't remember was the conclusion: do we want to keep the current OS-specific behavior, or do we want to try to be tolerant with misuse? For example, one possibility would be to ignore errors when unregistering a file descriptor from epoll: for example, the selectmodule currently ignore EBADF when unregistering a FD: case EPOLL_CTL_DEL: /* In kernel versions before 2.6.9, the EPOLL_CTL_DEL * operation required a non-NULL pointer in event, even * though this argument is ignored. */ Py_BEGIN_ALLOW_THREADS result = epoll_ctl(epfd, op, fd, ev); if (errno == EBADF) { /* fd already closed */ result = 0; errno = 0; } IIRC libev and libevent both ignore those errors. We have to settle on a solution before documenting it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19787] tracemalloc: set_reentrant() should not have to call PyThread_delete_key()
Charles-François Natali added the comment: STINNER Victor added the comment: Kristján Only that issue #10517 mentions reasons to keep the old behavior, specifically http://bugs.python.org/issue10517#msg134573 (...) @Kristján: The behaviour of PyThread_set_key() discussed in this issue is unrelated to the pthread bug related to fork() fixed in #10517. When it comes to threads and fork, I trust neologix because he knows them better than me and he wrote AFAICT, there's no link. It's unrelated, but I don't know if changing the current semantics could break some code, especially involving subinterpreters: that's why i'd like to have it tested. But the current behavior is *really* a pain: not having PyThread_set_key(key, value) assert(PyThread_get_key(key) == value) sounds really wrong. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19787 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets
STINNER Victor added the comment: import selectors, os r,w=os.pipe() s=selectors.SelectSelector() s.register(r, selectors.EVENT_READ) SelectorKey(fileobj=3, fd=3, events=1, data=None) os.close(r) os.close(w) s.unregister(r) SelectorKey(fileobj=3, fd=3, events=1, data=None) SelectSelector.unregister(closed fd) doesn't raise any error, so it makes sense to ignore EBADF in EpollSelector.unregister(). What's the point of raising an error here? If you want a portable behaviour, the file descriptor should be tested (ex: call os.fstat or os.dup). For the normal use case, I would not expect a syscall on unregister(), because unregister() may be called just before closing the file descriptor. Maybe you can explain that in the caveats section? Suggestion: unregister(fd) does not check if fd is closed or not (to get a portable behaviour), os.fstat() or os.dup() can be used to check if the fd is closed or not. Or unregister(fd) ignores error if the file descriptor is closed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8075] Windows (Vista/7) install error when choosing to compile .py files
Ethan Furman added the comment: Just tried installing 2.6.6 on Windows 7 with compile checked and make default unchecked and did not observe any problems (although it did scroll by at high speed, and the windows didn't stay open for me to peruse). However, since we are no longer releasing binary installers for the 2.6 branch, can this be closed? -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8075 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19138] doctest.IGNORE_EXCEPTION_DETAIL doesn't match when no detail exists
Tim Peters added the comment: On second thought, I don't want to use a regexp for this. The mandatory colon _was_ a kind of absolute wall, and the various instances of [^:] exploited that to avoid unintended matches. But possibly dotted name followed possibly by a colon is straightforward to get right with a pair of simple string searches, so I'll introduce a new `_strip_exception_details()` function instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19138 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets
Guido van Rossum added the comment: Heh, I'd forgotten the behavior of unregister(). It seems that there are two layers to the behavior -- if this FD was never register()ed it will raise; if it was register()ed but has since been close()d it may raise. For the higher-level APIs in asyncio I chose not to raise from the remove_{reader,writer}() methods -- they return True if something was removed, False if not. This currently has to be implemented by explicitly asking the selector for the key first. I.e.: def remove_reader(self, fd): Remove a reader callback. try: key = self._selector.get_key(fd) except KeyError: return False else: mask, (reader, writer) = key.events, key.data mask = ~selectors.EVENT_READ if not mask: self._selector.unregister(fd) else: self._selector.modify(fd, mask, (None, writer)) if reader is not None: reader.cancel() return True else: return False -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19876 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com