[issue14074] argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple
paul j3 added the comment: oops - to fix the error message that OP complained about, I need to patch '_get_action_name' as well: def _get_action_name(argument): ... elif argument.metavar not in (None, SUPPRESS): metavar = argument.metavar if isinstance(metavar, tuple): metavar = '|'.join(metavar) return metavar -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14074 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21354] PyCFunction_New no longer exposed by python DLL breaking bdist_wininst installers
New submission from Mark Hammond: Python 3.3 and earlier have in methodobject.c: /* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(), but it's part of the API so we need to keep a function around that existing C extensions can call. */ #undef PyCFunction_New PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *); which means PyCFunction_New is exported from the DLL. Python 3.4 does not have this (which seems a bug in its own right given the comment in 3.3 and earlier) but PC/bdist_wininst/install.c has code that attempts to dynamically load this function from the DLL and fails, causing 3rd party installers to fail. Assuming the removal of this API was intentional so the problem is that install.c needs to be updated, the following patch fixes the issue. -- components: Windows files: t.patch keywords: patch messages: 217185 nosy: mhammond priority: normal severity: normal status: open title: PyCFunction_New no longer exposed by python DLL breaking bdist_wininst installers type: behavior Added file: http://bugs.python.org/file35043/t.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21354 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21349] crash in winreg SetValueEx with memoryview
Tim Golden added the comment: I can confirm that the problem (which really is a hard crash) only applies to 2.7 and that the patch tests and fixes it. I'm happy to apply. Any objections? -- assignee: - tim.golden nosy: +tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21349] crash in winreg SetValueEx with memoryview
Antoine Pitrou added the comment: Are you aware of the old/new buffer interfaces and their usages? Did you actually try the code? crash would be obvious. I cannot try the code as I'm under Linux :-) I was asking merely because many people report plain exception tracebacks as crashes. Yes, by reading the patch it came to me that it was probably related to the coexistence of old and new buffer API, but I prefer it to be confirmed by the reporter, rather than trust my own intuition. (I also wonder why the code did that manually instead of calling e.g. PyObject_AsReadBuffer) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21109] tarfile: Traversal attack vulnerability
Eduardo Robles Elvira added the comment: Do we have any final decision on what's the best approach to solve this? I see some possibilities: a) leave the issue to the library user. I think that's a not good solution security-wise as many will be unaware of the problem and this promotes code duplication for the fix. On the other hand, this does not change default behavior. b) fix the problem as proposed in the patch sent by Daniel. This makes the tarfile secure against this kind of attacks. It does change the behavior and doesn't allow to extract in arbitrary paths, though. c) fix the problem so that by default extracting in arbitrary paths is not allowed, but allow somehow to do that optionally. This way we change the default behavior but provide an easy fix for those that depend on that functionality. d) do not change the default, but provide a well documented and easy way to activate the safety checks that fix this kind of attacks. The advantage is that it doesn't change the default behavior, the disadvantage is that many people will have to modify their code to be secure, and that the default is not very secure. For what is worth, I believe either b or c should be chosen to fix this issue. -- nosy: +edulix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21109 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21109] tarfile: Traversal attack vulnerability
Eduardo Robles Elvira added the comment: Also, I guess this patch solves and is closely related to #1044 which was, at the time (2007), considered not a bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21109 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21207] urandom persistent fd - not re-openned after fd close
Roundup Robot added the comment: New changeset a66524ce9551 by Antoine Pitrou in branch '3.4': Issue #21207: Detect when the os.urandom cached fd has been closed or replaced, and open it anew. http://hg.python.org/cpython/rev/a66524ce9551 New changeset d3e8db93dc18 by Antoine Pitrou in branch 'default': Issue #21207: Detect when the os.urandom cached fd has been closed or replaced, and open it anew. http://hg.python.org/cpython/rev/d3e8db93dc18 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21207 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21207] urandom persistent fd - not re-openned after fd close
Antoine Pitrou added the comment: Ok, I've committed the patch. Hopefully this will also fix any similar issues. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21207 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21355] shallow defaults to true, not 1 [filecmp.cmp]
New submission from Diana Clarke: A minor correction to the filecmp.cmp doc string. 'defaults to 1' - 'defaults to True' While shallow used to default to 1 years ago, it now defaults to True. def cmp(f1, f2, shallow=True): PS. I know this diff is annoyingly trivial, but I'm using it to learn the process. Thanks, --diana -- components: Library (Lib) files: shallow_defaults_to_true_not_1.patch keywords: patch messages: 217192 nosy: diana priority: normal severity: normal status: open title: shallow defaults to true, not 1 [filecmp.cmp] type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file35044/shallow_defaults_to_true_not_1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21355 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21355] Shallow defaults to True, not 1 [filecmp.cmp]
Changes by diana diana.joan.cla...@gmail.com: -- title: shallow defaults to true, not 1 [filecmp.cmp] - Shallow defaults to True, not 1 [filecmp.cmp] ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21355 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15422] Get rid of PyCFunction_New macro
Antoine Pitrou added the comment: Regression in issue #21354. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15422 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21354] PyCFunction_New no longer exposed by python DLL breaking bdist_wininst installers
Antoine Pitrou added the comment: This is apparently because mismanagement of issue #15422. Andrew, you did the commits, can you restore the PyAPI_FUNC declaration? -- assignee: - asvetlov nosy: +asvetlov, larry, pitrou priority: normal - release blocker stage: - needs patch versions: +Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21354 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21354] PyCFunction_New no longer exposed by python DLL breaking bdist_wininst installers
Antoine Pitrou added the comment: (while none of PyCFunction_New and PyCFunction_NewEx are documented, they are part of the stable ABI - the python3.def file -, so removing the API is presumably a bug, not a feature) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21354 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21352] improve documentation indexing
Changes by Antoine Pitrou pit...@free.fr: -- title: improve indexing - improve documentation indexing ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21352 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18185] Error in test_set.TestVariousIteratorArgs.test_inline_methods
Berker Peksag added the comment: This was fixed in b6059bac8a9c. (see also issue 18944) -- resolution: - out of date stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18185 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18944] Minor mistake in test_set.py
Berker Peksag added the comment: The same typo also needs to be fixed in the 2.7 branch: http://hg.python.org/cpython/file/2.7/Lib/test/test_set.py#l1618 -- nosy: +berker.peksag resolution: fixed - stage: resolved - needs patch status: closed - open versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18944 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21356] LibreSSL/RAND_egd fix needed.
New submission from Edd Barrett: Hi, I'm sure you have heard about OpenBSD's LibreSSL fork of OpenSSL. There has been a lot of code reorganisation and removal. One function which was removed `RAND_egd()` breaks the CPython build. CPython no longer builds on OpenBSD. I have submitted a patch against PyPy already. The application library part of the change can probably be re-used since PyPy borrows CPython's application-level standard library (including the `ssl` and `socket` module). However, for the interpreter level change, the build system will probably have to be hacked. We need to check for the existence of `RAND_egd()` at configure time and only build in support if the function is found. The PyPy patch (and some discussion) is here: https://bitbucket.org/pypy/pypy/pull-request/233/fix-translation-for-libressl-and-fix-ssl/diff#comment-1744605 I may have a go at doing this myself (for Python-2.7 at least) if no-one steps up in the meantime; for now just making the CPython devs aware. Thanks -- components: Build messages: 217198 nosy: Edd.Barrett priority: normal severity: normal status: open title: LibreSSL/RAND_egd fix needed. versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21356 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21356] LibreSSL/RAND_egd fix needed.
Antoine Pitrou added the comment: This should wait until the LibreSSL API stabilizes. Regardless, I think we should consider deprecating RAND_egd(). The Entropy Gathering Daemon doesn't seem to have seen a release for more than 10 years... (http://sourceforge.net/projects/egd/files/) -- nosy: +christian.heimes, dstufft, giampaolo.rodola, haypo, janssen, pitrou versions: -Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21356 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21356] LibreSSL/RAND_egd fix needed.
Changes by Antoine Pitrou pit...@free.fr: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21356 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21349] crash in winreg SetValueEx with memoryview
Roundup Robot added the comment: New changeset 061db174baad by Tim Golden in branch '2.7': Issue21349 Passing a memoryview to _winreg.SetValueEx now correctly raises a TypeError where it previously crashed the interpreter. Patch by Brian Kearns http://hg.python.org/cpython/rev/061db174baad -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21357] Increase filecmp test coverage from 63% to 76%
New submission from diana: - Increase filecmp test coverage from 63% to 76% - I left the testing style as-is, though it could probably be modernized. - I did not attempt to add coverage for 'funny_files', 'subdirs', etc, next pass perhaps. - Before: diana$ ./python.exe ../coveragepy report --show-missing Name Stmts Miss Cover Missing --- Lib/filecmp 163 6163% 64, 80, 126, 130, 159-161, 164-166, 172, 174, 178-180, 190-194, 197-199, 203-224, 227-230, 233-236, 246, 293-302, 305 - After: diana$ ./python.exe ../coveragepy report --show-missing Name Stmts Miss Cover Missing --- Lib/filecmp 163 3976% 64, 80, 126, 130, 159-161, 164-166, 172, 174, 178-180, 192-194, 197-199, 217-218, 220-221, 223-224, 229-230, 235-236, 246, 293-302, 305 Thoughts? Thanks! -- components: Library (Lib) files: increase_filecmp_test_coverage.patch keywords: patch messages: 217201 nosy: diana priority: normal severity: normal status: open title: Increase filecmp test coverage from 63% to 76% type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file35045/increase_filecmp_test_coverage.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21349] crash in winreg SetValueEx with memoryview
Roundup Robot added the comment: New changeset 9c38cfc7bed7 by Tim Golden in branch '2.7': Add NEWS entry for issue21349 http://hg.python.org/cpython/rev/9c38cfc7bed7 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21213] Memory bomb by incorrect custom serializer to json.dumps
Lukas Lueg added the comment: The behavior is triggered in Modules/_json.c:encoder_listencode_obj(). It actually has nothing to do with the TypeError itself, any object that produces a new string representation of itself will do. The function encoder_listencode_obj() calls the user-supplied function with the instance to get a string, float, integer or whatever it knows to how convert to json by itself. As the function keeps returning new instances of TypeError, the recursion builds up. The MemoryError is ultimately triggered by the fact that repr() keeps escaping all single quotes from the previous repr(), generating a huge string. Also see repr(repr(repr('))) Testing with 2gb of ram and no swap (disable to to prevent starvation instead of immediate crash!), cpython dies within 34 recursion levels. The obj-parameter for encoder_listencode_obj() looks like Foo(obj='Foo \'Foo \\\'Foo \\\'Foo Foo \\\'object object at 0x77f52100\\\'\\\'\\\'\''). My two cents: This is expected behavior. The json-module has no way to tell in advance if the encoding-function never returns. The fact that repr() causes this blowup here can't be fixed. -- nosy: +ebfe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21213 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21356] LibreSSL/RAND_egd fix needed.
Changes by Remi Pointel pyt...@xiri.fr: -- nosy: +rpointel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21356 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21357] Increase filecmp test coverage from 63% to 76%
Changes by Antoine Pitrou pit...@free.fr: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21213] Memory bomb by incorrect custom serializer to json.dumps
saaj added the comment: Well, as far as I see the question here is whether it makes sense to allow the default function to return JSON-incompatible objects. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21213 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21355] Shallow defaults to True, not 1 [filecmp.cmp]
Roundup Robot added the comment: New changeset b7fd640fb159 by Benjamin Peterson in branch '3.4': shallow defaults to 'True' not '1' (closes #21355) http://hg.python.org/cpython/rev/b7fd640fb159 New changeset 9ab6d13553ef by Benjamin Peterson in branch 'default': merge 3.4 (#21355) http://hg.python.org/cpython/rev/9ab6d13553ef -- nosy: +python-dev resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21355 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18944] Minor mistake in test_set.py
Changes by Terry J. Reedy tjre...@udel.edu: -- assignee: tim.peters - terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18944 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18944] Minor mistake in test_set.py
Roundup Robot added the comment: New changeset de6047ea33e6 by Terry Jan Reedy in branch '2.7': Issue #18944: backport typo fix http://hg.python.org/cpython/rev/de6047ea33e6 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18944 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18944] Minor mistake in test_set.py
Changes by Terry J. Reedy tjre...@udel.edu: -- resolution: - fixed stage: needs patch - resolved status: open - closed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18944 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21213] Memory bomb by incorrect custom serializer to json.dumps
Lukas Lueg added the comment: It's perfectly fine for the function to return an object that can't be put directly into a json string. The function may not convert the object directly but in multiple steps; the encoder will call the function again with the new object until everything boils down to a str, an integer etc.. If one keeps returning objects that never converge to one of those basic types, the interpreter faces death by infinite recursion. The situation described here adds the oom condition caused by repr() blowing up. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21213 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21213] Memory bomb by incorrect custom serializer to json.dumps
saaj added the comment: I'll try to be more specific at my point. There're two cases: 1. Scalar: NoneType, int, bool, float, str. Ended immediately. 2. Non-scalar: list/tuple, dict. Recursively traversed, which may result in subsequent calls to the custom function. If the return value is restricted to given types (what the encoder is capable on its own), it is harder to shoot oneself in the foot. In other words what's the point of returning arbitrary Python object from the function? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21213 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21357] Increase filecmp test coverage from 63% to 76%
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19776] Provide expanduser() on Path objects
Roman Inflianskas added the comment: I think that `absolute` method should call `expanduser` and `expandvars` (do you plan to include it?) automatically. This should be optional (via default arguments: `expanduser=True, expandvars=True`. -- nosy: +rominf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19776 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17679] sysconfig generation uses some env variables multiple times
Christopher Arndt added the comment: Another solution may be to make the test more relaxed and regard the value returned by sysconfig.get_config_var() as a _set_ of shell tokens, whose elements may occur more than once, e.g. def test_sysconfig_module(self): import sysconfig as global_sysconfig from shlex import split self.assertEqual( set(split(global_sysconfig.get_config_var('CFLAGS'))), set(split(sysconfig.get_config_var('CFLAGS' self.assertEqual( set(split(global_sysconfig.get_config_var('LDFLAGS'))), set(split(sysconfig.get_config_var('LDFLAGS' -- nosy: +strogon14 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17679 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21357] Increase filecmp test coverage from 63% to 76%
Benjamin Peterson added the comment: Thanks for the patch. I think you could use the support.catpured_stdout() context-manager in _assert_report. You should also sign the contributor agreement. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21358] Augmented assignment doc: clarify 'only evaluated once'
New submission from Terry J. Reedy: https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements An augmented assignment expression like x += 1 can be rewritten as x = x + 1 to achieve a similar, but not exactly equal effect. In the augmented version, x is only evaluated once. As discussed and demonstrated as part of #21101 (see msg 215560) and following, this is not exactly true in current CPython. If the expression 'x' is 'y[k]', then the subscription is performed twice, once to get and once to set. Both y and k are still evaluated just once. def ob(): print('ob fetched') return d def key(): print('key called') return 0 d = [[]] ob()[key()] += [1] print(d) # prints ob fetched key called [[1]] I suggest changing x is only evaluated once. to something like x is usually only evaluated once. However, if x has the form y[k], y and k are evaluated once but the subscription may be done twice, once to get and once to set. I intentionally said 'subscription may be' rather than 'subscription is' because implementations should remain free to do the subscription (and the whole expression x) just once -- by directly replacing the reference to the old value in the internals of the mapping structure with a reference to the new value. #16701 discusses possible ambiguity in the next sentence, about 'in place'. -- assignee: docs@python components: Documentation messages: 217212 nosy: docs@python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Augmented assignment doc: clarify 'only evaluated once' type: enhancement versions: Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21358 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16701] Docs missing the behavior of += (in-place add) for lists.
Terry J. Reedy added the comment: Augmented assignment confuses enough people that I think we can improve the doc. In #21358 I suggest an augmented version of the previous claim, about evaluation just once. I think something here is needed perhaps even more. I have not decided what just yet. -- nosy: +terry.reedy versions: +Python 3.5 -Python 2.6, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16701 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Roundup Robot added the comment: New changeset 0a2ac61729d2 by Stefan Krah in branch '2.7': Issue #17145: Document array.array buffer interface limitations. http://hg.python.org/cpython/rev/0a2ac61729d2 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Stefan Krah added the comment: I pushed a minimal patch that focuses on the array.array issue. For broader changes, I suggest to use #14198 (though it is unlikely tha anyone will work on it). -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19385] dbm.dumb should be consistent when the database is closed
Roundup Robot added the comment: New changeset e8343cb98cc3 by Benjamin Peterson in branch '3.4': make operations on closed dumb databases raise a consistent exception (closes #19385) http://hg.python.org/cpython/rev/e8343cb98cc3 New changeset dbceba88b96e by Benjamin Peterson in branch 'default': merge 3.4 (#19385) http://hg.python.org/cpython/rev/dbceba88b96e -- nosy: +python-dev resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19385 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14198] Backport parts of the new memoryview documentation
Changes by Stefan Krah stefan-use...@bytereef.org: -- assignee: skrah - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14198 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21358] Augmented assignment doc: clarify 'only evaluated once'
Martin v. Löwis added the comment: This is not limited to dictionaries. Augmented assignment *always* involves a read operation and a write operation. So Antoine's remark in msg215573 is more general; a.x += 1 has a get and a set, and even x += 1 has a get and a set. I still agree that the original statement is confusing. It (implicitly) claims that x = x + 1 evaluates x twice, which it does not. Instead, x is only *evaluated* once, and then written to. Only if x has subexpressions, they get evaluated only once (evaluation being the thing that produces a value). -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21358 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17305] IDNA2008 encoding missing
Martin v. Löwis added the comment: I would propose this approach: 1. Python should implement both IDNA2008 and UTS#46, and keep IDNA2003 2. idna should become an alias for idna2003. 3. The socket module and all other place that use the idna encoding should use uts46 instead. 4. Pre-existing implementations of IDNA 2008 should be used as inspirations at best; Python will need a new implementation from scratch, one that puts all relevant tables into the unicodedata module if they aren't there already. This is in particular where the idna 0.1 library fails. The implementation should refer to the relevant parts of the specification, to be easily reviewable for correctness. Contributions are welcome. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21359] IDLE Redo command accelerator acts as Undo with current OS X Cocoa Tk 8.5.15
New submission from Ned Deily: With the current Cocoa Tk 8.5 (ActiveState 8.5.15), it appears that the IDLE Redo accelerator, Cmd-Shift-Z, has the same effect as the Undo accelerator, Cmd-Z. This is probably related to the behavior and changes in Cocoa Tk noted in Issue11055. With the older Apple-supplied Tk 8.5.9 on OS X 10.9, the Cmd-Shift-Z causes two Redos. Cmd-Shift-Z works correctly with Carbon Tk 8.4.20 (as linked with the 32-bit-only python.org installers) and selecting the Redo menu item, rather than using a keyboard shortcut, appears to work correctly with all versions. -- assignee: ned.deily messages: 217219 nosy: ned.deily priority: normal severity: normal status: open title: IDLE Redo command accelerator acts as Undo with current OS X Cocoa Tk 8.5.15 versions: Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21359 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21359] IDLE Redo command accelerator acts as Undo with current OS X Cocoa Tk 8.5.15
Ned Deily added the comment: Instigated by http://stackoverflow.com/questions/23316425/idle-redo-shortcut-vanished/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21359 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21360] mailbox.Maildir should ignore files named with a leading dot
New submission from Lars Wirzenius: The maildir format specification (see http://cr.yp.to/proto/maildir.html) is clear that files named with leading dots should be ignore: Unless you're writing messages to a maildir, the format of a unique name is none of your business. A unique name can be anything that doesn't contain a colon (or slash) and doesn't start with a dot. Do not try to extract information from unique names. Test case: liw@havelock$ find Maildir -ls 89212064 drwxrwxr-x 5 liw liw 4096 Apr 26 23:03 Maildir 89212074 drwxrwxr-x 2 liw liw 4096 Apr 26 23:03 Maildir/cur 89212094 drwxrwxr-x 2 liw liw 4096 Apr 26 23:03 Maildir/tmp 89212084 drwxrwxr-x 2 liw liw 4096 Apr 26 23:03 Maildir/new 89135230 -rw-rw-r-- 1 liw liw 0 Apr 26 23:03 Maildir/new/.foo liw@havelock$ python -c 'import mailbox maildir = mailbox.Maildir(Maildir) print maildir.keys() ' ['.foo'] liw@havelock$ The correct output would be the empty list. mutt -f Maildir correctly shows now messages in that folder. -- components: Library (Lib) messages: 217221 nosy: liw priority: normal severity: normal status: open title: mailbox.Maildir should ignore files named with a leading dot type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21360 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21357] Increase filecmp test coverage from 63% to 76%
Changes by diana diana.joan.cla...@gmail.com: Added file: http://bugs.python.org/file35046/increase_filecmp_test_coverage_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21357] Increase filecmp test coverage from 63% to 76%
Changes by diana diana.joan.cla...@gmail.com: Removed file: http://bugs.python.org/file35046/increase_filecmp_test_coverage_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21357] Increase filecmp test coverage from 63% to 76%
diana added the comment: Nice, the support.catpured_stdout() context manager is much better. I've added a new patch with that change: increase_filecmp_test_coverage__updated_to_use_context_manager.patch Thanks for reviewing this, Benjamin! PS. I signed the contributor agreement. -- Added file: http://bugs.python.org/file35047/increase_filecmp_test_coverage__updated_to_use_context_manager.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21357 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18243] mktime_tz documentation out-of-date
Roundup Robot added the comment: New changeset d24f1fb256a3 by R David Murray in branch '3.4': #18243: Remove obsolete cautionary note from email mktime_tz docs. http://hg.python.org/cpython/rev/d24f1fb256a3 New changeset 462470859e57 by R David Murray in branch 'default': Merge: #18243: Remove obsolete cautionary note from email mktime_tz docs. http://hg.python.org/cpython/rev/462470859e57 New changeset d1a641ecbe33 by R David Murray in branch '2.7': #18243: Remove obsolete cautionary note from email mktime_tz docs. http://hg.python.org/cpython/rev/d1a641ecbe33 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18243 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18243] mktime_tz documentation out-of-date
R. David Murray added the comment: Thanks, Akira. -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18243 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
STINNER Victor added the comment: I know that an earlier request to use nanosleep() has been rejected as wontfix It was the issue #13981. I created this issue while I worked on the PEP 410 (nanosecond timestamp). I closed the issue myself, it doesn't mean that Python must not use the function, just that I didn't want to work on it anymore at this time. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21302 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
STINNER Victor added the comment: I'm working on a patch, but I noticed a similar issue in Condition.wait(), which also keeps re-evaluating the remaining sleep time based on the current kernel clock, with similar effects. I see that Lock.acquire(timeout) uses the C function gettimeofday() to recompute the timeout if acquiring the lock was interrupted (C error EINTR). It would be better to use a monotonic clock here, but please open a new issue because it's unrelated to nanosleep(). Or did you another bug? By the way, you didn't mention the Python version. Are you working on Python 2.7 or 3.5? See also the PEP 418. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21302 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
STINNER Victor added the comment: If you want to modify time.sleep(), you must be careful of the portability: Windows, Linux, but also Mac OS X, FreeBSD, Solaris, etc. Try to describe the behaviour of each underlying C function on each platform to be able to describe the portable behaviour on all platforms, especially the expected behaviour when the system clock is changed (is time.sleep impacted or not? always?) and the expected behaviour when the system is suspended. For example, it looks like nanosleep() uses a different clock depending on OS (Linux uses CLOCK_MONOTONIC, other UNIX platforms use CLOCK_REALTIME). http://lists.gnu.org/archive/html/bug-coreutils/2012-08/msg00087.html I know that you suggest to use clock_nanosleep(), but this function is not available on all platforms. For example, I would not use it on Windows. Another example (on Fedora?): sleep() ignores time spent with a suspended system http://mjg59.dreamwidth.org/7846.html You should also decide how to handle interrupted sleep (C error EINTR). Currently, the sleep is interrupted, no error is raised. I began to describe all these functions in the PEP 418, even if I didn't change the implementation with the PEP: http://legacy.python.org/dev/peps/pep-0418/#sleep -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21302 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21233] Add *Calloc functions to CPython memory allocation API
STINNER Victor added the comment: I read again some remarks about alignement, it was suggested to provide allocators providing an address aligned to a requested alignement. This topic was already discussed in #18835. If Python doesn't provide such memory allocators, it was suggested to provide a trace function which can be called on the result of a successful allocator to trace an allocation (and a similar function for free). But this is very different from the design of the PEP 445 (new malloc API). Basically, it requires to rewrite the PEP 445. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21233 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18835] Add aligned memory variants to the suite of PyMem functions/macros
STINNER Victor added the comment: It looks like a memory allocator with a given alignment would help numpy, for SIMD instructions: https://mail.python.org/pipermail/python-dev/2014-April/134092.html (but Numpy does not currently use aligned allocation, and it's not clear how important it is) See also this old discussion on python-dev: https://mail.python.org/pipermail/python-dev/2010-September/103911.html Related to this website: http://mallocv2.wordpress.com/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18835 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21220] Enhance obmalloc allocation strategy
STINNER Victor added the comment: I spend some nights to try to understand the memory usage of the following Python script: https://bitbucket.org/haypo/misc/src/31bf03ace91db3998981ee56caf80f09c29991f5/memory/python_memleak.py?at=default It looks like the weird memory usage (aka memory fragmentation?) was fixed in Python 3.3. This significantly helps fragmentation in programs with dynamic memory usage, e.g. long running programs. On which programs? The fragmentation of the memory depends a lot on how the program allocates memory. For example, if a program has no temporary memory peak, it should not be a victim of the memory fragmentation. To measure the improvment of such memory allocator, more benchmarks (speed and fragmentation) should be run than a single test (memcruch.py included in the test) written to benchmark the allocator. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21220 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21216] getaddrinfo is wrongly considered thread safe on linux
STINNER Victor added the comment: @Julien.Palard: Ping? Without more information, I would suggest to close the issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21216 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20924] openssl init 100% CPU utilization on Windows
STINNER Victor added the comment: Please also report the Windows version you are using. I don't see the answer to this question -- title: openssl init 100% CPU utilization - openssl init 100% CPU utilization on Windows ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20924 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Shankar Unni added the comment: If you want to modify time.sleep(), you must be careful of the portability: Windows, Linux, but also Mac OS X, FreeBSD, Solaris, etc. Oh, I totally agree. What I'm trying to do is to define another autoconf flag (HAVE_CLOCK_NANOSLEEP), that does a feature test and enable that flag, and just use that if available. Now that's a good point that if we have clock_nanosleep() on another platform (non-Linux) and it does the wrong thing, then I might have to add further discrimination. For now, one sticking point that I've stumbled across is that clock_nanosleep() requires -lrt. Complicates the autoconf check a bit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21302 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21090] File read silently stops after EIO I/O error
STINNER Victor added the comment: @ivank: Can you please answer to questions? It's hard to understand the issue. Without more information, I would suggest to close the issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21090 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21356] Support LibreSSL (instead of OpenSSL): make RAND_egd optional
Changes by STINNER Victor victor.stin...@gmail.com: -- title: LibreSSL/RAND_egd fix needed. - Support LibreSSL (instead of OpenSSL): make RAND_egd optional ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21356 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21351] refcounts not respected at process exit
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21351 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17552] Add a new socket.sendfile() method
Changes by STINNER Victor victor.stin...@gmail.com: -- title: socket.sendfile() - Add a new socket.sendfile() method ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17552 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21350] bug in file.writelines accepting buffers
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21350 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21225] io.py: Improve docstrings for classes
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21225 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
STINNER Victor added the comment: 2014-04-27 2:26 GMT+02:00 Shankar Unni rep...@bugs.python.org: If you want to modify time.sleep(), you must be careful of the portability: Windows, Linux, but also Mac OS X, FreeBSD, Solaris, etc. Oh, I totally agree. What I'm trying to do is to define another autoconf flag (HAVE_CLOCK_NANOSLEEP), that does a feature test and enable that flag, and just use that if available. I'm talking about the expected behaviour which can be found in the documentation of the function: https://docs.python.org/dev/library/time.html#time.sleep -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21302 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21351] refcounts not respected at process exit
Tim Peters added the comment: After more thought, I don't think the user can do anything to influence finalization order in cases like this, short of adding del statements (or moral equivalents) to break cycles before the interpreter shuts down. Fine by me ;-) Something CPython could do, when collecting cyclic trash, is pick on objects with the smallest refcount first. That would most often mimic the finalization-order effects of the old bind-module-globals-to-None hack. But it would require more code and more expense to impose a partial order, and would still be an implementation detail specific to CPython (the implementation, as opposed to Python the language). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21351 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21090] File read silently stops after EIO I/O error
ivank added the comment: I'm finding it hard to reproduce the bug again with more zpool corruption. (I see the `IOError: [Errno 5] Input/output error` exception now.) I do remember that in the reported case, Python 3.4, node.js, and OpenJDK 7 threw an EIO exception, but Python 2.7 did not. I tested this multiple times. Right now I can only speculate that Python 2.7 silently stops reading only in certain cases, e.g. depending on how Python's reads are aligned with the first byte that causes EIO. I'm still working on getting it reproduced, please hold off on closing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21090 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9850] obsolete macpath module dangerously broken and should be removed
Jessica McKellar added the comment: Thanks for writing up this issue, ned.deily, and thanks for providing a patch, chortos. I couldn't find documentation clearly specifying what the correct behavior of macpath.join should be (i.e. what are the exact rules for leading and trailing colons), but comparing the old and updated behavior against the new tests, this patch does make the function's behavior more consistent. * The patch passes `make patchcheck`. * The full test suite passes with this patch. = commit review -- keywords: +needs review nosy: +jesstess stage: needs patch - commit review versions: +Python 2.7, Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9850 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21361] Add how to run a single test case to the devguide
New submission from Jessica McKellar: I had wanted to run a single TestCase, or single TestCase test method, and saw that how to do this wasn't in the devguide. Pattern-matching from the other rules doesn't work (for now, you have to use unittest instead of test), and asking on IRC, many people didn't know it was possible. :) This patch adds documentation on how to run a single TestCase. I visually inspected the built HTML to confirm that it looks as desired. -- components: Devguide files: devguide.diff keywords: easy, needs review, patch messages: 217239 nosy: ezio.melotti, jesstess priority: normal severity: normal stage: patch review status: open title: Add how to run a single test case to the devguide type: enhancement Added file: http://bugs.python.org/file35048/devguide.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21361 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com