[issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules

2018-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: As a concrete proposal for 3.8, how about: 1. Add the following utility functions to importlib.util (names adjusted to match PEP 451 rather than my initial suggestions above): def get_location(module): try: return

[issue33318] Move folding tuples of constants into compiler.c from peephole.c

2018-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: If I recall Eugene Toder's previous AST-level compilation patches correctly, they handle this problem by putting the AST optimisation step *after* the output of the Py_CF_ONLY_AST step. This meant that if you're running the source->AST step

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread Nick Coghlan
Change by Nick Coghlan : -- assignee: -> paul.moore resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33309] Unittest Mock objects do not freeze arguments they are called with

2018-04-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +ezio.melotti, michael.foord, rbcollins ___ Python tracker ___

[issue33303] ElementTree Comment text isn't escaped

2018-04-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: -Python 3.4, Python 3.5 ___ Python tracker ___

[issue33289] tkinter askcolor returning floats for r, g, b values instead of ints

2018-04-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: For future reference, 3.4 and 3.5 only get security fixes. The quoted line of code is from the main part of tkinter.colorchooser,Chooser._fixresult: r, g, b = widget.winfo_rgb(result) return (r/256, g/256, b/256), str(result)

[issue33284] Increase test coverage for numbers.py

2018-04-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- stage: patch review -> needs patch type: -> enhancement ___ Python tracker ___

[issue33284] Increase test coverage for numbers.py

2018-04-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Barry, thank you for your first submission. You propose to test numbers.Complex.__bool__ def __bool__(self): """True if self != 0. Called for bool(self).""" return self != 0 by adding the following to

[issue33274] minidom removeAttributeNode returns None

2018-04-20 Thread Ari Krupnik
Ari Krupnik added the comment: I guess the main question if whether minidom wants to adhere to the standard or be pythonic, and it's not up to me to decide, although personally I like standards. The common use case for DOM functions returning the relevant nodes is for the

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: How about adding a sentence to the end of the first paragraph. glob.glob(pathname, *, recursive=False) Return a possibly-empty list of path names that match pathname, which must be a string containing a path specification. pathname can

[issue33274] minidom removeAttributeNode returns None

2018-04-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: It is standard in the Python stdlib that mutation methods usually return None and never echo an input argument. If one can pass a node to element.removeAttributeNode(node), there is no need to echo it back. So I suspect that the current

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: Sorry for the breakage. I'm glad the fix was that greppable and easy given I had no idea where to start otherwise. :) This is in for 3.7. The PR for 3.6 is pending, i want to let it out in the next 3.7 builds for a while before i merge

[issue33321] Add a Linux clang ubsan undefined behavior sanitizer buildbot

2018-04-20 Thread Gregory P. Smith
New submission from Gregory P. Smith : CPython needs to be regularly built and vetted for C undefined behavior. CFLAGS=-fsanitize=undefined LDFLAGS=-fsanitize=undefined CC=clang LD=clang ./configure is all it takes to start with. if you do this today, test_ctypes will knock

[issue33276] Clarify that __path__ can't be set to just anything

2018-04-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +6252 ___ Python tracker ___

[issue33276] Clarify that __path__ can't be set to just anything

2018-04-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +6253 ___ Python tracker ___

[issue33276] Clarify that __path__ can't be set to just anything

2018-04-20 Thread Brett Cannon
Change by Brett Cannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread miss-islington
miss-islington added the comment: New changeset 47d57bfd3d6ceb08f98fcff14fe3c8bb41ca0664 by Miss Islington (bot) in branch '3.6': bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546)

[issue33254] Have importlib.resources.contents() return an interable instead of an iterator

2018-04-20 Thread Brett Cannon
Change by Brett Cannon : -- title: importlib.resources.contents() incorrectly yields an empty list -> Have importlib.resources.contents() return an interable instead of an iterator ___ Python tracker

[issue991266] Cookie.py does not correctly quote Morsels

2018-04-20 Thread Berker Peksag
Change by Berker Peksag : -- pull_requests: +6251 ___ Python tracker ___ ___

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

2018-04-20 Thread Martin Panter
Martin Panter added the comment: This looks like it may be covered by Issue 31940, about the “shutil.copystat” API. See Anthony’s initial proposal at . Max: I think you need the “else” branch to reraise the exception if

[issue25427] Remove the pyvenv script in Python 3.8

2018-04-20 Thread Brett Cannon
Change by Brett Cannon : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue25427] Remove the pyvenv script in Python 3.8

2018-04-20 Thread Brett Cannon
Brett Cannon added the comment: New changeset a8c342465b977115b88a4f130833a2fd4c4e7356 by Brett Cannon in branch 'master': bpo-25427: Remove pyvenv (GH-5962) https://github.com/python/cpython/commit/a8c342465b977115b88a4f130833a2fd4c4e7356 --

[issue33276] Clarify that __path__ can't be set to just anything

2018-04-20 Thread Brett Cannon
Change by Brett Cannon : -- keywords: +patch pull_requests: +6250 stage: needs patch -> patch review ___ Python tracker ___

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread miss-islington
miss-islington added the comment: New changeset 4caba7a94024d8af2eed26300f13ff4433dcb05b by Miss Islington (bot) in branch '2.7': bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546)

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread miss-islington
miss-islington added the comment: New changeset b221107d32370670905fefb569b3104748f92afe by Miss Islington (bot) in branch '3.7': bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546)

[issue32886] new Boolean ABC in numbers module

2018-04-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: > If I get you correctly, then the minimal `Boolean` ABC would only need > to contain the `__bool__` method, without the bitwise operations Once reduced to just having `__bool__`, I think there is no value added and would

[issue33144] random._randbelow optimization

2018-04-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Ned Deily
Ned Deily added the comment: Thanks, Greg, looking better! -- ___ Python tracker ___ ___

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +6249 ___ Python tracker ___

[issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules

2018-04-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 from me. The visual clutter in dir() has proven to be somewhat distracting in introduction-to-python courses. -- nosy: +rhettinger ___ Python tracker

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread Ned Deily
Ned Deily added the comment: Since 2.7 was upgraded, I think 3.6.x should be upgraded to 10.0.x, as well. -- versions: +Python 2.7, Python 3.6 ___ Python tracker

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +6248 ___ Python tracker ___

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +6247 ___ Python tracker ___

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread Paul Moore
Paul Moore added the comment: New changeset 0399cf9b5e370516e3d0aed6a63ff74aff5eadb5 by Paul Moore in branch 'master': bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546) https://github.com/python/cpython/commit/0399cf9b5e370516e3d0aed6a63ff74aff5eadb5

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 11659d00b9185c8f02ea6b642fa475a80e21f1a9 by Gregory P. Smith (Miss Islington (bot)) in branch '3.7': bpo-33312: update Tools/gdb/libpython.py to match. (GH-6549)

[issue33318] Move folding tuples of constants into compiler.c from peephole.c

2018-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not convinced by this. One of the points of separating the optimizer from the compiler is that people wanting to study/extend the compiler don't have to filter through optimization-related routines. Separating initial code generation

[issue33318] Move folding tuples of constants into compiler.c from peephole.c

2018-04-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: +0 It looks like there is a small net win. Conceptually, constant folding is better done upstream where more semantic information is available (rather than downstream when the meaning has to be deduced from the opcodes). The

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +6246 ___ Python tracker ___

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 53f67d401df40486fd0fb8fbcf9da725cd37290c by Gregory P. Smith in branch 'master': bpo-33312: update Tools/gdb/libpython.py to match. (GH-6548) https://github.com/python/cpython/commit/53f67d401df40486fd0fb8fbcf9da725cd37290c

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: None of the actual classes outside of the typing module support this either to my knowledge. You can't do: from collections import deque a: deque[int] nor can you do: a: list[int] Adding Queue to the typing

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +6245 ___ Python tracker ___ ___

[issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe

2018-04-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: If the goal is just to suppress stdout, that's what passing subprocess.DEVNULL is for (doesn't exist in Py2, but opening os.devnull and passing that is a slightly higher overhead equivalent). subprocess.run includes a call to

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: I see one line in Tools/gdb/libpython.py that may be related. i'll try changing that. the only way i have to _test_ it is to merge it into master. -- ___ Python tracker

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: ned: yes, it supposedly has. test_gdb. in a manner i cannot reproduce or debug without error output that indicates anything about the problem. test_gdb passes on my systems. -- ___ Python

[issue21314] Document '/' in signatures

2018-04-20 Thread Jakub Wilk
Change by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 392520bd78cd18639a27e5d2803c2e1c2bd593a8 by Gregory P. Smith (Miss Islington (bot)) in branch '3.7': bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) (GH-6543)

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Ned Deily
Ned Deily added the comment: Greg, this change has broken some buildbots: http://buildbot.python.org/all/#/builders/85/builds/934 http://buildbot.python.org/all/#/builders/21/builds/951 -- nosy: +ned.deily ___ Python tracker

[issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules

2018-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: -1 from me for __package__, as setting that's the preferred way for directly executed scripts to fix their explicit relative imports (rather than trying to retroactively fix their spec). (https://docs.python.org/3/library/importlib.html

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: If you think this should be written differently, please propose it in a PR so we can see what you are suggesting. An unbounded member at the end of a struct is quite a common practice in C. ex: PyBytesObject --

[issue32232] building extensions as builtins is broken in 3.7

2018-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: Xavier's changes should fix the reported compile error, while keeping the increased isolation of the interpreter core from the optional extension modules. If the latter change causes a detectable performance regression, then I think that

[issue32232] building extensions as builtins is broken in 3.7

2018-04-20 Thread miss-islington
miss-islington added the comment: New changeset 18cd82815b9bdeabc5ac03aa7f58102109ccf368 by Miss Islington (bot) in branch '3.7': bpo-32232: by default, Setup modules are no longer built with -DPy_BUILD_CORE (GH-6489)

[issue33320] Clarify who can add the "skip issue" label on GitHub

2018-04-20 Thread Andrés Delfino
Change by Andrés Delfino : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32232] building extensions as builtins is broken in 3.7

2018-04-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +6244 ___ Python tracker ___

[issue32232] building extensions as builtins is broken in 3.7

2018-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 063db62aab4041ac47798e7e48b27b2f2bef21c5 by Nick Coghlan (xdegaye) in branch 'master': bpo-32232: by default, Setup modules are no longer built with -DPy_BUILD_CORE (GH-6489)

[issue33131] Upgrade to pip 10 for Python 3.7

2018-04-20 Thread Paul Moore
Change by Paul Moore : -- keywords: +patch pull_requests: +6243 stage: needs patch -> patch review ___ Python tracker ___

[issue32232] building extensions as builtins is broken in 3.7

2018-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: I also resolved my own puzzlement from the PR comments regarding why _weakrefs.c was fine with being built as a regular extension module: it's because the C level access API for __weakrefs__ is published through the regular C API, not as a

[issue32232] building extensions as builtins is broken in 3.7

2018-04-20 Thread Xavier de Gaye
Xavier de Gaye added the comment: To answer my own comment in PR 6489 about the interference of the pyconfig.h macros with the build of std lib extension modules, the py_config_macros.py script prints the list of pyconfig.h.in macros that are being used by the standard

[issue33320] Clarify who can add the "skip issue" label on GitHub

2018-04-20 Thread Andrés Delfino
Andrés Delfino added the comment: This is the PR: https://github.com/python/devguide/pull/359 -- ___ Python tracker ___

[issue33320] Clarify who can add the "skip issue" label on GitHub

2018-04-20 Thread Andrés Delfino
Change by Andrés Delfino : -- pull_requests: -6242 ___ Python tracker ___ ___

[issue33320] Clarify who can add the "skip issue" label on GitHub

2018-04-20 Thread Andrés Delfino
Change by Andrés Delfino : -- keywords: +patch pull_requests: +6242 stage: -> patch review ___ Python tracker ___

[issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO

2018-04-20 Thread Senthil Kumaran
Senthil Kumaran added the comment: Indeed. Thank you! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33320] Clarify who can add the "skip issue" label on GitHub

2018-04-20 Thread Andrés Delfino
New submission from Andrés Delfino : IMHO, the wording of https://devguide.python.org/pullrequest/ is somewhat confusing regarding the "skip issue" label. I thought that I (with no commit access) should add the label, but, as far I understand, that is a responsibility of

[issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO

2018-04-20 Thread Andrés Delfino
Andrés Delfino added the comment: I believe this issue can be closed, right? -- ___ Python tracker ___

[issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler.

2018-04-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33318] Move folding tuples of constants into compiler.c from peephole.c

2018-04-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6241 stage: -> patch review ___ Python tracker ___

[issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe

2018-04-20 Thread Pekka Klärck
Change by Pekka Klärck : -- assignee: -> docs@python components: +Documentation nosy: +docs@python ___ Python tracker ___

[issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe

2018-04-20 Thread Pekka Klärck
New submission from Pekka Klärck : I'm porting old scripts from Python 2.7 to 3.6 and plan to change `subprocess.call()` to `subprocess.run()` at the same time. When using `call()` I've used `tempfile.TemporaryFile` as stdout because it's documentation has this

[issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler.

2018-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d70c2a6894d80410b6f5a3129d6b1062ea8fd4e4 by Serhiy Storchaka in branch 'master': bpo-33298: Wrap only constants with _PyCode_ConstantKey() in the compiler. (GH-6512)

[issue33318] Move folding tuples of constants into compiler.c from peephole.c

2018-04-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Explicit tuples of constants are folded in the AST optimizer since 3.7. But peephole.c still contains the code for folding tuples of constants, because there are tuples created by the compiler. For example "[1, 2, *a]", "f(1,

[issue33317] `repr()` of string in NFC and NFD forms does not differ

2018-04-20 Thread Pekka Klärck
Pekka Klärck added the comment: Thanks for pointing out `ascii()`. Seems to do exactly what I want. `repr()` showing combining characters would, in my opinion, still be useful to avoid problems like I demonstrated with unittest and pytest. I doubt it's a good idea

[issue33317] `repr()` of string in NFC and NFD forms does not differ

2018-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Use ascii() in Python 3 if you want the behavior of repr() in Python 2. It escapes all non-ascii characters. But escaping only combining characters in addition to non-printable characters in repr() looks an interesting idea.

[issue33317] `repr()` of string in NFC and NFD forms does not differ

2018-04-20 Thread Pekka Klärck
Pekka Klärck added the comment: Forgot to mention that this doesn't affect Python 2: >>> a = u'hyv\xe4' >>> b = u'hyva\u0308' >>> print(repr(a)) u'hyv\xe4' >>> print(repr(b)) u'hyva\u0308' In addition to hoping `repr()` would be enhanced in future Python 3 versions,

[issue33317] `repr()` of string in NFC and NFD forms does not differ

2018-04-20 Thread Pekka Klärck
New submission from Pekka Klärck : If I have two strings that look the same but have different Unicode form, it's very hard to see where the problem actually is: >>> a = 'hyv\xe4' >>> b = 'hyva\u0308' >>> print(a) hyvä >>> print(b) hyvä >>> a == b False >>>

[issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj)

2018-04-20 Thread Florian Weimer
Florian Weimer added the comment: Why does the code even need the flexible struct member? If you use the surrounding backing store directly, the aliasing issue disappears if the backing store is untyped memory (if not, you have the aliasing problem with the rest of the

[issue33283] Mention PNG as a supported image format by Tcl/Tk

2018-04-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33283] Mention PNG as a supported image format by Tcl/Tk

2018-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7a45eb9efb6fffdb4051d1f62b3af4f50c083bf1 by Serhiy Storchaka (Andrés Delfino) in branch '2.7': bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) (GH-6542)