[issue18967] Find a less conflict prone approach to Misc/NEWS

2016-10-06 Thread Nick Coghlan
Nick Coghlan added the comment: I came across OpenStack's tool for this problem today: http://docs.openstack.org/developer/reno/design.html I think it's significantly more complex than we need for CPython, but also still interesting as a point of reference. It's already mentioned in PEP 512,

[issue18789] XML Vunerability Table Unclear

2016-10-06 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Hi, here is the patch. I followed Raymond's suggestion to use 'vulnerable' or 'safe' instead of the original 'True' or 'False'. Please check it out. Thanks :) -- keywords: +patch Added file: http://bugs.python.org/file44994/issue18789.patch

[issue28383] __hash__ documentation recommends naive XOR to combine but this is suboptimal

2016-10-06 Thread Kevin Norris
New submission from Kevin Norris: The documentation for __hash__ contains this text: "The only required property is that objects which compare equal have the same hash value; it is advised to somehow mix together (e.g. using exclusive or) the hash values for the components of the object that

[issue26171] heap overflow in zipimporter module

2016-10-06 Thread Parvesh jain
Parvesh jain added the comment: I think patches put up in http://bugs.python.org/msg258736 is at least not sufficient enough for Python 2.7. POC script(crash.py) provided with the issue calls get_data with data_size = -1. I am using Python 2.7.8 . I patched the same with the solution provided

[issue26081] Implement asyncio Future in C to improve performance

2016-10-06 Thread INADA Naoki
INADA Naoki added the comment: fixed -- Added file: http://bugs.python.org/file44993/fastfuture2.patch ___ Python tracker ___

[issue28199] Compact dict resizing is doing too much work

2016-10-06 Thread INADA Naoki
INADA Naoki added the comment: Since entries array is embedded in PyDictKeysObject, we can't realloc entries. And while values are split array, dictresize() convert split table into combine table. Split table may have enough size of ma_values at first in typical case. And in not typical case,

[issue21443] asyncio logging documentation clarifications

2016-10-06 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Hi, I added the paragraph explaining how to change the log level for asyncio. Please check it out. Thanks :) -- keywords: +patch nosy: +Mariatta Added file: http://bugs.python.org/file44992/issue21443.patch ___

[issue26081] Implement asyncio Future in C to improve performance

2016-10-06 Thread INADA Naoki
INADA Naoki added the comment: FutureIter_throw is wrong, maybe. Removing FutureIter_send and FutureIter_throw from FutureIter_methods solves the segv and test passed. -- ___ Python tracker

[issue28199] Compact dict resizing is doing too much work

2016-10-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: For the simple case with no dummy entries, I was expecting a fast path that just realloced the keys/values/hashes arrays and then updated the index table with reinsertion logic that only touches the indices. Use realloc() is nice because it makes it

[issue28381] Add a "starcaller" function

2016-10-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: This was discussed on Python-Ideas back in July: https://mail.python.org/pipermail/python-ideas/2016-July/041153.html I don't recall any opposition, although Nick suggested that possibly a better idea was to resurrect the `apply` built-in into functools:

[issue28382] Possible deadlock after many multiprocessing.Process are launch

2016-10-06 Thread Alexis
New submission from Alexis: I am launching a process inside a pool worker, using the multiprocessing module. After a while, a deadlock append when I am trying to join the process. Here is a simple version of the code: import sys, time, multiprocessing from multiprocessing.pool import

[issue28206] signal.Signals not documented

2016-10-06 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue28381] Add a "starcaller" function

2016-10-06 Thread Ned Deily
Changes by Ned Deily : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list

[issue28381] Add a "starcaller" function

2016-10-06 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Hi Josh, I think python ideas mailing list might have been a better venue for this. https://mail.python.org/mailman/listinfo/python-ideas -- nosy: +Mariatta ___ Python tracker

[issue27972] Confusing error during cyclic yield

2016-10-06 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe it could be fixed rather than making this a checked failure? -- ___ Python tracker ___

[issue27972] Confusing error during cyclic yield

2016-10-06 Thread Yury Selivanov
Yury Selivanov added the comment: > Is that enough? What if the recursion involves several tasks waiting for each other in a cycle? I'm not sure... Maybe it's OK when two tasks await on each other, I think the current Task implementation should be able to handle that. The problem with the

[issue27972] Confusing error during cyclic yield

2016-10-06 Thread Yury Selivanov
Yury Selivanov added the comment: > It's pretty perverse. But how would you detect this case? In Task._step, we can check if the future the task is about to await on is "self". -- ___ Python tracker

[issue27972] Confusing error during cyclic yield

2016-10-06 Thread Guido van Rossum
Guido van Rossum added the comment: Is that enough? What if the recursion involves several tasks waiting for each other in a cycle? -- ___ Python tracker

[issue27972] Confusing error during cyclic yield

2016-10-06 Thread Guido van Rossum
Guido van Rossum added the comment: It's pretty perverse. But how would you detect this case? Does it require changes to CPython or only to asyncio? Does it require a spec change anywhere? -- ___ Python tracker

[issue28380] Mock functions with autospec don't support assert_called_once, assert_called, assert_not_called

2016-10-06 Thread Gregory P. Smith
Gregory P. Smith added the comment: thanks! I didn't apply the fix to 3.5 (or earlier - those are closed) as it could arguably be seen as adding a new API and there are valid workarounds by asserting on the list of calls directly. -- resolution: -> fixed stage: -> commit review

[issue28380] Mock functions with autospec don't support assert_called_once, assert_called, assert_not_called

2016-10-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4e39b4e57673 by Gregory P. Smith in branch '3.6': Fixes issue28380: unittest.mock Mock autospec functions now properly support https://hg.python.org/cpython/rev/4e39b4e57673 New changeset fca5c4a63251 by Gregory P. Smith in branch 'default': Issue

[issue28381] Add a "starcaller" function

2016-10-06 Thread Josh Rosenberg
New submission from Josh Rosenberg: Not sure if this is the right venue to propose this, but I'd like to propose adding a starcaller method to the standard library, either functools or operator (not sure if the proposal is more like partial or more like methodcaller). Basically, right now,

[issue28380] Mock functions with autospec don't support assert_called_once, assert_called, assert_not_called

2016-10-06 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- assignee: -> gregory.p.smith nosy: +gregory.p.smith ___ Python tracker ___

[issue28365] IDLE: don't offer to save text files as .py

2016-10-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: PS. A.J., you will likely be a happier user if you make a subdirectory under c:/Users/angie and put your files there instead of in the installation directory under the hidden AppDate -- ___ Python tracker

[issue28365] IDLE: don't offer to save text files as .py

2016-10-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am closing this as a duplicate of existing #21140, to make .txt instead of .py the extension for files known not to be code files. I There is an existing simple patch. I will modify it to not even offer .py as a secondary choice. The reason Paul had to

[issue21140] Idle: saving Shell or an OutputWindow should default to .txt

2016-10-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: A more drastic change would be to refuse to save OutputWindow and Shell as .py(w,o) files. #28365 is about a beginner who apparently save a short Shell session as .py, quit IDLE, loaded the saved session in an editor, and tried to run it. --

[issue28380] Mock functions with autospec don't support assert_called_once, assert_called, assert_not_called

2016-10-06 Thread Yannick Brehon
New submission from Yannick Brehon: If one defines a mock for a function, using autospec=True, then the mock will correctly support assert_called_once_with(), among others, but not assert_called_once, assert_called, and assert_not_called. The attached file contains a fix for the issue.

[issue18789] XML Vunerability Table Unclear

2016-10-06 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: I'll work on this :) -- ___ Python tracker ___ ___ Python-bugs-list

[issue18789] XML Vunerability Table Unclear

2016-10-06 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue26081] Implement asyncio Future in C to improve performance

2016-10-06 Thread Yury Selivanov
Yury Selivanov added the comment: INADA, would you be able to take a look? -- ___ Python tracker ___ ___

[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added comments on Rietveld. I don't know whether tests for this function are needed. It is public, but is not a part of stable API. -- ___ Python tracker

[issue26081] Implement asyncio Future in C to improve performance

2016-10-06 Thread Yury Selivanov
Yury Selivanov added the comment: The most recent patch segfaults... Will try to debug. -- ___ Python tracker ___

[issue27972] Confusing error during cyclic yield

2016-10-06 Thread Yury Selivanov
Yury Selivanov added the comment: This is an interesting mind twister. The key problem is that `self.runner_task` is blocked on *itself*: so Task._fut_waiter is set to the Task. Therefore when the task is being cancelled, `Task.cancel` simply recurses. One way to solve this is to prohibit

[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-06 Thread Xiang Zhang
Changes by Xiang Zhang : Added file: http://bugs.python.org/file44990/PyUnicode_CopyCharacters.patch ___ Python tracker ___

[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-06 Thread Xiang Zhang
Changes by Xiang Zhang : Removed file: http://bugs.python.org/file44989/PyUnicode_CopyCharacters.patch ___ Python tracker ___

[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-06 Thread Xiang Zhang
New submission from Xiang Zhang: Currently PyUnicode_CopyCharacters doesn't check arguments thoroughly. This could lead to undefined behaviour or crash in debug mode. For example, from_start > len(from), how_many < 0. Another case is that when how_many > len(from), it will choose len(from)

[issue27392] Add a server_side keyword parameter to create_connection

2016-10-06 Thread Yury Selivanov
Yury Selivanov added the comment: AFAICT this issue was resolved in https://github.com/python/asyncio/pull/378. Closing this one. Thanks, Jim! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue27759] selectors incorrectly retain invalid file descriptors

2016-10-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8cc1fca83fb8 by Yury Selivanov in branch '3.4': Issue #27759: Fix selectors incorrectly retain invalid file descriptors. https://hg.python.org/cpython/rev/8cc1fca83fb8 -- ___ Python tracker

[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-10-06 Thread Yury Selivanov
Yury Selivanov added the comment: Alright, I've backported the fix to 3.4. Closing this. -- stage: -> resolved status: open -> closed ___ Python tracker

[issue28365] idle forgets that saved console session is not a python file after restart

2016-10-06 Thread A.J.
A.J. added the comment: There is no other way to explain it without fail every time no matter what code I write there is always syntax error highlighted on the five in the version banner. -- Added file: http://bugs.python.org/file44988/2016-10-06 (4).png

[issue28376] rangeiter_new fails when creating a range of step 0

2016-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good point Naoki. I think we can remove tp_new method from range_iterator in 3.7. Seems it is never used. The patch LGTM for 3.5-3.6, but the test should be marked as CPython implementation detail (@support.cpython_only). --

[issue27859] argparse - subparsers does not retain namespace

2016-10-06 Thread Ned Deily
Changes by Ned Deily : -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> argparse set_defaults on subcommands should override top level set_defaults ___ Python tracker

[issue28355] wsgiref simple_server PATH_INFO treats slashes and %2F the same

2016-10-06 Thread Ned Deily
Changes by Ned Deily : -- nosy: +pje ___ Python tracker ___ ___ Python-bugs-list mailing

[issue28378] urllib2 does not handle cookies with `,`

2016-10-06 Thread Grzegorz Sikorski
New submission from Grzegorz Sikorski: I have a usecase when the server sends two cookies in separate `Set-Cookie` headers. One of the cookie includes a `,` (comma). It seems this is not handled properly, as the library always try to fold multiple headers with the same name into a single

[issue28377] struct.unpack of Bool

2016-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maybe this is a duplicate of issue22012. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue28376] rangeiter_new fails when creating a range of step 0

2016-10-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka versions: +Python 3.5, Python 3.6 ___ Python tracker ___

[issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly

2016-10-06 Thread Adam Bartoš
Adam Bartoš added the comment: The main reason I have extended the support of win_unicode_console to Python 2.7 was that the related issues won't be fixed there, so using win_unicode_console may fix this as well. -- ___ Python tracker

[issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly

2016-10-06 Thread Eryk Sun
Eryk Sun added the comment: Switching to ReadConsoleW in 3.6+ solves the problem with not seeing ERROR_OPERATION_ABORTED in Windows 8+, and with proper handling this potentially solves issues with Ctrl+C handling (when I last checked there were still bugs with this in the 3.6 beta). However,

[issue28377] struct.unpack of Bool

2016-10-06 Thread Weihong Guan
New submission from Weihong Guan: According to the doc: For the '?' format character, the return value is either True or False. When packing, the truth value of the argument object is used. Either 0 or 1 in the native or standard bool representation will be packed, and any non-zero value

[issue10716] Modernize pydoc to use better HTML and separate CSS

2016-10-06 Thread R. David Murray
R. David Murray added the comment: My memory of the thread (I haven't gone back and checked) was that the thought was to drop html output altogether because the sphinx docs were more useful for anyone wanting to use html, and network connectivity was so universal in this day and age that

[issue28374] SyntaxError: invalid token in python2.7/test/test_grammar.py

2016-10-06 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report! How did you run the test? I think there is something wrong with your installation (or you probably ran the test with the system Python.) $ ./python -m test.regrtest test_grammar [1/1] test_grammar 1 test OK. [48645 refs]

[issue28376] rangeiter_new fails when creating a range of step 0

2016-10-06 Thread INADA Naoki
INADA Naoki added the comment: patch is LGTM. But there is one hidden inconsistency: >>> r = range(2**100) >>> type(iter(r)) >>> type(iter(r))(1, 1, 0) Traceback (most recent call last): File "", line 1, in TypeError: cannot create 'longrange_iterator' instances Should we have same tp_new

[issue28376] rangeiter_new fails when creating a range of step 0

2016-10-06 Thread Emanuel Barry
Emanuel Barry added the comment: I'm not able to trigger an assertion error when running the latest trunk in debug mode. I get a "valid" range_iterator object though, and using __reduce__ gives me direct access to `range(0, 0, 0)` (which is completely worthless). Error or not, this should be

[issue28376] assertion failure in rangeobject.c

2016-10-06 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch Added file: http://bugs.python.org/file44986/issue28376_ver1.diff ___ Python tracker ___

[issue28376] assertion failure in rangeobject.c

2016-10-06 Thread Oren Milman
Changes by Oren Milman : Added file: http://bugs.python.org/file44985/patchedCPythonTestOutput_ver1.txt ___ Python tracker ___

[issue28375] cgi.py spam in Apache server logs

2016-10-06 Thread Sebastian Rittau
New submission from Sebastian Rittau: I am using cgi.py in WSGI applications, using Apache and mod_wsgi. Unfortunately cgi.py keeps spamming the error log with messages like the following: Exception ignored in: Traceback (most recent call last): File "/usr/lib/python3.5/cgi.py", line 566,

[issue28376] assertion failure in rangeobject.c

2016-10-06 Thread Oren Milman
New submission from Oren Milman: current state An assertion in Objects/rangeobject.c might fail: >>> type(iter(range(0))) >>> type(iter(range(0)))(1, 1, 0) Assertion failed: step != 0, file ..\Objects\rangeobject.c, line 895 This is caused by the lack

[issue27231] Support the fspath protocol in the posixpath module

2016-10-06 Thread Berker Peksag
Berker Peksag added the comment: It looks like the fspath protocol support has already been implemented in b64f83d6ff24. -- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed type: -> enhancement ___ Python

[issue27232] os.fspath() should not use repr() on error

2016-10-06 Thread Berker Peksag
Berker Peksag added the comment: This has already been fixed in ea7b6a7827a4: >>> import os >>> os.fspath(None) Traceback (most recent call last): File "", line 1, in TypeError: expected str, bytes or os.PathLike object, not NoneType -- nosy: +berker.peksag

[issue26964] Incorrect documentation for `-u`-flag

2016-10-06 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag stage: -> patch review type: -> behavior versions: +Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-06 Thread Adam Bartoš
Adam Bartoš added the comment: Other related issues are #1927 and #24829. -- ___ Python tracker ___ ___

[issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly

2016-10-06 Thread Adam Bartoš
Adam Bartoš added the comment: Maybe this was fixed with the recent fix of #1602. -- ___ Python tracker ___

[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-06 Thread Adam Bartoš
Adam Bartoš added the comment: A related issue is that the REPL doesn't use sys.stdin for input, see #17620. Another related issue is #28333. I think that the situation around stdio in Python is complicated an inflexible (by stdio I mean all the interactions between REPL, input(), print(),

[issue28374] SyntaxError: invalid token in python2.7/test/test_grammar.py

2016-10-06 Thread Jan Welker
New submission from Jan Welker: I compiled Python 2.7.12 from source and ran the tests unsuccessful. Compiling /usr/lib/python2.7/test/test_grammar.py ... File "/usr/lib/python2.7/test/test_grammar.py", line 80 self.assertEqual(1 if 1else 0, 1) ^ SyntaxError:

[issue28199] Compact dict resizing is doing too much work

2016-10-06 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file44983/dictresize3.patch ___ Python tracker ___

[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-06 Thread Arnon Yaari
New submission from Arnon Yaari: When I wrap sys.stdout with a custom object that overrides the 'write' method, regular prints use the custom write method, but the input() function prints the prompt to the original stdout. This is broken on Python 3.5. Earlier versions work correctly. In the

[issue24454] Improve the usability of the match object named group API

2016-10-06 Thread irdb
Changes by irdb : -- nosy: +irdb ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2016-10-06 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch with tests. Needed to test it on Windows. -- stage: -> patch review ___ Python tracker ___

[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch Added file: http://bugs.python.org/file44982/fwalk_oserror.patch ___ Python tracker

[issue28201] dict: perturb shift should be done when first conflict

2016-10-06 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue28201] dict: perturb shift should be done when first conflict

2016-10-06 Thread INADA Naoki
INADA Naoki added the comment: Thank you, Tim and Serhiy. My first commit has been pushed now! Serhiy: Since I prefer putting variable declaration near it's usage, and PEP 7 permits it since Python 3.6. -- ___ Python tracker

[issue28201] dict: perturb shift should be done when first conflict

2016-10-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset cf2778fd7acb by INADA Naoki in branch '3.6': Issue #28201: Dict reduces possibility of 2nd conflict in hash table. https://hg.python.org/cpython/rev/cf2778fd7acb New changeset 80b01cd94a63 by INADA Naoki in branch 'default': Issue #28201: Dict

[issue28201] dict: perturb shift should be done when first conflict

2016-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. But why you moved the declaration of perturb? -- ___ Python tracker ___