[issue37837] add internal _PyLong_FromUnsignedChar() function

2019-08-27 Thread Greg Price


Greg Price  added the comment:

Ah OK, that makes sense of it then :)

> But the most important thing is that using PyLong_FromUnsignedLong() instead 
> of _PyLong_FromUnsignedChar() on top of GH-15192 is producing the same 
> results: striter_next() uses small_ints[] directly. However that's not true 
> for bytearrayiter_next(): PyLong_FromUnsignedLong() is called there. I think 
> that's due to how code is profiled so I'm satisfied with these results more 
> or less.

Very interesting! That's a good comparison to have made, too.

I agree with your conclusions.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37962] Improve ISO 8601 timezone support in the datetime.fromisoformat() method

2019-08-27 Thread Zeth


Zeth  added the comment:

Did you read the attached PR? For three lines longer, the method becomes more 
generally useful now.

As pointed out in the other thread that you pointed to, Javascript can parse 
Python's seralised datetime object but Python cannot parse Javascript's due to 
the fact that you don't want to.

That other thread points to a third thread that starts in 2012 so it seems that 
you really think that is a feature rather than a bug.

The name of the method is fromisoformat, not "parse our internal home made 
format". The line in the documentation seems a bit weird to me to be honest. It 
is saying that we could make it generally useful for you user but we don't want 
to.

The reply to this bug, "use the dateutil.parser.isoparse that I maintain 
instead" is beside the point, we are talking about the standard library one. 
Why not put that in the standard library then if it can actually parse iso 8601 
format?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37428] SSLContext.post_handshake_auth implicitly enables cert validation

2019-08-27 Thread Christian Heimes


Christian Heimes  added the comment:

3.7 to 3.9 are fixed.

Benjamin, do you want the fix in 2.7?

--
priority: release blocker -> high

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37440] httplib should enable post-handshake authentication for TLS 1.3

2019-08-27 Thread Christian Heimes


Christian Heimes  added the comment:

3.7 to 3.9 are fixed.

Benjamin, do you want the fix in 2.7?

--
priority: release blocker -> high

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6331] Add unicode script info to the unicode database

2019-08-27 Thread Greg Price


Change by Greg Price :


--
nosy: +Greg Price

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37966] is_normalized is much slower at "no" than the standard's algorithm

2019-08-27 Thread Greg Price


Greg Price  added the comment:

Fix posted, as GH-15558.

Adding cc's for the folks in the thread on #32285, where this function was 
originally added.

--
components: +Unicode
nosy: +Maxime Belanger, benjamin.peterson, ezio.melotti, steven.daprano, 
vstinner
title: is_normalized is much slower than the standard's algorithm -> 
is_normalized is much slower at "no" than the standard's algorithm
versions: +Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36582] collections.UserString encode method returns a string

2019-08-27 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36582] collections.UserString encode method returns a string

2019-08-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 2cb82d2a88710b0af10b9d9721a9710ecc037e72 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-36582: Make collections.UserString.encode() return bytes, not str 
(GH-13138) (GH-15557)
https://github.com/python/cpython/commit/2cb82d2a88710b0af10b9d9721a9710ecc037e72


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37966] is_normalized is much slower than the standard's algorithm

2019-08-27 Thread Greg Price


Change by Greg Price :


--
keywords: +patch
pull_requests: +15231
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15558

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36582] collections.UserString encode method returns a string

2019-08-27 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
versions: +Python 3.9 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36582] collections.UserString encode method returns a string

2019-08-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15230
pull_request: https://github.com/python/cpython/pull/15557

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36582] collections.UserString encode method returns a string

2019-08-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 2a16eea71f56c2d8f38c295c8ce71a9a9a140aff by Raymond Hettinger 
(Daniel Fortunov) in branch 'master':
bpo-36582: Make collections.UserString.encode() return bytes, not str (GH-13138)
https://github.com/python/cpython/commit/2a16eea71f56c2d8f38c295c8ce71a9a9a140aff


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34651] Disallow fork in a subinterpreter.

2019-08-27 Thread Miro Hrončok

Miro Hrončok  added the comment:

The problem with subprocess.Popen has been fixed in 
https://bugs.python.org/issue37951

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37966] is_normalized is much slower than the standard's algorithm

2019-08-27 Thread Greg Price


New submission from Greg Price :

In 3.8 we add a new function `unicodedata.is_normalized`.  The result is 
equivalent to `str == unicodedata.normalize(form, str)`, but the implementation 
uses a version of the "quick check" algorithm from UAX #15 as an optimization 
to try to avoid having to copy the whole string.  This was added in issue 
#32285, commit 2810dd7be.

However, it turns out the code doesn't actually implement the same algorithm as 
UAX #15, and as a result we often miss the optimization and end up having to 
compute the whole normalized string after all.

Here's a quick demo on my desktop.  We pass a long string made entirely out of 
a character for which the quick-check algorithm always says `NO`, it's not 
normalized:

$ build.base/python -m timeit -s 'import unicodedata; s = "\uf900"*50' -- \
'unicodedata.is_normalized("NFD", s)'
50 loops, best of 5: 4.39 msec per loop

$ build.base/python -m timeit -s 'import unicodedata; s = "\uf900"*50' -- \
's == unicodedata.normalize("NFD", s)'
50 loops, best of 5: 4.41 msec per loop

That's the same 4.4 ms (for a 1 MB string) with or without the attempted 
optimization.

Here it is after a patch that makes the algorithm run as in the standard:

$ build.dev/python -m timeit -s 'import unicodedata; s = "\uf900"*50' -- \
'unicodedata.is_normalized("NFD", s)'
500 loops, best of 5: 58.2 nsec per loop

Nearly 5 orders of magnitude faster -- the difference between O(N) and O(1).

The root cause of the issue is that our `is_normalized` static helper, which 
the new function relies on, was never written as a full implementation of the 
quick-check algorithm.  The full algorithm can return YES, MAYBE, or NO; but 
originally this helper's only caller was the implementation of 
`unicodedata.normalize`, which only cares about YES vs. MAYBE-or-NO.  So the 
helper often returns MAYBE when the standard algorithm would say NO.

(More precisely, perhaps: it's fine that this helper was never a full 
implementation... but it didn't say that anywhere, even while referring to the 
standard algorithm, and as a result set us up for future confusion.)

That's exactly what's happening in the example above: the standard quick-check 
algorithm would say NO, but our helper says MAYBE.  Which for 
`unicodedata.is_normalized` means it has to go compute the whole normalized 
string.

--
messages: 350651
nosy: Greg Price
priority: normal
severity: normal
status: open
title: is_normalized is much slower than the standard's algorithm
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Possibly, but unlikely as the system had been freshly installed and rebooted 
before the worker was restarted.

The worker processes, however, had not been stopped prior to, or during the 
upgrade, so it's possible that the worker had an inconsistent build state that 
had resumed, or used before-upgrade information, code or objects during tests

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37965] CCompiler has_function displays warning

2019-08-27 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

seems like a good patch. Can you submit a PR?

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35028] Off by one error in cgi.FieldStorage(max_num_fields)

2019-08-27 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-08-27 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks Victor and Gregory!

I'm reducing the severity from release blocker to high and keep the ticket in 
pending to give Eric a change to review the commits.

--
priority: release blocker -> high
resolution:  -> fixed
stage: patch review -> commit review
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-08-27 Thread miss-islington


miss-islington  added the comment:


New changeset 03c52f2f63a8abeb4afb75e9da46c7d6c0a8afd5 by Miss Islington (bot) 
in branch '3.8':
bpo-37951: Lift subprocess's fork() restriction (GH-15544)
https://github.com/python/cpython/commit/03c52f2f63a8abeb4afb75e9da46c7d6c0a8afd5


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-08-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15229
pull_request: https://github.com/python/cpython/pull/15554

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-08-27 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 98d90f745d35d5d07bffcb46788b50e05eea56c6 by Christian Heimes in 
branch 'master':
bpo-37951: Lift subprocess's fork() restriction (GH-15544)
https://github.com/python/cpython/commit/98d90f745d35d5d07bffcb46788b50e05eea56c6


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37965] CCompiler has_function displays warning

2019-08-27 Thread Maarten

New submission from Maarten :

When using the `has_function` method of a CCompiler object,
the compiler will emit a warning because the main function has no return type 
specified.

https://github.com/python/cpython/blob/8c9e9b0cd5b24dfbf1424d1f253d02de80e8f5ef/Lib/distutils/ccompiler.py#L784-L786

This warning is emitted:
/tmp/clockq2_azlzj.c:2:1: warning: return type defaults to ‘int’ 
[-Wimplicit-int]
2 | main (int argc, char **argv) {
  | ^~~~

This happens under Linux, gcc 9

--
components: Distutils
files: 0001-Fix-compiler-warning-of-distutils-CCompiler.test_fun.patch
keywords: patch
messages: 350645
nosy: dstufft, eric.araujo, maarten
priority: normal
severity: normal
status: open
title: CCompiler has_function displays warning
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: 
https://bugs.python.org/file48563/0001-Fix-compiler-warning-of-distutils-CCompiler.test_fun.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35964] shutil.make_archive (xxx, tar, root_dir) is adding './' entry to archive which is wrong

2019-08-27 Thread Роман Донченко

Change by Роман Донченко :


--
nosy: +SpecLad

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31405] shutil.which doesn't find files without PATHEXT extension on Windows

2019-08-27 Thread Роман Донченко

Change by Роман Донченко :


--
nosy: +SpecLad

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24505] shutil.which wrong result on Windows

2019-08-27 Thread Роман Донченко

Change by Роман Донченко :


--
nosy: +SpecLad

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37894] [win] shutil.which can not find the path if 'cmd' include directory path and not include extension name

2019-08-27 Thread Роман Донченко

Change by Роман Донченко :


--
nosy: +SpecLad

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37954] Multiple tests are leaking references in AMD64 Windows8.1 Refleaks 3.x and x86 Gentoo Refleaks 3.x buildbots

2019-08-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thank you very much, Steve! This was indeed a bit tricky :)

The last refleak buildbot is green again, so closing this.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35829] datetime: parse "Z" timezone suffix in fromisoformat()

2019-08-27 Thread Paul Ganssle


Paul Ganssle  added the comment:

> Defining isoformat() and fromisoformat() as functional inverses is misguided. 
> Indeed, it's not even true:

`isoformat()` is not the inverse of `fromisoformat()`, that doesn't work 
because there are multiple strings that isoformat() can create from any given 
datetime. There is, however, only one datetime that is represented by any given 
datetime (assuming you consider truncation to create a new datetime), so it is 
fine for fromisoformat() to be the inverse of isoformat().

I have explained the reason that was chosen for the contract in several places 
(including in this thread), so I won't bother to repeat it. I think from a 
practical point of view we should eventually grow more generalized ISO 8601 
parsing functionality, and the main question is what the API will look like. In 
dateutil.parser.isoparse, I still haven't figured out a good way to do feature 
flags.

> I'd be willing to work on a PR, but a change of this size probably needs to 
> through python-ideas first?

I don't think it *needs* to go to python-ideas, though it's probably a good 
idea to try and work out the optimal API in a post on the discourse ( 
discuss.python.org ), and the "ideas" category seems like the right one there. 
Please CC me (pganssle) if you propose modifications to the fromisoformat API 
on the discourse.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37827] IDLE Shell: add a terminal mode that responds to \a, \b, and \r

2019-08-27 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37936] gitignore file is too broad

2019-08-27 Thread miss-islington


miss-islington  added the comment:


New changeset 2f0440e6dba248ff1e2b46c063adfd8fcb923a34 by Miss Islington (bot) 
in branch '3.7':
bpo-37936: Remove some .gitignore rules that were intended locally. (GH-15542)
https://github.com/python/cpython/commit/2f0440e6dba248ff1e2b46c063adfd8fcb923a34


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37936] gitignore file is too broad

2019-08-27 Thread miss-islington


miss-islington  added the comment:


New changeset caf7a30efecef21def997ab214dc6c1604d90a84 by Miss Islington (bot) 
in branch '3.8':
bpo-37936: Remove some .gitignore rules that were intended locally. (GH-15542)
https://github.com/python/cpython/commit/caf7a30efecef21def997ab214dc6c1604d90a84


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37936] gitignore file is too broad

2019-08-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15228
pull_request: https://github.com/python/cpython/pull/15553

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37936] gitignore file is too broad

2019-08-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15227
pull_request: https://github.com/python/cpython/pull/15552

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37936] gitignore file is too broad

2019-08-27 Thread miss-islington


miss-islington  added the comment:


New changeset 8c9e9b0cd5b24dfbf1424d1f253d02de80e8f5ef by Miss Islington (bot) 
(Greg Price) in branch 'master':
bpo-37936: Remove some .gitignore rules that were intended locally. (GH-15542)
https://github.com/python/cpython/commit/8c9e9b0cd5b24dfbf1424d1f253d02de80e8f5ef


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37827] IDLE Shell: add a terminal mode that responds to \a, \b, and \r

2019-08-27 Thread Tal Einat


Tal Einat  added the comment:

Terry, thanks for the detailed writing of your thoughts on the matter and their 
context.

Serhiy's argument (in msg246602) is that different terminals interpret 
different control characters in different ways, and that we have no way of 
unifying their behavior.  This is true, and I will add that we should also not 
aim to fully emulate any single terminal nor multiple types of terminals.

On the other hand, there is a common ground where the vast majority of 
terminals do, in fact, behave very similarly WRT control characters.  For 
example, IDLE already does interpret '\n' in a special way (partially because 
the underlying Tk text widget does).  The same goes for '\t'.

I argue that we should instead *slightly* expand the set of control characters 
which IDLE interprets, to include a few more which are universally treated in a 
consistent manner.

Looking at the list of ASCII control characters on Wikipedia[1], I don't think 
any beyond \a, \b, \n, \r and \t are universal enough and in common enough use 
to merit inclusion.  (For reference, \a is for "bell".)

..[1]: https://en.wikipedia.org/wiki/C0_and_C1_control_codes


I find the suggestion to have more than a single "mode" for the IDLE shell 
contrary to the "simple and novice friendly" design principle that we are 
aiming for.  I also think that it would bring little added benefit to the great 
majority of our users.


As for other control characters and astral characters, I very much agree that 
we could do better than to have them often "garbled" as done by the Tk text 
widget.  I think this should be dealt with as a separate issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2019-08-27 Thread hai shi


hai shi  added the comment:

How about use a flag(such USING_OUT_NAMESPACE) to identify we use namespace or 
not?

For example:
subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
for key, value in vars(subnamespace).items():
if USING_OUT_NAMESPACE and not hasattr(namespace, key):
setattr(namespace, key, value)

--
nosy: +shihai1991

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37964] F_GETPATH is not available in fcntl.fcntl

2019-08-27 Thread Vinay Sharma


Vinay Sharma  added the comment:

I have opened a PR, but no reviewers, have been assigned.
Could you please look into that ?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37964] F_GETPATH is not available in fcntl.fcntl

2019-08-27 Thread Vinay Sharma


Change by Vinay Sharma :


--
keywords: +patch
pull_requests: +15226
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15550

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37964] F_GETPATH is not available in fcntl.fcntl

2019-08-27 Thread Christian Heimes


Christian Heimes  added the comment:

Since it's a feature request, I have reset the version list to 3.9.

--
nosy: +christian.heimes
stage:  -> needs patch
versions:  -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37964] F_GETPATH is not available in fcntl.fcntl

2019-08-27 Thread Vinay Sharma


New submission from Vinay Sharma :

F_GETPATH cmd/operator is not present in fcntl module.
This is specific to macos and is only available in macos.

https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html

This can be also be verified using `man fcntl`

--
components: Library (Lib)
messages: 350635
nosy: twouters, vinay0410
priority: normal
severity: normal
status: open
title: F_GETPATH is not available in fcntl.fcntl
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37963] No URL for docs of pth files

2019-08-27 Thread Thomas Güttler

New submission from Thomas Güttler :

if you google for "python pth" you get to the "sites" docs.

It would be very nice if you could create a direct URL to the docs of pth files.

This makes it easier to point new comers into the right direction if you answer 
questions at stackoverflow (or other places).

See: https://www.google.com/search?q=python+pth

--
messages: 350634
nosy: Thomas Güttler
priority: normal
severity: normal
status: open
title: No URL for docs of pth files

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37962] Improve ISO 8601 timezone support in the datetime.fromisoformat() method

2019-08-27 Thread Paul Ganssle


Paul Ganssle  added the comment:

This is a duplicate of #35829.

The reason that 'Z' is not supported is that `fromisoformat()` is not a general 
ISO 8601 parser, but rather is intended to be the inverse of `isoformat()`. See 
the documentation here: 
https://docs.python.org/dev/library/datetime.html#datetime.datetime.fromisoformat

The current state of #35829 is that expanding to support all of ISO 8601 is an 
option, but determining the scope an the API are a bit tricky. ISO 8601 is more 
complicated than most people think.

In the meantime, `dateutil.parser.isoparse` is intentionally scoped to parse 
all valid ISO 8601 datetimes.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> datetime: parse "Z" timezone suffix in fromisoformat()
type:  -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Could this be that the libc was outdated?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37064] Feature request: option to keep/add flags to pathfix.

2019-08-27 Thread Patrik Kopkan


Change by Patrik Kopkan :


--
pull_requests: +15225
pull_request: https://github.com/python/cpython/pull/15548

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Ran rebuild (in the BB UI) on that failed build (#1356), and test_os now passes:

0:22:52 load avg: 8.38 [339/419] test_os passed

Victor independently logged into the host and ran a from scratch build/test and 
test_os passes for him too (verifying my from scratch test results)

Only thing I can think of is a cached/inconsistent BB build environment after 
the host FreeBSD update, that cleared itself after the first build

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37962] Improve ISO 8601 timezone support in the datetime.fromisoformat() method

2019-08-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +belopolsky, p-ganssle

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37962] Improve ISO 8601 timezone support in the datetime.fromisoformat() method

2019-08-27 Thread Zeth


New submission from Zeth :

The datetime.datetime.fromisoformat() method unnecessarily rejects datetime 
strings that are valid under ISO 8601 if timezone uses the UTC  designator or 
it only has hours.

In ISO 8601, section 4.2.5.1: "When it is required to indicate the difference 
between local time and UTC of day, the representation of the difference can be 
expressed in hours and minutes, or hours only."

And Section 4.2.4, UTC shall be expressed "by the UTC designator [Z]".

A key use case of the latter is being able to parse JavaScript Date objects 
(e.g. dates that have come from a web frontend or a JSON document). This 
considerably improves the usefulness of the datetime.fromisoformat method.

--
messages: 350630
nosy: zeth
priority: normal
pull_requests: 15224
severity: normal
status: open
title: Improve ISO 8601 timezone support in the datetime.fromisoformat() method

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

> https://buildbot.python.org/all/#/builders/168/builds/1356

Just to confirm: test_os was run twice and was killed twice by signal 12.

0:00:04 load avg: 3.45 [  8/419/1] test_os crashed (Exit code -12)
...
Re-running failed tests in verbose mode
Re-running test_os in verbose mode
...
test_copy_file_range (test.test_os.FileTests) ... *** Signal 12

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Hmm... a test checkout of master/default on the host in question has 
test_copy_file_range{_*} passing:

[user@CURRENT-amd64:/usr/home/user/repos/cpython] ./python -m test -vvv test_os 
|grep range
...
test_copy_file_range (test.test_os.FileTests) ... ok
test_copy_file_range_invalid_values (test.test_os.FileTests) ... ok
test_copy_file_range_offset (test.test_os.FileTests) ... ok
...
Ran 280 tests in 2.503s

OK (skipped=45)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

It would be better if the FreeBSD kernel would return ENOSYS error code rather 
than killing the process with SIGSYS :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37957] Allow regrtest to receive a file with test (and subtests) to ignore

2019-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

FYI in the past, Fedora and RHEL packages skipped multiple tests using 
downstream patches. Hopefully, we managed to reenable almost all tests.

Currently in Fedora, the python3 package use regrtest -x to skip some tests:

  # Run the upstream test suite
  # test_gdb skipped on s390x:
  #   https://bugzilla.redhat.com/show_bug.cgi?id=1678277
  # test_gdb skipped everywhere:
  #   https://bugzilla.redhat.com/show_bug.cgi?id=1734327
  # test_distutils
  #   distutils.tests.test_bdist_rpm tests fail when bootstraping the Python
  #   package: rpmbuild requires /usr/bin/pythonX.Y to be installed
  LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
-wW --slowest -j0 \
%if %{with bootstrap}
-x test_distutils \
%endif
-x test_gdb \
%ifarch %{mips64}
-x test_ctypes \
%endif

https://src.fedoraproject.org/rpms/python3/blob/master/f/python3.spec

We could only skip some test methods, but it's simpler for us to skip a whole 
test file.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33944] Deprecate and remove pth files

2019-08-27 Thread qix-


qix-  added the comment:

-1

This would make `better_exceptions` irreparably un-ergonomic.

https://github.com/qix-/better-exceptions

.PTH files are commonly used to install development middleware in order to 
enhance the development and debugging experience.

I recognize the need for security, but could we instead focus on improving the 
security of the existing .PTH system instead of throwing out the baby with the 
bathwater?

The search "pth files python virus|malicious" on Google returns this issue. Is 
.PTH a previously exploited vector? This is like saying NPM's `install` scripts 
are a vector. I'm not going to be running code that I don't at least trust a 
little.

This issue reads like someone had a bad time with some poorly written Python 
code that was stuck inside a .PTH file, had to debug why it was causing a 
problem, and came here to cry about it (no offense, Barry).

Instead of improving it, the first inclination was to remove it altogether 
without any regard to its use-cases or the effects it would have on some 
packages that rely on it.

Let's improve it, not kill it.

--
nosy: +qix-

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

See Also: #26826

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37157] shutil: add reflink=False to file copy functions to control clone/CoW copies (use copy_file_range)

2019-08-27 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

See Also: #26826

--
nosy: +koobs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Possibly related:

https://reviews.freebsd.org/D20584 - Add a linux compatible copy_file_range(2) 
syscall

https://lists.freebsd.org/pipermail/freebsd-current/2019-July/073747.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

@Pablo Upgrade to latest CURRENT revision a few hours ago. Some system software 
is still updating. I'll push a rebuild on BB once complete. Stand by :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +koobs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

@koobs, did you changed recently the buildbot?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31956] Add start and stop parameters to the array.index()

2019-08-27 Thread Anders Lorentsen


Anders Lorentsen  added the comment:

As far as I can recall, the patch is generally speaking good to go. A number of 
discussions arose on various details, however. In any event, I'll take a look 
at it during the next few days.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Oh, FreeBSD, what have you done now.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-08-27 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +15223
pull_request: https://github.com/python/cpython/pull/15546

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37957] Allow regrtest to receive a file with test (and subtests) to ignore

2019-08-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Tests that fail on some platforms can be marked to skip in code.

One of the use cases of this feature is for people to package Python at 
distributions or companies and want to run the test suite without modifying the 
code or applying patches.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-27 Thread Julien Danjou


Change by Julien Danjou :


--
keywords: +patch
pull_requests: +15222
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15545

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37961] Tracemalloc traces do not include original stack trace length

2019-08-27 Thread Julien Danjou


New submission from Julien Danjou :

When using the tracemalloc module, the maximum number of frames that are 
captured is specified at startup via a value to the `start` method.

However, if the number of frames is truncated, there's no way to know the 
original length of the stack traces.

--
components: Interpreter Core
messages: 350616
nosy: jd
priority: normal
severity: normal
status: open
title: Tracemalloc traces do not include original stack trace length
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-08-27 Thread Christian Heimes


Christian Heimes  added the comment:

I have created a PR that implements Greg's proposal 
https://bugs.python.org/issue34651#msg325302

--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-08-27 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
pull_requests: +15221
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15544

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37960] repr() of buffered and text streams silences too many exceptions

2019-08-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +15220
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15543

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37960] repr() of buffered and text streams silences too many exceptions

2019-08-27 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

__repr__() implementations of buffered and text streams try to include the 
value of "name" and "mode" attributes in the result. But they silence too wide 
range of exceptions (all subclasses of Exception) when try to get these values. 
This includes such exceptions as MemoryError or RecursionError which can be 
occurred in virtually any code.

The proposed PR narrows the range of silenced exceptions to the necessary 
minimum: expected AttributeError and ValueError. The latter is raised if the 
underlying stream was detached.

--
components: IO, Library (Lib)
messages: 350614
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: repr() of buffered and text streams silences too many exceptions
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37960] repr() of buffered and text streams silences too many exceptions

2019-08-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +benjamin.peterson, stutzbach

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37935] Improve performance of pathlib.scandir()

2019-08-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think using the timeit module is enough. For more precise benchmarking you 
may need to use the pyperf module, but I think this is not a case.

For example, something like:

./python -m timeit -s "from pathlib import Path; p = Patch('...')" "for x 
in p.rglob('...'): pass"

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37905] Improve docs for NormalDist

2019-08-27 Thread Christoph Deil


Christoph Deil  added the comment:

Thank you, Raymond!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36205] Python 3.7 and 3.8 process_time is not reported correctly when built on older macOS versions

2019-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

On PR 12287, Ned Deily wrote:
> I still think it would be better to have a test for this case since the 
> problem embarrassingly went undetected for quite some time. But I'll let some 
> one else deal with it if they care to.

test_time already contains a functional test on time.process_time() to ensure 
that sleep isn't included in process time:

def test_process_time(self):
# process_time() should not include time spend during a sleep
start = time.process_time()
time.sleep(0.100)
stop = time.process_time()
# use 20 ms because process_time() has usually a resolution of 15 ms
# on Windows
self.assertLess(stop - start, 0.020)

info = time.get_clock_info('process_time')
self.assertTrue(info.monotonic)
self.assertFalse(info.adjustable)

Writing tests on clocks is really hard, since every single platform has a 
different resolution. Previous attempts to write "accurate" tests on clock 
caused a lot of flaky tests making our CIs fail randomly. We removed some tests 
because of that.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36205] Python 3.7 and 3.8 process_time is not reported correctly when built on older macOS versions

2019-08-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@raymond, as to your question in msg350586: The release installers are 
generally build on the oldest release of the OS targeted by the installer. 
That's to ensure that the binaries actually work there.

It should be possible to build on newer releases, but that will require patches 
to CPython because the build will otherwise use symbols not available on older 
releases.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37959] test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT buildbot

2019-08-27 Thread STINNER Victor


New submission from STINNER Victor :

https://buildbot.python.org/all/#/builders/168/builds/1356

test_nop (test.test_os.FSEncodingTests) ... ok
test_access (test.test_os.FileTests) ... ok
test_closerange (test.test_os.FileTests) ... ok
test_copy_file_range (test.test_os.FileTests) ... *** Signal 12
Stop.
make: stopped in /usr/home/buildbot/python/3.x.koobs-freebsd-current/build
program finished with exit code 1
elapsedTime=1562.592656

man signal says:

"12SIGSYS   create core imagenon-existent system call invoked"

I bet that the "non-existent system call" is: copy_file_range. The configure 
script says:

"checking for copy_file_range... yes"


Se also bpo-37711: "regrtest: re-run failed tests in subprocesses".

--
components: Tests
messages: 350609
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test_os.test_copy_file_range() killed by SIGSYS (12) on FreeBSD CURRENT 
buildbot
versions: Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37935] Improve performance of pathlib.scandir()

2019-08-27 Thread Shai


Shai  added the comment:

I'm new to contributing here. I've never done benchmarking before.

I'd appreciate it if you could provide a guide to benchmarking.
You could look at the changes I made in the pull request (PR 15331). They're 
easy to follow and I think that removing a useless call to list() should 
enhance the performance, but I'd like to have benchmarking to back this up, so 
if someone more experienced could do this or at least provide a link to a 
guide, I'd really appreciate it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37957] Allow regrtest to receive a file with test (and subtests) to ignore

2019-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

> Tests that fail on some platforms can be marked to skip in code.

We provide best-effort support for AIX, but I consider that Solaris is no 
longer supported, and so I would prefer to avoid code specific to Soliars in 
the Python source code. Except if Pablo wants to provide again best-effort 
support for Solaris?
https://pythondev.readthedocs.io/platforms.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37957] Allow regrtest to receive a file with test (and subtests) to ignore

2019-08-27 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Tests that fail on some platforms can be marked to skip in code.

For example:

@unittest.skipIf(sys.platform.startswith('aix'),
 'bpo-29972: broken test on AIX')
def test_strcoll_with_diacritic(self):
self.assertLess(locale.strcoll('à', 'b'), 0)

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37935] Improve performance of pathlib.scandir()

2019-08-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Could you please provide any microbenchmarks that show the performance 
improvement?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37935] Improve performance of pathlib.scandir()

2019-08-27 Thread Shai


Shai  added the comment:

>From the docs (https://docs.python.org/3/library/os.html#os.scandir.close):

"This is called automatically when the iterator is exhausted or garbage 
collected, or when an error happens during iterating. However it is advisable 
to call it explicitly or use the with statement.".

The iterator is indeed closed properly, but the docs state that it's still 
advisable to close it explicitly, which is why I wrapped it in a with statement.

However, the more important change is that the iterator is no longer converted 
into a list, which should reduce the iterations from 2N to N, when N is the 
number of entries in the directory (one N when converting to list and another 
one when iterating it). This should enhance the performance of the functions 
that use scandir.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36205] Python 3.7 and 3.8 process_time is not reported correctly when built on older macOS versions

2019-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, nicely spotted Rajiv Vijayakumar and thanks for the fix!


> instead of computing the total time as utime+stime, the code performs 
> utime+utime, which explains the doubling observed.

Ooops, stupid me :-) I introduced the bug in:

commit c29b585fd4b5a91d17fc5dd41d86edff28a30da3
Author: Victor Stinner 
Date:   Thu Nov 2 07:28:27 2017 -0700

bpo-31784: Implement PEP 564: add time.time_ns() (#3989)

It seems like macOS was the most visible impacted platform. Windows and Linux 
has different implementations (GetProcessTimes and 
clock_gettime(CLOCK_PROCESS_CPUTIME_ID)).

Note: I wrote an article about time.perf_counter_ns() added in Python 3.7 
(perf_counter, not process_time):
https://vstinner.github.io/python37-perf-counter-nanoseconds.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27961] remove support for platforms without "long long"

2019-08-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This issue was closed 2.5 years ago. Would not be better to open a new issue 
for new commits?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37957] Allow regrtest to receive a file with test (and subtests) to ignore

2019-08-27 Thread STINNER Victor


STINNER Victor  added the comment:

I'm fine with adding an --excludefile=filename option to regrtest. Do you want 
to try to implement it? A test can be added in test_regrtest.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36792] [Windows] time: crash on formatting time with de_DE locale

2019-08-27 Thread Carsten Fuchs


Change by Carsten Fuchs :


--
nosy: +Carsten Fuchs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com