[issue28629] Emit ResourceWarning when implicitly terminating a suspended frame?

2016-11-06 Thread Nathaniel Smith
Nathaniel Smith added the comment: +1 to the change for generators. This is actually in the PEP 533 draft: https://www.python.org/dev/peps/pep-0533/#modifications-to-basic-iterator-types For coroutines, doesn't this overlap with the existing "coroutine not awaited" warning? --

[issue28398] Return singleton empty string in _PyUnicode_FromASCII

2016-11-06 Thread Xiang Zhang
Xiang Zhang added the comment: IMHO, _PyUnicode_FromASCII is a private API and could be used in other places in future. We should not rely on the caller to check and return the singleton empty string. -- ___ Python tracker

[issue28623] Let `shlex.quote` accept a `PathLike` object

2016-11-06 Thread R. David Murray
R. David Murray added the comment: Which IMO is correct. shlex.quote takes an arbitrary string, not a filename. I'm -1 on this proposal. -- nosy: +r.david.murray ___ Python tracker

[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset b26c8104e54f by Steve Dower in branch '3.6': Closes #27781: Removes special cases for the experimental aspect of PEP 529 https://hg.python.org/cpython/rev/b26c8104e54f New changeset b8233c779ff7 by Steve Dower in branch 'default': Closes #27781:

[issue28629] Emit ResourceWarning when implicitly terminating a suspended frame?

2016-11-06 Thread Nick Coghlan
New submission from Nick Coghlan: There have been a few discussions recently regarding the fact that generator and coroutine cleanup can suppress ResourceWarnings from other components. For example: def mygen(fname): with open(fname) as f: yield from f

[issue28628] Failure to add signal handlers for any signal but SIGINT

2016-11-06 Thread Guido van Rossum
Guido van Rossum added the comment: Hm... We've seen this exact same crash reported several times before, and it was closed without a fix AFAICT each time. - https://github.com/python/asyncio/issues/396 - http://bugs.python.org/issue23548 IIUC the conclusion in the latter was that this is due

[issue28622] Remove redundant variable annotation test from test_grammar

2016-11-06 Thread Guido van Rossum
Changes by Guido van Rossum : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue28622] Remove redundant variable annotation test from test_grammar

2016-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 048f82c86928 by Guido van Rossum in branch '3.6': issue #28622: Remove redundant variable annotation test from test_grammar. Ivan L. https://hg.python.org/cpython/rev/048f82c86928 New changeset e60c1aef639a by Guido van Rossum in branch 'default':

[issue28628] Failure to add signal handlers for any signal but SIGINT

2016-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- title: Failure to add -> Failure to add signal handlers for any signal but SIGINT ___ Python tracker ___

[issue28628] Failure to add

2016-11-06 Thread brotherBox
New submission from brotherBox: This is the first bug that I file, so please bear with me here. I was advised to file this after running into a strange situation with asyncio 3.4.3. Adding signal handlers for any other signal but SIGINT throws strange exceptions. The attached source code

[issue28609] argparse claims '*' positional argument is required in error output

2016-11-06 Thread paul j3
paul j3 added the comment: My suggestion to use `metavar=('A','')` to streamline the usage creates problems with the help code http://bugs.python.org/issue14074 The tuple metavar does not work right for positionals. That's a old issue that should have been fixed long ago. So streamlining

[issue28609] argparse claims '*' positional argument is required in error output

2016-11-06 Thread paul j3
paul j3 added the comment: Simply including a `default` parameter, even with the default default None, changes the error message In [395]: parser=argparse.ArgumentParser() In [396]: parser.add_argument('cmd'); In [397]: a=parser.add_argument('args',nargs='*',default=None)

[issue24658] open().write() fails on 2 GB+ data (OS X)

2016-11-06 Thread Harry Li
Changes by Harry Li : -- nosy: +Harry Li ___ Python tracker ___ ___ Python-bugs-list

[issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks

2016-11-06 Thread Israel Fruchter
Israel Fruchter added the comment: the failure looks like that: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.5/shutil.py", line 359, in copytree raise Error(errors) shutil.Error: [('/bug/broken', '/temp/broken', "[Errno 95] Not supported:

[issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks

2016-11-06 Thread Israel Fruchter
New submission from Israel Fruchter: this fails on python3.5-alpine and python3.6-alpine (works as fine in python2.7-alpine) cd /bug && ln -s /broken_path/to_nowhere broken python -c "import shutil; shutil.copytree('/bug', '/temp', symlinks=True)" Dockerfile example here:

[issue28563] Arbitrary code execution in gettext.c2py

2016-11-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka stage: -> patch review ___ Python tracker ___

[issue28586] Convert os.scandir to Argument Clinic

2016-11-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue25996] Add support of file descriptor in os.scandir()

2016-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch adds support for file descriptors in os.scandir() and implements os.fwalk() with os.scandir(). The effect of using os.scandir() in os.fwalk(): $ ./python -m timeit -n1 -r5 -s 'import os' -- 'list(os.walk("/usr/lib"))' 1 loop, best of 5: 934

[issue28587] list.index documentation missing start and stop arguments

2016-11-06 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Here is an updated patch. Please review :) Thanks. -- Added file: http://bugs.python.org/file45376/issue28587v3.patch ___ Python tracker

[issue10605] ElementTree documentation

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: I don't see an 'entity' argument or attribute for TreeBuilder either. XMLParser has a .entity attribute, though. Perhaps this was simple confusion? Adrian: please feel free to re-open and provide a patch if there's actually a bug here. -- nosy:

[issue9621] Graphviz output for 2to3 fixer patterns

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: Matt, do you just want to drop the issue or provide a new patch? Your code might well still be useful, but it's been 6 years, so you may not even have the code any longer. -- nosy: +akuchling ___ Python tracker

[issue11368] Document why xml.etree.ElementTree.Element has no reference to parent

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: Closing this old issue. -- nosy: +akuchling status: open -> closed ___ Python tracker ___

[issue4713] Installing sgmlop causes xmlrpclib error

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: I don't believe this bug is still present in Python 2.7. Issue #5767 removed sgmlop support from xmlrpclib in 2.7 alpha 1, and trying the test program succeeds. Closing. -- nosy: +akuchling resolution: -> works for me status: open -> closed

[issue28609] argparse claims '*' positional argument is required in error output

2016-11-06 Thread Reuben Thomas
Reuben Thomas added the comment: > Try `nargs='?'` or try providing a `default` along with the '*'. Why would I do that? I want 0 or more arguments, and there's no default value. > Including your ARGUMENT action in the error message is intentional. It will likely confuse the user. The syntax

[issue1778] SyntaxError.offset sometimes wrong

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: Fixed in Python 3.2 alpha 3, so there's no longer any work to be done for this issue. Closing. -- nosy: +akuchling resolution: -> fixed status: open -> closed ___ Python tracker

[issue28609] argparse claims '*' positional argument is required in error output

2016-11-06 Thread paul j3
paul j3 added the comment: Try `nargs='?'` or try providing a `default` along with the '*'. Including your ARGUMENT action in the error message is intentional. The test for this error message is: required_actions = [] for action in self._actions: if action not in

[issue8840] truncate() semantics changed in 3.1.2

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: "Why, this is a simple docstring change. How difficult can it be?", I thought. Ah ha ha ha. Here's a patch against the 3.5 branch. It should also apply cleanly to 3.6 or 3.7, except for a little Argument Clinic noise. The patch changes 3 occurrences of the

[issue6519] Reorder 'with' statement for files in Python Tutorial

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: Good suggestion -- here's a patch that moves it and rewrites a little. -- nosy: +akuchling Added file: http://bugs.python.org/file45374/issue6519.txt ___ Python tracker

[issue26855] android: add platform.android_ver()

2016-11-06 Thread Xavier de Gaye
Xavier de Gaye added the comment: ANDROID_API_LEVEL can only be used in the Python test suite and platform.android_ver() must be used in the standard library. The reason why ANDROID_API_LEVEL can be used in the tests instead of using the runtime API level is that the Python test suite purpose

[issue28587] list.index documentation missing start and stop arguments

2016-11-06 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks for the feedback :) Makes sense, I'll work on another patch. -- ___ Python tracker ___

[issue28587] list.index documentation missing start and stop arguments

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: The patch looks fine, though I suggest clarifying the example for a.index(333, 2) by adding a comment such as '# begin searching at index 2' to explain what's going on. -- nosy: +akuchling ___ Python tracker

[issue21590] Systemtap and DTrace support

2016-11-06 Thread Berker Peksag
Berker Peksag added the comment: Thanks. SilentGhost. I went with ".. highlight:: shell-session" to simplify the patch a bit. Łukasz, can we close this one and create new issues for further improvements now? -- ___ Python tracker

[issue21590] Systemtap and DTrace support

2016-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset d05d312161f2 by Berker Peksag in branch '3.6': Issue #21590: Silence Sphinx warnings in instrumentation.rst https://hg.python.org/cpython/rev/d05d312161f2 New changeset 442453fa3370 by Berker Peksag in branch 'default': Issue #21590: Merge from 3.6

[issue28609] argparse claims '*' positional argument is required in error output

2016-11-06 Thread paul j3
paul j3 added the comment: The current error message is the result of http://bugs.python.org/issue10424 and http://bugs.python.org/issue12776 Before the test was just: if positionals: self.error(_('too few arguments')) The 2nd patch reworked the test to include the revised handling

[issue21864] Error in documentation of point 9.8 'Exceptions are classes too'

2016-11-06 Thread Berker Peksag
Berker Peksag added the comment: Thank you for the review, Andrew! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7 ___ Python tracker

[issue21864] Error in documentation of point 9.8 'Exceptions are classes too'

2016-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset db6d556365d7 by Berker Peksag in branch '3.5': Issue #21864: Remove outdated section about exceptions from the tutorial https://hg.python.org/cpython/rev/db6d556365d7 New changeset f82e348946e3 by Berker Peksag in branch '3.6': Issue #21864: Merge

[issue12913] Add a debugging howto

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: Éric Araujo: did you ever make any progress on this, such as producing a draft version? -- nosy: +akuchling ___ Python tracker

[issue28563] Arbitrary code execution in gettext.c2py

2016-11-06 Thread Xiang Zhang
Xiang Zhang added the comment: gettext_c2py_v2.patch implements a simple C expression parser. More tests are included. Carl, hope you are willing to test it. -- Added file: http://bugs.python.org/file45373/gettext_c2py_v2.patch ___ Python tracker

[issue21864] Error in documentation of point 9.8 'Exceptions are classes too'

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: The patch looks good to me; I think it should just be applied. -- nosy: +akuchling ___ Python tracker ___

[issue28626] Tutorial: rearrange discussion of output formatting to encourage f-strings

2016-11-06 Thread A.M. Kuchling
A.M. Kuchling added the comment: Oh, I didn't finish my thought on open questions: should we just drop the discussion of .ljust(), .zfill(), or should it be there so users are aware of it? Similarly, is it still worth mentioning string.Template? --

[issue28626] Tutorial: rearrange discussion of output formatting to encourage f-strings

2016-11-06 Thread A.M. Kuchling
New submission from A.M. Kuchling: The 'output formatting' section of the tutorial talks a lot about manual formatting with things like .rjust() and .zfill(), with only a passing reference to 3.6's new f-strings. The attached patch doesn't drop all of the old material, but it does rearrange

[issue19569] Use __attribute__((deprecated)) to warn usage of deprecated functions and macros

2016-11-06 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: _Pragma syntax would be more suitable since it could be used with macros: https://gcc.gnu.org/onlinedocs/gcc-6.2.0/cpp/Pragmas.html Then Include/pyport.h (which defines Py_DEPRECATED) could also define: #if defined(__GNUC__) && ((__GNUC__

[issue26934] android: test_faulthandler fails

2016-11-06 Thread STINNER Victor
STINNER Victor added the comment: Can you try to write a decorator to not suplicate the same long skipIf()? -- ___ Python tracker ___

[issue28590] fstring's '{' from escape sequences does not start an expression

2016-11-06 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks, Jason. I updated the PEP, so now I think the docs and PEP match the implementation. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue19569] Use __attribute__((deprecated)) to warn usage of deprecated functions and macros

2016-11-06 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: GCC supports pragmas to locally control warnings. https://gcc.gnu.org/onlinedocs/gcc-6.2.0/gcc/Diagnostic-Pragmas.html Example: __attribute__((__deprecated__)) int some_deprecated_function(void) {

[issue23996] _PyGen_FetchStopIterationValue() crashes on unnormalised exceptions

2016-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset bce18f5c0bc4 by Serhiy Storchaka in branch '3.5': Issue #23996: Added _PyGen_SetStopIterationValue for safe raising https://hg.python.org/cpython/rev/bce18f5c0bc4 New changeset a2c9f06ada28 by Serhiy Storchaka in branch '3.6': Issue #23996: Added

[issue21501] submitting mmap example for use in documentation

2016-11-06 Thread Guido van Rossum
Guido van Rossum added the comment: Can you say it in the form of a patch? -- nosy: +gvanrossum ___ Python tracker ___

[issue26855] android: add platform.android_ver()

2016-11-06 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: I see Xavier de Gaye uses sysconfig.get_config_var('ANDROID_API_LEVEL') is various patches. That's OK if the build-time target API level of CPython matches runtime Android API level. Does CPython force API level matching? If so this issue is no longer

[issue28625] multiprocessing.Pool.imap swallows exceptions thrown by generators

2016-11-06 Thread Elias Zamaria
New submission from Elias Zamaria: I have the following code: from multiprocessing import Pool def double(x): return 2 * x def get_numbers(): raise Exception("oops") yield 1 yield 2 print(list(Pool(processes=2).imap(double, get_numbers( I would expect it to raise an

[issue28590] fstring's '{' from escape sequences does not start an expression

2016-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1d8b8a67b657 by Jason R. Coombs in branch '3.6': Additionally show that a backslash-escaped opening brace is treated as a literal and thus triggers the single closing brace error, clarifying #28590. https://hg.python.org/cpython/rev/1d8b8a67b657

[issue28590] fstring's '{' from escape sequences does not start an expression

2016-11-06 Thread Jason R. Coombs
Jason R. Coombs added the comment: The reason that those test_no_escapes_for_braces assertions pass is because they're only dealing with opening curly braces and in an f-string, they're treated as literal opening braces. In the example you've given, the error occurs when the f-string handler

[issue26934] android: test_faulthandler fails

2016-11-06 Thread Xavier de Gaye
Xavier de Gaye added the comment: The problem: raise() does not cause the program to exit in a Python interactive session and a spawned Python process exits with 0. Android fixed this problem at API level 24 (Android 6.0 aka Marshmallow). The attached patch fixes this (tested at API levels 21

[issue28590] fstring's '{' from escape sequences does not start an expression

2016-11-06 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've got a patch ready for this and will be applying it shortly after we update the spec. -- assignee: docs@python -> jason.coombs nosy: +jason.coombs ___ Python tracker

[issue28398] Return singleton empty string in _PyUnicode_FromASCII

2016-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The case for size=0 often is handled before calling _PyUnicode_FromASCII. In what circumstances _PyUnicode_FromASCII is called with size=0? Is this case covered by tests? -- ___ Python tracker

[issue28147] Unbounded memory growth resizing split-table dicts

2016-11-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue28199] Compact dict resizing is doing too much work

2016-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Re-committed. It might be dangerous to commit this in 3.6 at that stage. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue28199] Compact dict resizing is doing too much work

2016-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 39f33c15243b by Serhiy Storchaka in branch 'default': Issue #28199: Microoptimized dict resizing. Based on patch by Naoki Inada. https://hg.python.org/cpython/rev/39f33c15243b -- ___ Python tracker

[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-11-06 Thread STINNER Victor
STINNER Victor added the comment: Sorry, I didn't have time to review this issue :-( Thanks Xiang and Serhiy for fixing the issue! I prefer the new API (don't ignore the error). -- ___ Python tracker

[issue28543] Incomplete fast path codecs aliases in codecs doc

2016-11-06 Thread Berker Peksag
Berker Peksag added the comment: This is a duplicate of issue 28393. -- nosy: +berker.peksag resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Update encoding lookup docs wrt #27938 type: enhancement -> behavior

[issue28624] Make the `cwd` argument to `subprocess.Popen` accept a `PathLike`

2016-11-06 Thread Ram Rachum
Changes by Ram Rachum : -- components: Library (Lib) nosy: cool-RR priority: normal severity: normal status: open title: Make the `cwd` argument to `subprocess.Popen` accept a `PathLike` versions: Python 3.7 ___ Python tracker

[issue28624] Make the `cwd` argument to `subprocess.Popen` accept a `PathLike`

2016-11-06 Thread Ram Rachum
Changes by Ram Rachum : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list

[issue28586] Convert os.scandir to Argument Clinic

2016-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0590b9c5a18e by Serhiy Storchaka in branch 'default': Issue #28586: Converted os.scandir() to Argument Clinic. https://hg.python.org/cpython/rev/0590b9c5a18e -- nosy: +python-dev ___ Python tracker

[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-11-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset d06a6b0fd992 by Serhiy Storchaka in branch '3.6': Issue #28123: _PyDict_GetItem_KnownHash() now can raise an exception as https://hg.python.org/cpython/rev/d06a6b0fd992 New changeset 805467de22fc by Serhiy Storchaka in branch 'default': Issue

[issue19569] Use __attribute__((deprecated)) to warn usage of deprecated functions and macros

2016-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated documentation. This part should be backported to all maintained 3.x versions. -- Added file: http://bugs.python.org/file45370/mark-deprecated-functions-2.patch ___ Python tracker

[issue28623] Let `shlex.quote` accept a `PathLike` object

2016-11-06 Thread Ram Rachum
New submission from Ram Rachum: Currently it complains that you haven't fed it a string-like object. -- components: Library (Lib) messages: 280133 nosy: cool-RR priority: normal severity: normal status: open title: Let `shlex.quote` accept a `PathLike` object type: enhancement versions:

[issue28622] Remove redundant variable annotation test from test_grammar

2016-11-06 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi: This will remove one test from test_grammar that depends on typing module API (this test case is already covered in test_typing). -- components: Tests files: test-grammar-patch.diff keywords: patch messages: 280132 nosy: gvanrossum, levkivskyi

[issue28621] Refactor duplicate code calculating digit's bit length

2016-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- nosy: +serhiy.storchaka stage: patch review -> commit review ___ Python tracker ___