[issue33292] Fix secrets.randbelow docstring

2018-04-17 Thread Vex Woo
Vex Woo added the comment: Please use () or [] -- ___ Python tracker ___ ___

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread INADA Naoki
New submission from INADA Naoki : https://github.com/python/cpython/blob/5fbc511f56688654a05b9eba23d140318bb9b2d5/Lib/test/test_urllib2net.py#L180-L198 This test uses http://www.imdb.com/, but it is gone. So This test start failing. Is there any good URL for this test

[issue33296] datetime.datetime.utcfromtimestamp call decimal causes precision loss

2018-04-17 Thread Shlomo Anglister
Shlomo Anglister added the comment: The test code demonstrates that fromutctimestamp(1523510588.436252000) != fromutctimestamp(Decimal(1523510588.436252000)) This is related to issues: 22627 and 23607 but not a duplicate --

[issue33294] Support complex expressions for py-print command.

2018-04-17 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +6199 stage: -> patch review ___ Python tracker ___

[issue33296] datetime.datetime.utcfromtimestamp call decimal causes precision loss

2018-04-17 Thread Shlomo Anglister
New submission from Shlomo Anglister : Output for python2.7.11 2018-04-12-05:23:08.436252 2018-04-12-05:23:08.436252 Output for python3.4 and python3.6 2018-04-12-05:23:08.436252 2018-04-12-05:23:08.00 -- components: Library (Lib) files:

[issue15443] datetime module has no support for nanoseconds

2018-04-17 Thread Shlomo Anglister
Change by Shlomo Anglister : -- nosy: +anglister ___ Python tracker ___ ___

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6198 ___ Python tracker ___

[issue33294] Support complex expressions for py-print command.

2018-04-17 Thread Martin Liška
New submission from Martin Liška : The patch is based on a blog post: http://kouk.surukle.me/2014/09/25/debugging-python-objects-and-fields-with-gdb/. Adding him: @kouk Purpose of the pull request is to support more complex expressions for py-print command. Small

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread INADA Naoki
INADA Naoki added the comment: New changeset 5fbc511f56688654a05b9eba23d140318bb9b2d5 by INADA Naoki in branch 'master': bpo-33205: dict: Change GROWTH_RATE to `used*3` (GH-6350) https://github.com/python/cpython/commit/5fbc511f56688654a05b9eba23d140318bb9b2d5

[issue32886] new Boolean ABC in numbers module

2018-04-17 Thread Sylvain Marie
Sylvain Marie added the comment: Mark I get your point. Mine is just to have a common abstraction between python's primitive bool and numpy bool (and possibly other future alternate booleans) for consistency with `numbers` and to be used in common type

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

2018-04-17 Thread miss-islington
miss-islington added the comment: New changeset f44ce356a6ccd6c8e80ac5c4b29adb13db5c117a by Miss Islington (bot) in branch '3.6': bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479)

[issue32232] building extensions as builtins is broken in 3.7

2018-04-17 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, oops - I commented before fully catching up on everything else, and now I see that Xavier already made exactly that point just above. I'll go review the PR now :) -- ___ Python tracker

[issue33297] Mention Pillow package on tkinter.rst to work with more image formats

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

[issue33297] Mention Pillow package on tkinter.rst to work with more image formats

2018-04-17 Thread Andrés Delfino
New submission from Andrés Delfino : Given that the default list of supported formats is quite limited, IMHO we should point to Pillow, or any other package that provides support for more formats. -- assignee: docs@python components: Documentation messages: 315393

[issue33251] ConfigParser.items returns items present in vars

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What *actually* was changed in 3.2? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue32232] building extensions as builtins is broken in 3.7

2018-04-17 Thread Nick Coghlan
Nick Coghlan added the comment: Even when statically linked, extension modules should *NOT* be getting built with `-DPy_BUILD_CORE`. That preprocessor definition is for CPython core core only, and we moved the headers to help make that 100% crystal clear. --

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2018-04-17 Thread Mahmud Al Hasan
Mahmud Al Hasan added the comment: The problem still exists on python 3.4 and I need to use this version. Any solution? -- nosy: +rauaha versions: -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread INADA Naoki
Change by INADA Naoki : -- keywords: +patch pull_requests: +6200 stage: -> patch review ___ Python tracker ___

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2018-04-17 Thread Mark Lawrence
Change by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue33292] Fix secrets.randbelow docstring

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think that intervals [0, n-1] or (-1, n) would look better than [0, n). -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33189] pygettext doesn't work with f-strings

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If there are no objections I'm going to merge PR 6364 in 24 hours. -- assignee: -> serhiy.storchaka nosy: +lemburg ___ Python tracker

[issue33297] Mention Pillow package on tkinter.rst to work with more image formats

2018-04-17 Thread Andrés Delfino
Change by Andrés Delfino : -- type: -> enhancement ___ Python tracker ___ ___

[issue33292] Fix secrets.randbelow docstring

2018-04-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: Possibly you may not be familiar with interval notation? https://www.mathsisfun.com/sets/intervals.html Since this is Python and not maths, maybe we should rethink the wording. -- ___

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does the problem still exist on Python 3.6? Python 3.4 is now in security fixes only mode. The only solution for you may be upgrading to Python 3.6. -- ___ Python tracker

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: New changeset f7379ddf1c315fe18734cca943aff5b437baf849 by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-33295: Skip test using missing external site (GH-6504) (GH-6509)

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6203 ___ Python tracker ___

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Berker Peksag
Berker Peksag added the comment: I initially thought about using pythontest.net but I don't think it's possible to remove the Connection header at the nginx level: https://github.com/python/psf-salt/blob/master/salt/pythontest/config/nginx.pythontest.conf.jinja I

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

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

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: New changeset afc768d69879d6b95c59a0a5e92ea4c6061f3841 by Ned Deily (Miss Islington (bot)) in branch '2.7': bpo-33295: Skip test using missing external site (GH-6504) (GH-6510)

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: Thanks! I force-merged the skips of the test so that Travis CI and buildbots were not failing. I'll leave the issue open so we can decide what to do about the test long term. -- ___ Python tracker

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

2018-04-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vstinner ___ Python tracker ___ ___

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6202 ___ Python tracker ___

[issue33144] random._randbelow optimization

2018-04-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset ba3a87aca37cec5b1ee32cf68f4a254fa0bb2bec by Raymond Hettinger (Wolfgang Maier) in branch 'master': bpo-33144: random.Random and subclasses: split _randbelow implementation (GH-6291)

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6204 ___ Python tracker ___

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

2018-04-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently every constant is wrapped with _PyCode_ConstantKey() in the compiler. This is necessary for distinguishing numbers 1, 1.0 and 1.0+0j, 0.0 and -0.0, and avoiding warnings from comparing string and bytes constants.

[issue33290] Python.org macOS pkg installs pip3 as pip

2018-04-17 Thread Gilbert Wilson
Gilbert Wilson added the comment: Well what do you know, it does indeed look like a pip3 upgrade issue! I'll wander over to the pip issue tracker and file a bug/upvote over there. Thanks! gilw-mbp:bin gilw$ ls -al pip* -rwxrwxr-x 1 root admin 253 Apr 17 09:21 pip3

[issue33144] random._randbelow optimization

2018-04-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Possibly, the switch from type checks to identity checks could be considered a bugfix that could be backported. I've always had a lingering worry about that part of the code. --

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: New changeset 36d56ea826caffbeac0fc0c6d90248b80516e33c by Ned Deily (INADA Naoki) in branch 'master': bpo-33295: Skip test using missing external site (GH-6504) https://github.com/python/cpython/commit/36d56ea826caffbeac0fc0c6d90248b80516e33c

[issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)

2018-04-17 Thread Ned Deily
Ned Deily added the comment: New changeset f1547d110ff195291e29ba5c29617912d12ecbec by Ned Deily (Miss Islington (bot)) in branch '3.6': bpo-33295: Skip test using missing external site (GH-6504) (GH-6511)

[issue33299] Return an object itself for some types in _PyCode_ConstantKey()

2018-04-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : _PyCode_ConstantKey() wraps a constant into a tuple that contains other items besides the wrapped object. This makes booleans different from 0 and 1, makes numbers of different type different (1, 1.0 and 1.0+0j), makes

[issue33299] Return an object itself for some types in _PyCode_ConstantKey()

2018-04-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vstinner ___ Python tracker ___ ___

[issue33299] Return an object itself for some types in _PyCode_ConstantKey()

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

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

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue33299 for the first option. -- ___ Python tracker ___

[issue33262] Deprecate shlex.split(None) to read from stdin.

2018-04-17 Thread Zackery Spytz
Change by Zackery Spytz : -- components: +Library (Lib) nosy: +ZackerySpytz ___ Python tracker ___

[issue33262] Deprecate shlex.split(None) to read from stdin.

2018-04-17 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +6207 stage: needs patch -> patch review ___ Python tracker ___

[issue33300] Bad usage example in id() DocString

2018-04-17 Thread Glen Neff
New submission from Glen Neff : The DocString for id() in 3.5.x & 3.6.x seems to have an incorrect usage example, specifically ``id(obj, /)``. This is present in 3.5.x & 3.6.x. It does not appear to be present in 2.7.x or 3.4.x.: Python 3.6.4 (v3.6.4:d48eceb, Dec 19

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread INADA Naoki
Change by INADA Naoki : -- resolution: -> fixed ___ Python tracker ___ ___

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread miss-islington
miss-islington added the comment: New changeset 902bb62d5af21526b68892a1032c63aa86ded247 by Miss Islington (bot) in branch '3.7': bpo-33205: dict: Change GROWTH_RATE to `used*3` (GH-6350)

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-17 Thread INADA Naoki
Change by INADA Naoki : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33297] Mention Pillow package on tkinter.rst to work with more image formats

2018-04-17 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +serhiy.storchaka, terry.reedy ___ Python tracker ___

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2018-04-17 Thread Steve Dower
Steve Dower added the comment: The attached files should work on Python 3.4. Feel free to use them. -- ___ Python tracker ___

[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-04-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Calling PyObject_LengthHint() adds an overhead. It is significant for short sequences. I work on a patch that reduces it. PR 6493 adds the second call of PyObject_LengthHint() and increases the overhead. As for this issue,

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Brett Cannon
Brett Cannon added the comment: Are you seeing the same issue on Python 3.6.5? -- nosy: +belopolsky, brett.cannon ___ Python tracker

[issue33300] Bad usage example in id() DocString

2018-04-17 Thread Martin Panter
Martin Panter added the comment: It is supposed to be a function signature, similar to the syntax when you define your own function, rather than a usage example of calling the function. In this case, the slash notation is described by PEP 457. It is supposed to indicate

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Ned Deily
Ned Deily added the comment: Tim, do you think the docs should be changed and, if so, which sections? If you dictate, I'll type! -- ___ Python tracker

[issue33090] race condition between send and recv in _ssl with non-zero timeout

2018-04-17 Thread James Lu
Change by James Lu : -- nosy: +tacocat ___ Python tracker ___ ___ Python-bugs-list

[issue32533] SSLSocket read/write thread-unsafety

2018-04-17 Thread James Lu
Change by James Lu : -- nosy: +tacocat ___ Python tracker ___ ___ Python-bugs-list

[issue33301] Add __contains__ to pathlib

2018-04-17 Thread Alok Singh
New submission from Alok Singh : I was thinking today that it would be natural for paths to support __contains__ since then you could write statements like `if file in dir` or `if subdir in dir` cleanly. The library plumbum appears to already have this, but I think it

[issue33301] Add __contains__ to pathlib

2018-04-17 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue11594] 2to3 does not preserve line endings

2018-04-17 Thread miss-islington
Change by miss-islington : -- pull_requests: +6208 ___ Python tracker ___

[issue11594] 2to3 does not preserve line endings

2018-04-17 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset c127a86e1862df88ec6f9d15b79c627fc616766e by Łukasz Langa (Aaron Ang) in branch 'master': bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483)

[issue33302] The search for pyvenv.cfg doesn't match PEP 405

2018-04-17 Thread Matthew Woodcraft
New submission from Matthew Woodcraft : PEP 405 says that the pyvenv.cfg file is found as follows: « a pyvenv.cfg file is found either adjacent to the Python executable or one directory above it (if the executable is a symlink, it is not dereferenced), » But in

[issue32108] configparser bug: section is emptied if you assign a section to itself

2018-04-17 Thread Łukasz Langa
Łukasz Langa added the comment: I agree, the fix needs to be changed. What we probably want is to discover this kind of assignment and special-case *that*. -- versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.5 ___ Python

[issue11594] 2to3 does not preserve line endings

2018-04-17 Thread miss-islington
miss-islington added the comment: New changeset 3b3be1fe10f6c15e57360cac9d9dbc660666e655 by Miss Islington (bot) in branch '3.7': bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483)

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Ned Deily
Ned Deily added the comment: I am not sure I understand what behavior you are expecting. But datetime.now() is documented as returning "the current local date and time" (assuming no tx= argument is provided) while datetime.utcnow() returns "the current UTC date and time".

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Brett Cannon
Brett Cannon added the comment: And we do have women on the team, so please minimize the "fellas" comments. -- ___ Python tracker ___

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Tim Peters
Tim Peters added the comment: I agree this isn't a bug (and it was right to close it). I expect the OP is confused about what the `.timestamp()` method does, though. This note in the docs directly address what happens in their problematic `datetime.utcnow().timestamp()`

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Tim Peters
Tim Peters added the comment: Ned, I think this one is more the case that the OP didn't read the docs ;-) That said, there's a level of complexity here that seemingly can't be reduced: the distinctions between the `datetime` and `time` modules' views of the world, and

[issue33291] issue in the default setup.py which comes with the Python 3.6.5 installer

2018-04-17 Thread Brett Cannon
Brett Cannon added the comment: We don't having to do with the stegano project. It looks like they specified the wrong encoding in their setup.py. (This also isn't the issue tracker for pip, but I don't think they have the bug.) -- nosy: +brett.cannon resolution:

[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-04-17 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Microbenchmarked with @vstinner's perf module: python -m perf timeit "list([0]*10)" -o new.json checkout master and build python -m perf timeit "list([0]*10)" -o old.json python -m perf compare_to new.json old.json Mean +- std

[issue33304] Syntax Error on leading 0 in integer tokens

2018-04-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, it is intentional. In Python 2, numbers with a leading zero are interpreted as octal, leading to surprising results: py> 015 13 In Python 3, we use 0o15 to get octal, and 015 becomes a syntax error.

[issue33305] Improve syntax error for numbers with leading zero

2018-04-17 Thread Steven D'Aprano
Change by Steven D'Aprano : -- type: behavior -> enhancement ___ Python tracker ___

[issue33305] Improve syntax error for numbers with leading zero

2018-04-17 Thread Steven D'Aprano
New submission from Steven D'Aprano : The Python 2.x syntax for octal integers is a syntax error in 3.x, but the error message is very uninformative: SyntaxError: invalid token Can this be improved? Perhaps to something like: invalid token, use 0o prefix for

[issue33304] Syntax Error on leading 0 in integer tokens

2018-04-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: I've opened an issue to improve the error message: #33305 -- ___ Python tracker ___

[issue33303] ElementTree Comment text isn't escaped

2018-04-17 Thread John Burnett
New submission from John Burnett : The _serialize_xml function in ElementTree.py doesn't escape Comment.text values when writing output. This means the following code: import sys import xml.etree.ElementTree elem = xml.etree.ElementTree.Comment()

[issue28126] Py_MEMCPY: Use memcpy on Windows?

2018-04-17 Thread Andro Nuxx
Andro Nuxx added the comment: Py_MEMCPY() has a special case for small blocks on Windows to work around an ancient performance issue in MSVC. Can we safely assume that recent MSVC properly optimize memcpy()? See #28055 /* Py_MEMCPY can be used instead of memcpy in cases

[issue33304] Syntax Error on leading 0 in integer tokens

2018-04-17 Thread jackb
New submission from jackb : Entering 007 gives a syntax error. Should return 7. 00 correctly returns 0. 007. correctly returns 7.0. -- components: Interpreter Core messages: 315429 nosy: jackb priority: normal severity: normal status: open title: Syntax Error on

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Han Shaowen
Han Shaowen added the comment: Guys, what I said is the doc in help(datetime.timestamp) is 'Return POSIX timestamp as float.' So I assumed it is irrelevant to time zone, considering POSIX timestamp's definition. If it is then datetime.now and datetime.utcnow should

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Tim Peters
Tim Peters added the comment: docstrings give brief statements intended to jog your memory; they're not intended to be comprehensive docs. Read the actual documentation and see whether you're still confused. When you "assumed it is irrelevant to time zone", that was your

[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.

2018-04-17 Thread Han Shaowen
Han Shaowen added the comment: Hohoho, I found the full-version doc. This issue over. Thanks Tim, Ned and Brett. And sorry about something improper I said, I respect female Pythonista. -- ___ Python tracker