[issue39341] [security] zipfile: ZIP Bomb vulnerability, don't check announced uncompressed size

2020-02-09 Thread STINNER Victor
STINNER Victor added the comment: I close this issue as a duplicate of bpo-36260. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> [security] CVE-2019-9674: Zip Bomb vulnerability ___ Python tracker

[issue39596] reverse parameter for enumerate()

2020-02-09 Thread wyz23x2
wyz23x2 added the comment: A typo in the previous comment: >>> list(enumerate(lis,reverse=True)) [('a',0),('b',1),('c',2),('d',3)] -- ___ Python tracker ___

[issue39596] reverse parameter for enumerate()

2020-02-09 Thread wyz23x2
New submission from wyz23x2 : Starting from Python 2.3, the handy enumerate() was introduced. However, I suggest to add a "reverse" parameter: >>> lis = ['a', 'b', 'c', 'd'] >>> list(enumerate(lis)) [(0,'a'),(1,'b'),(2,'c'),(3,'d')] >>> list(enumerate(lis,reverse=True)

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-09 Thread Eryk Sun
Eryk Sun added the comment: > I'm not sure what you're suggesting here. I shouldn't try to understand > how floating-point numbers are stored? No, that's the furthest thought from my mind. I meant only that I would not recommend using one's own understanding of floating-point numbers

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-09 Thread Larry Hastings
Larry Hastings added the comment: > Anyway, it's better to leave it to the experts: I'm not sure what you're suggesting here. I shouldn't try to understand how floating-point numbers are stored? -- ___ Python tracker

[issue39587] Mixin repr overrides Enum repr in some cases

2020-02-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Bisecting points to issue29577 that introduced this change. -- nosy: +xtreak ___ Python tracker ___

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-09 Thread Eryk Sun
Eryk Sun added the comment: A binary float has the form (-1)**sign * (1 + frac) * 2**exp, where sign is 0 or 1, frac is a rational value in the range [0, 1), and exp is a signed integer (but stored in non-negative, biased form). The smallest value of frac is epsilon, and the smallest

[issue39451] enum.Enum reference count leaks

2020-02-09 Thread hongweipeng
Change by hongweipeng : -- nosy: +hongweipeng ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-09 Thread Larry Hastings
Larry Hastings added the comment: Aha! The crucial distinction is that IEEE 754 doubles have 52 bits of storage for the mantissa, but folks (e.g. Wikipedia, Mark Dickinson) describe this as "53 bits of precision" because that's easier saying "52 bits but you don't have to store the leading

[issue38938] Possible performance improvement for heaqq.merge()

2020-02-09 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +17803 pull_request: https://github.com/python/cpython/pull/18427 ___ Python tracker ___

[issue39011] ElementTree attributes replace "\r" with "\n"

2020-02-09 Thread mefistotelis
mefistotelis added the comment: Patch attached. I was thinking about one for() instead, but didn't wanted to introduce too large changes.. Let me know if you would prefer something like: for i in (9,10,13,): if chr(i) not in text: continue text = text.replace(chr(i),

[issue39595] Improve performance of importlib.metadata and zipfile.Path

2020-02-09 Thread Jason R. Coombs
Change by Jason R. Coombs : -- keywords: +patch pull_requests: +17802 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18406 ___ Python tracker ___

[issue39595] Improve performance of importlib.metadata and zipfile.Path

2020-02-09 Thread Jason R. Coombs
Change by Jason R. Coombs : -- assignee: -> jaraco ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39595] Improve performance of importlib.metadata and zipfile.Path

2020-02-09 Thread Jason R. Coombs
New submission from Jason R. Coombs : As reported in [jaraco/zipp#32](https://github.com/jaraco/zipp/issues/32), performance of zipfile.Path is inadequate. This bug tracks the incorporation of those improvements as well as those in [importlib_metadata

[issue39574] str.__doc__ is misleading

2020-02-09 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: -Python 3.5, Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39531] Memory Leak in multiprocessing.Pool()

2020-02-09 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +davin, pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39523] Unnecessary variable assignment and initial loop check in pysqlite_cursor_executescript

2020-02-09 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +ghaering ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39521] reversed(mylist) much slower on Python 3.8 32-bit for Windows

2020-02-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: I do not see the within-version slowdown on fresh Windows 10, Pro 64, 32-bit debug builds. 3.7: 26.4, 27.0 3.8: 26.8, 27.1 # installed normal 64 bit is 7.4, 7.4 3.9: 30.2, 30.1 # 10% slower -- components: +Windows nosy: +paul.moore, steve.dower,

[issue39551] mock patch should match behavior of import from when module isn't present in sys.modules

2020-02-09 Thread Chris Withers
Chris Withers added the comment: Hmm, the more we get into this, the less comfortable I am of the patch in the PR. Instead of copying and pasting more code that's likely to get out of sync, could you change the PR to just replace _importer with the correct parts of importlib to support

[issue39512] expat parser not xml 1.1 compliant (breaks xmlrpclib) - still

2020-02-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Stefen, do you know anything about this? There is no coredev expert for xmlrpc. -- nosy: +scode, terry.reedy title: expat parser not xml 1.1 (breaks xmlrpclib) - still -> expat parser not xml 1.1 compliant (breaks xmlrpclib) - still

[issue39594] Typo in documentation for os.times

2020-02-09 Thread Chenyoo Hao
New submission from Chenyoo Hao : 1.Formatting error due to an extra space (After the MSDN link). 2.There are extra words. Original: See the Unix manual page :manpage:`times(2)` and :manpage:`times(3)` manual page on Unix or `the GetProcessTimes MSDN

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, Py_INCREF and Py_DECREF change the type, and therefore constness. -- ___ Python tracker ___

[issue39578] MagicMock specialisation instance can no longer be passed to new MagicMock instance

2020-02-09 Thread Mario Corchero
Mario Corchero added the comment: Having not looked deeply at it but with the reproducer, running a quick bisect, it points to this commit: https://github.com/python/cpython/commit/77b3b7701a34ecf6316469e05b79bb91de2addfa I'll try having a look later at the day if I can manage to free some

[issue39593] Adding a unit test of ctypes

2020-02-09 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +17801 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18424 ___ Python tracker ___

[issue39593] Adding a unit test of ctypes

2020-02-09 Thread hai shi
New submission from hai shi : strlen(data) can not be replaced by Py_SIZE(value) in https://github.com/python/cpython/blob/master/Modules/_ctypes/cfield.c#L1297. victor have give a great example about it in https://github.com/python/cpython/pull/18419 I create this bpo for two reasons: 1.

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Andy Lester
Andy Lester added the comment: I'm sorry, I think my comment was misleading. The changes I had proposed were not making the object itself const, but some of the arguments in the static worker functions. For example: -tb_displayline(PyObject *f, PyObject *filename, int lineno, PyObject

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-09 Thread Mark Dickinson
Mark Dickinson added the comment: Here's another way to see it. Let's get the Unix timestamp for right now: >>> from datetime import datetime >>> epoch = datetime(1970, 1, 1) >>> now = (datetime.now() - epoch).total_seconds() >>> now 1581261916.910558 Now let's figure out the resolution, by

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-09 Thread Mark Dickinson
Mark Dickinson added the comment: > Yes, but you get the first 1 bit for free. Not really. :-) That's a detail of how floating-point numbers happen to be stored; it's not really relevant here. It doesn't affect the fact that IEEE 754 binary64 floats have 53 bits of *precision*, so using 31

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Andy Lester
Change by Andy Lester : -- pull_requests: -17798 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-09 Thread Larry Hastings
Larry Hastings added the comment: Yes, but you get the first 1 bit for free. So it actually only uses 30 bits of storage inside the double. This is apparently called "leading bit convention": https://en.wikipedia.org/wiki/IEEE_754#Representation_and_encoding_in_memory --

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-09 Thread Mark Dickinson
Mark Dickinson added the comment: [Larry] > It takes *30* bits to store the non-fractional seconds part of the current > time in a double I make it 31. :-) >>> from datetime import datetime >>> time_since_epoch = datetime.now() - datetime(1970, 1, 1) >>>

[issue39484] time_ns() and time() cannot be compared on windows

2020-02-09 Thread Larry Hastings
Larry Hastings added the comment: p.s. for what it's worth: I re-checked my math and as usual I goofed. It takes *30* bits to store the non-fractional seconds part of the current time in a double, leaving 23 bits for the fractional part, so we're *7* bits short. --

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39591] Functions in Python/traceback.c can take const pointer arguments

2020-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: They cannot. PyObject cannot be const because the code that uses it can change its reference counter even if it does not change any other fields. -- nosy: +serhiy.storchaka ___ Python tracker

[issue39590] collections.deque.__contains__ and .count should hold strong references.

2020-02-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset dc56f5f48866bf3c5412642bba00890d9a090cfb by Miss Islington (bot) in branch '3.8': bpo-39590: make deque.__contains__ and deque.count hold strong references (GH-18421) (GH-18423)

[issue39590] collections.deque.__contains__ and .count should hold strong references.

2020-02-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39590] collections.deque.__contains__ and .count should hold strong references.

2020-02-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +17800 pull_request: https://github.com/python/cpython/pull/18423 ___ Python tracker ___

[issue39590] collections.deque.__contains__ and .count should hold strong references.

2020-02-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset c6dedde160a9fce5d049e860f586ad8f93aec822 by sweeneyde in branch 'master': bpo-39590: make deque.__contains__ and deque.count hold strong references (GH-18421) https://github.com/python/cpython/commit/c6dedde160a9fce5d049e860f586ad8f93aec822