[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: > > ISO 8601 specifies dozens of ways to represent the same datetime > > Yes, but not within the same format. If someone were to choose the > format '2014-04-10T24:00:00', they would have a reasonable expectation > that there is only one unique string that c

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2020-01-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- Removed message: https://bugs.python.org/msg359706 ___ Python tracker ___ ___ Python-bugs-li

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2020-01-09 Thread printerhelp center
printerhelp center added the comment: As of late, numerous clients have griped concerning the sibling printer disconnected issue as it goes detached naturally or after some idle time which ranges from 10 to 30 minutes. This issue makes inconvenience as clients are not ready to print pages be

[issue34311] locale.format() and locale.format_string() cast Decimals to float

2020-01-09 Thread Inada Naoki
Inada Naoki added the comment: Does the name "locale.localize" have some origin? I feel the name doesn't represent well about it is for formatting numeric based on LC_NUMERIC. -- nosy: +inada.naoki ___ Python tracker

[issue39283] Add ability to inherit unittest arguement parser

2020-01-09 Thread Ajay Tripathi
New submission from Ajay Tripathi : I am currently writing a unittest script that requires argparser but since the unittest module already has a ArgumentParser instance, I cannot create and use my own ArgumentParser instance. Possible solution: The problem would be solved I could inherit th

[issue38973] Shared Memory List Returns 0 Length

2020-01-09 Thread Derek Frombach
Derek Frombach added the comment: Documentation on Global Descriptor Lock needs re-writing. Found documentation in version 2, much more helpful. -- stage: -> resolved status: open -> closed ___ Python tracker

[issue17005] Add a topological sort algorithm

2020-01-09 Thread Senthil Kumaran
Change by Senthil Kumaran : -- nosy: +orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue17005] Add a topological sort algorithm

2020-01-09 Thread Tim Peters
Tim Peters added the comment: Let's stir this up a bit ;-) I recently had occasion to exchange ideas with Larry Hastings about topsorts for use in a package manager he's writing. I thought his API for adding edges was ... perfect: add(node, *dependson) So, e.g., add(A, B, C) says A de

[issue39282] python-config --embed documentation

2020-01-09 Thread Milo D Kerr
Change by Milo D Kerr : -- assignee: -> docs@python components: +Documentation nosy: +docs@python type: -> enhancement ___ Python tracker ___

[issue39282] python-config --embed documentation

2020-01-09 Thread Milo D Kerr
New submission from Milo D Kerr : Update 3.8 embedding documentation to reflect changes in PR 13500 bpo 36721 -- messages: 359701 nosy: M.Kerr priority: normal severity: normal status: open title: python-config --embed documentation versions: Python 3.8

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2020-01-09 Thread Milo D Kerr
Change by Milo D Kerr : -- nosy: +M.Kerr ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue39281] The CO_NESTED flag is associated with a significant performance cost

2020-01-09 Thread Dan Snider
New submission from Dan Snider : The title was carefully worded as I have no idea how or why what is happening is happening, only that it has been like this since a least 3.6.0. That version in particular, by the way, is able to execute a call to a python function with 1 argument 25% faster t

[issue37224] test__xxsubinterpreters fails randomly

2020-01-09 Thread Kyle Stanley
Kyle Stanley added the comment: > For a struct-specific getter we usually end the prefix with an underscore: _PyInterpreter_IsFinalizing. Otherwise, that's the same name I would have used. :) Good to know, thanks! > No worries (or hurries). Just request a review from me when you're ready.

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-09 Thread Ram Rachum
Ram Rachum added the comment: > To me, this seems like a pretty thin justification for calling this a > security vulnerability. I know that lots of exploits were made because of bugs in Python's URL parsing, and security releases of Python were made because of that. It's possible that simil

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: > If user code were to check for uniqueness of a datetime by comparing it as a > string, this is where an attacker could fool this logic, by using a non-Ascii > digit. To me, this seems like a pretty thin justification for calling this a security vulnerabi

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: I don't love the inconsistency, but can you elaborate on the actual *danger* posed by this? What security vulnerabilities involve parsing a datetime using a non-ascii digit? The reason that `fromisoformat` doesn't accept non-ASCII digits is actually because i

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-09 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +17337 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17931 ___ Python tracker ___ _

[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-09 Thread Ram Rachum
Change by Ram Rachum : -- pull_requests: +17336 pull_request: https://github.com/python/cpython/pull/17931 ___ Python tracker ___ __

[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-09 Thread Ram Rachum
New submission from Ram Rachum : I've been doing some research into the use of `\d` in regular expressions in CPython, and any security vulnerabilities that might happen as a result of the fact that it accepts non-Ascii digits like ٢ and 5. In most places in the CPython codebase, the `re.ASCII

[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-09 Thread Ram Rachum
Change by Ram Rachum : -- keywords: +patch pull_requests: +17335 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17928 ___ Python tracker ___ _

[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-09 Thread Ram Rachum
New submission from Ram Rachum : The platform.py module takes non-Ascii digits in regexes in places it shouldn't. e.g. digits like ٢ and 5 and accepted, when only the Ascii digits between 0-9 should be accepted. -- components: Library (Lib) messages: 359694 nosy: cool-RR priority: norm

[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-09 Thread miss-islington
miss-islington added the comment: New changeset 33e033da3c1472b0aa2ae3cff06649a1ae4aa37f by Miss Islington (bot) in branch '3.8': bpo-39235: Fix end location for genexp in call args (GH-17925) https://github.com/python/cpython/commit/33e033da3c1472b0aa2ae3cff06649a1ae4aa37f --

[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +17334 pull_request: https://github.com/python/cpython/pull/17927 ___ Python tracker ___ __

[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-09 Thread miss-islington
miss-islington added the comment: New changeset a796d8ef9dd1af65f7e4d7a857b56f35b7cb6e78 by Miss Islington (bot) (Guido van Rossum) in branch 'master': bpo-39235: Fix end location for genexp in call args (GH-17925) https://github.com/python/cpython/commit/a796d8ef9dd1af65f7e4d7a857b56f35b7cb6

[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +17333 pull_request: https://github.com/python/cpython/pull/17926 ___ Python tracker ___

[issue39275] Traceback off by one line when

2020-01-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This looks similar to issue35405 . See also issue16482 with a patch. -- nosy: +xtreak ___ Python tracker ___ __

[issue26495] super() does not work in nested functions, genexps, listcomps, and gives misleading exceptions

2020-01-09 Thread Josh Lee
Change by Josh Lee : -- nosy: +jleedev ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-09 Thread Guido van Rossum
Change by Guido van Rossum : -- keywords: +patch pull_requests: +17332 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17925 ___ Python tracker ___

[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: OK, so I looked into this (sine we can't wait for Serhiy). The problem was probably introduced when Ivan added end lineno/column attributes to parse tree nodes. The offending copy_location() call copies the begin and end locations from the given node (mayb

[issue39278] add docstrings to functions in pdb module

2020-01-09 Thread Carl Bordum Hansen
Change by Carl Bordum Hansen : -- keywords: +patch pull_requests: +17331 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17924 ___ Python tracker _

[issue25172] Unix-only crypt should not be present on Windows.

2020-01-09 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue39278] add docstrings to functions in pdb module

2020-01-09 Thread Carl Bordum Hansen
New submission from Carl Bordum Hansen : The functions are documented, but not in doc strings which means you cannot call help() on them. >From this twitter thread: >https://twitter.com/raymondh/status/1211414561468952577 -- assignee: docs@python components: Documentation messages: 3

[issue25172] Unix-only crypt should not be present on Windows.

2020-01-09 Thread miss-islington
miss-islington added the comment: New changeset 8c08518c255747a06d00479f21087f0c934d0ad6 by Miss Islington (bot) in branch '3.8': bpo-25172: Reduce scope of crypt import tests (GH-17881) https://github.com/python/cpython/commit/8c08518c255747a06d00479f21087f0c934d0ad6 -- __

[issue39276] type() cause segmentation fault in callback function called from C extension

2020-01-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- Removed message: https://bugs.python.org/msg359687 ___ Python tracker ___ ___ Python-bugs-list

[issue39276] type() cause segmentation fault in callback function called from C extension

2020-01-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: static PyTypeObject InternalType should have PyVarObject_HEAD_INIT(&PyType_Type, 0) instead of PyVarObject_HEAD_INIT(NULL, 0) -- nosy: +pablogsal ___ Python tracker _

[issue25172] Unix-only crypt should not be present on Windows.

2020-01-09 Thread Steve Dower
Steve Dower added the comment: New changeset ed367815eeb9329c48a86a8a7fa3186e27a10f2c by Steve Dower in branch 'master': bpo-25172: Reduce scope of crypt import tests (GH-17881) https://github.com/python/cpython/commit/ed367815eeb9329c48a86a8a7fa3186e27a10f2c -- ___

[issue25172] Unix-only crypt should not be present on Windows.

2020-01-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +17330 pull_request: https://github.com/python/cpython/pull/17922 ___ Python tracker ___ __

[issue1681671] Python and Indeterminate Forms (Math)

2020-01-09 Thread Julien Palard
Change by Julien Palard : -- nosy: +mdk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2020-01-09 Thread Andy Lester
Andy Lester added the comment: Re: branch prediction. The branch if (c1>=37 && c1<=126) could just as easily be if (c1>=0 && c1<=126) with no other changes to the code. It could be just if (c1<=126) if c1 wasn't signed. As far as branch prediction, we could make it somethin

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2020-01-09 Thread Andy Lester
Andy Lester added the comment: Yes, I ran it multiple times on my 2013 Macbook Pro and got ~10% speedup. I also ran it on my Linux VM (that I only use for development) and got a speedup but less so. The code I used to run the tests is at: https://github.com/petdance/cpython/blob/Issue39150

[issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

2020-01-09 Thread Thomas Grainger
Change by Thomas Grainger : -- versions: -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

2020-01-09 Thread STINNER Victor
STINNER Victor added the comment: It's a bug in _PyTime_FromDouble() which fails to detect the integer overflow when casting a C double to a C _PyTime_T (int64_t): bug in _Py_InIntegralTypeRange(_PyTime_t, d) where d is a C double. On my Fedora 31, double is a 64-bit IEEE 754 float, _PyTime_

[issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

2020-01-09 Thread Thomas Grainger
New submission from Thomas Grainger : _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t Python 3.7.5 (default, Nov 20 2019, 09:21:52) [GCC 9.2.1 20191008] on linux Type "help", "copyright", "credits" or "license" for more information. >>> impor

[issue39274] Conversion from fractions.Fraction to bool

2020-01-09 Thread Sebastian Berg
Sebastian Berg added the comment: Thanks for the quick responses. @Victor Stinner, I suppose you could change `numbers.Complex.__bool__()` by adding the no-op bool to make it: `bool(self != 0)`. But I am not sure I feel it is necessary. NumPy is a bit a strange in that it uses its own boole

[issue39276] type() cause segmentation fault in callback function called from C extension

2020-01-09 Thread Paweł Karczewski
New submission from Paweł Karczewski : How to reproduce: 1. Create callback function, which may take any object and run type() on it def builtin_type_in_callback(obj): type(obj) 2. Create C extension with two types defined in it - Internal and External. Eternal type should implem

[issue39274] Conversion from fractions.Fraction to bool

2020-01-09 Thread STINNER Victor
STINNER Victor added the comment: > ``return bool(a._numerator)`` does seem like the obvious way to do this. Yes, it's a good fix. It's used on other places. -- numbers.Complex.__bool__() also uses "self != 0". Is it an issue? -- nosy: +vstinner

[issue39274] Conversion from fractions.Fraction to bool

2020-01-09 Thread Mark Dickinson
Mark Dickinson added the comment: For completeness and to save people going to the NumPy tracker, here's an example of the problem: Python 3.8.1 (default, Jan 5 2020, 21:32:35) [Clang 10.0.1 (clang-1001.0.46.4)] on darwin Type "help", "copyright", "credits" or "license" for more information

[issue39275] Traceback off by one line when

2020-01-09 Thread Facundo Batista
New submission from Facundo Batista : When using pdb to debug, the traceback is off by one line. For example, this simple script: ``` print("line 1") import pdb;pdb.set_trace() print("line 2") print("line 3", broken) print("line 4") ``` ...when run produces the following traceback (after hitt

[issue37539] CheckCommitCursorReset regression sqlite3 test fails with old sqlite3

2020-01-09 Thread Matej Cepl
Matej Cepl added the comment: Fix for this situations (and we are talking about sqlite3 3.6.4, which is truly archaeological excavation) skip particular test. -- keywords: +patch Added file: https://bugs.python.org/file48833/avoid-sqlite-race.patch ___

[issue39274] Conversion from fractions.Fraction to bool

2020-01-09 Thread Mark Dickinson
Mark Dickinson added the comment: Agreed that __bool__ should return an actual bool. ``return bool(a._numerator)`` does seem like the obvious way to do this. -- ___ Python tracker ___

[issue39274] Conversion from fractions.Fraction to bool

2020-01-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +mark.dickinson, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue39274] Conversion from fractions.Fraction to bool

2020-01-09 Thread François Durand
François Durand added the comment: As of now, fractions.Fraction.__bool__ is implemented as: ``return a._numerator != 0``. However, this does not necessary return a bool (which would be desired). In particular, when the numerator is a numpy integer, this returns a numpy bool instead. Another

[issue39274] Conversion from fractions.Fraction to bool

2020-01-09 Thread François Durand
New submission from François Durand : As of now, fractions.Fraction.__bool__ is implemented as: ``return a._numerator != 0``. However, this does not necessary return a bool (which would be desired). In particular, when the numerator is a numpy integer, this returns a numpy bool instead. Anothe

[issue17005] Add a topological sort algorithm

2020-01-09 Thread Gareth Rees
Gareth Rees added the comment: I'd like to push back on the idea that graphs with isolated vertices are "unusual cases" as suggested by Raymond. A very common use case (possibly the most common) for topological sorting is job scheduling. In this use case you have a collection of jobs, some o

[issue39161] Py_NewInterpreter docs need updating for multi-phase initialization

2020-01-09 Thread Petr Viktorin
Change by Petr Viktorin : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mail

[issue39161] Py_NewInterpreter docs need updating for multi-phase initialization

2020-01-09 Thread miss-islington
miss-islington added the comment: New changeset 20c990229e98ad69c03e44fe61f8dce99b96cf9d by Miss Islington (bot) in branch '3.8': bpo-39161: Document multi-phase init modules under Py_NewInterpreter() (GH-17896) https://github.com/python/cpython/commit/20c990229e98ad69c03e44fe61f8dce99b96cf9

[issue39161] Py_NewInterpreter docs need updating for multi-phase initialization

2020-01-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +17329 pull_request: https://github.com/python/cpython/pull/17918 ___ Python tracker ___ __

[issue39161] Py_NewInterpreter docs need updating for multi-phase initialization

2020-01-09 Thread miss-islington
miss-islington added the comment: New changeset 6c5d661342d12f6836580b0e75e3569c764527ae by Miss Islington (bot) (Petr Viktorin) in branch 'master': bpo-39161: Document multi-phase init modules under Py_NewInterpreter() (GH-17896) https://github.com/python/cpython/commit/6c5d661342d12f683658

[issue39029] TestMaildir.test_clean fails randomly under parallel tests

2020-01-09 Thread STINNER Victor
STINNER Victor added the comment: > I was always under the assumption that -j 4 runs tests in parallel If you run one test file, even with -j1000, only one test file will be run in parallel :-) To run the same file in parallel, you have to ask to run it more than once: "-j2 test_mailbox tes

[issue39029] TestMaildir.test_clean fails randomly under parallel tests

2020-01-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I am able to reproduce it on my Mac and as below the values of os.getpid() are the same with the command. I will try to get to a Linux box to see if I can reproduce this. I was always under the assumption that -j 4 runs tests in parallel as it even

[issue39029] TestMaildir.test_clean fails randomly under parallel tests

2020-01-09 Thread STINNER Victor
STINNER Victor added the comment: I failed to reproduce the issue on my Fedora 31 laptop using 20 processes running on parallel (my CPU has 4 cores: 8 threads). vstinner@apu$ ./python -Wall -m test -R 3:3 -j 20 test_mailbox -m test_clean -F 0:00:00 load avg: 14.86 Run tests in parallel using

[issue39029] TestMaildir.test_clean fails randomly under parallel tests

2020-01-09 Thread STINNER Victor
STINNER Victor added the comment: ./python.exe -Wall -m test -R 4:4 -j 4 test_mailbox -m test_clean With this command: test_mailbox is run exactly once. It's not run in parallel. But the same test is run 8 times. os.getpid() = 27901 support.TESTFN = '@test_27901_tmp' os.getpid() = 27901 supp

[issue39029] TestMaildir.test_clean fails randomly under parallel tests

2020-01-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > You wrote "I guess the file is not really deleted in some cases." I think > that this should be investigated first. Sorry, I wanted to mean that as the test deletes the file and goes on to assert it's not present the other test that runs in paral

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2020-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The difference around 10% looks very strange. Tokenizing is just one of parts of the compiler, and unlikely it is a narrow way. There are input/output, many memory allocations, encoding and decoding, many iterations and recursions. Are you sure that you ru

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2020-01-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I will take a look and try to reproduce the benchmarks result you mentioned, but if under PGO there is no substantial performance increase is much less appealing as the lookup table code is less clear and maintainable than the simple switch. Also you

[issue39029] TestMaildir.test_clean fails randomly under parallel tests

2020-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If TESTFN is the same in different processes, there is something wrong in the code for running parallel tests. -- ___ Python tracker ___ _

[issue39154] "utf8" not always a synonym for "utf-8" in lib2to3

2020-01-09 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue39029] TestMaildir.test_clean fails randomly under parallel tests

2020-01-09 Thread STINNER Victor
STINNER Victor added the comment: > yes, the test uses support.TESTFN which has the value of > "{}_{}_tmp".format(TESTFN, os.getpid()) in the setUp [0] to create tempdir. > Under parallel tests the pid value of TESTFN is initialised with a pid once > and used always in the setup calls. So se

[issue39259] poplib.POP3/POP3_SSL should reject timeout = 0 (non-blocking mode)

2020-01-09 Thread STINNER Victor
STINNER Victor added the comment: ftplib: https://github.com/python/cpython/blob/efa3b51fd060352cc6220b27a1026e4d4d5401bd/Lib/ftplib.py#L155 nntplib: https://github.com/python/cpython/blob/2e6a8efa837410327b593dc83c57492253b1201e/Lib/nntplib.py#L1049 smtplib: https://github.com/python/cpytho

[issue39270] Dead assignment in config_init_module_search_paths

2020-01-09 Thread STINNER Victor
STINNER Victor added the comment: New changeset f3e5e9566989635225d1b9108074fc260817 by Victor Stinner (Alex Henrie) in branch 'master': bpo-39270: Remove dead assignment from config_init_module_search_paths (GH-17914) https://github.com/python/cpython/commit/f3e5e9566989635225d1b910

[issue39270] Dead assignment in config_init_module_search_paths

2020-01-09 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue39272] Dead assignment in _ssl__SSLContext_load_verify_locations_impl

2020-01-09 Thread STINNER Victor
STINNER Victor added the comment: New changeset a1c1be24cb3ae25b5b53e9dc94d6327009626283 by Victor Stinner (Alex Henrie) in branch 'master': bpo-39272: Remove dead assignment from _ssl__SSLContext_load_verify_locations_impl (GH-17916) https://github.com/python/cpython/commit/a1c1be24cb3ae25b

[issue39272] Dead assignment in _ssl__SSLContext_load_verify_locations_impl

2020-01-09 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __