[issue39656] shebanged scripts can escape from `venv` depending on how it was created

2020-03-17 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 58ec58a42bece5b2804b178c7a6a7e67328465db by Anthony Sottile in 
branch 'master':
bpo-39656: Ensure `bin/python3.#` is always present in virtual environments on 
POSIX (GH-19030)
https://github.com/python/cpython/commit/58ec58a42bece5b2804b178c7a6a7e67328465db


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue39988] Remove AugLoad and AugStore expression context from AST

2020-03-17 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

AugLoad and AugStore are never exposed to the user. They are not generated by 
the parser and the compiler does not accept it.

>>> from ast import *
>>> tree = Module(body=[AugAssign(target=Name(id='x', ctx=AugStore()), 
>>> op=Add(), value=Constant(value=1))], type_ignores=[])
>>> compile(fix_missing_locations(tree), 'sample', 'exec')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: expression must have Store context but has AugStore instead

They are only used in temporary nodes created by the compiler. But the support 
of AugLoad and AugStore is spread across many sites in the compiler, adding 
special cases which have very little in common with the "normal" cases of Load, 
Store and Del.

The proposed PR removes AugLoad and AugStore. It moves support of the augmented 
assignment into a separate function and cleans up the rest of the code. This 
saves around 70 lines of handwritten code and around 60 lines of generated code.

The PR depends on issue39987. See also similar issue39969.

--
components: Interpreter Core
messages: 364390
nosy: BTaskaya, benjamin.peterson, brett.cannon, pablogsal, serhiy.storchaka, 
yselivanov
priority: normal
severity: normal
status: open
title: Remove AugLoad and AugStore expression context from AST
type: enhancement
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



[issue39988] Remove AugLoad and AugStore expression context from AST

2020-03-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39989] Output closing parenthesis in ast.dump() on separate line

2020-03-17 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently ast.dump() in multiline mode (see issue37995) appends closing 
parenthesis to the end of the line:

>>> import ast
>>> node = ast.parse('spam(eggs, "and cheese")')
>>> print(ast.dump(node, indent=3))
Module(
   body=[
  Expr(
 value=Call(
func=Name(id='spam', ctx=Load()),
args=[
   Name(id='eggs', ctx=Load()),
   Constant(value='and cheese')],
keywords=[]))],
   type_ignores=[])

It uses vertical space more efficiently (which is especially important on 
Windows console).

But I got a feedback about output closing parenthesis on separate lines 
(msg363783):

Module(
   body=[
  Expr(
 value=Call(
func=Name(id='spam', ctx=Load()),
args=[
   Name(id='eggs', ctx=Load()),
   Constant(value='and cheese')
],
keywords=[]
 )
  )
   ],
   type_ignores=[]
)

It looks more "balanced", but less vertical space efficient. It adds almost 300 
lines to 57 examples in Doc/library/ast.rst. And after omitting optional list 
arguments like keywords=[] and type_ignores=[] (see issue39981) the stairs of 
parenthesis will look even longer.

The proposed PR changes the output of ast.dump() by moving closing parenthesis 
on separate lines. I am still not sure what output is better.

--
components: Library (Lib)
messages: 364391
nosy: benjamin.peterson, pablogsal, rhettinger, serhiy.storchaka, terry.reedy
priority: normal
severity: normal
status: open
title: Output closing parenthesis in ast.dump() on separate line
type: enhancement
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



[issue39989] Output closing parenthesis in ast.dump() on separate line

2020-03-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39973] The documentation for PyObject_GenericSetDict() is incorrect

2020-03-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +18391
pull_request: https://github.com/python/cpython/pull/19040

___
Python tracker 

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



[issue39973] The documentation for PyObject_GenericSetDict() is incorrect

2020-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a45b695b9fcfbbb0a087222abc5c8d691a7d2770 by Zackery Spytz in 
branch 'master':
bpo-39973: Fix the docs for PyObject_GenericSetDict() (GH-19026)
https://github.com/python/cpython/commit/a45b695b9fcfbbb0a087222abc5c8d691a7d2770


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39973] The documentation for PyObject_GenericSetDict() is incorrect

2020-03-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18392
pull_request: https://github.com/python/cpython/pull/19041

___
Python tracker 

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



[issue39973] The documentation for PyObject_GenericSetDict() is incorrect

2020-03-17 Thread miss-islington


miss-islington  added the comment:


New changeset 4e3a7f9205112e7da1032aa802edf84379b134fc by Miss Islington (bot) 
in branch '3.7':
bpo-39973: Fix the docs for PyObject_GenericSetDict() (GH-19026)
https://github.com/python/cpython/commit/4e3a7f9205112e7da1032aa802edf84379b134fc


--

___
Python tracker 

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



[issue39973] The documentation for PyObject_GenericSetDict() is incorrect

2020-03-17 Thread miss-islington


miss-islington  added the comment:


New changeset da1fe768e582387212201ab8737a1a5f26110664 by Miss Islington (bot) 
in branch '3.8':
bpo-39973: Fix the docs for PyObject_GenericSetDict() (GH-19026)
https://github.com/python/cpython/commit/da1fe768e582387212201ab8737a1a5f26110664


--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2020-03-17 Thread Berry Schoenmakers

Berry Schoenmakers  added the comment:

There seems to be a slight mixup with the built-in pow() function in Python 
3.8.2.

Currently, under https://docs.python.org/3/library/functions.html#pow it says:

Changed in version 3.9: Allow keyword arguments. Formerly, only 
positional arguments were supported.

I think this should be into "Changed in version 3.8 ... ", as pow(3,4, mod=5) 
actually works in Python 3.8.2.

The "What’s New In Python 3.8" also needs to be changed accordingly. 
In https://docs.python.org/3/whatsnew/3.8.html#positional-only-parameters it 
says:

One use case for this notation is that it allows pure Python functions 
to fully emulate behaviors of existing C coded functions. For example, the 
built-in pow() function does not accept keyword arguments:
def pow(x, y, z=None, /):
"Emulate the built in pow() function"
r = x ** y
return r if z is None else r%z

This example can simply be dropped now.

--
nosy: +lschoe

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2020-03-17 Thread Mark Dickinson


Change by Mark Dickinson :


--
pull_requests: +18393
pull_request: https://github.com/python/cpython/pull/19042

___
Python tracker 

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



[issue39973] The documentation for PyObject_GenericSetDict() is incorrect

2020-03-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
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



[issue38237] Expose meaningful keyword arguments for pow()

2020-03-17 Thread Mark Dickinson


Mark Dickinson  added the comment:

> This example can simply be dropped now.

It could be, but it would be better to replace it with a different example that 
works. Any suggestions?

--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2020-03-17 Thread Ammar Askar


Ammar Askar  added the comment:

In my original PR I changed it to divmod: 
https://github.com/python/cpython/pull/16302/files#diff-986275b975a33c44c0aba973362516fa

--

___
Python tracker 

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



[issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines

2020-03-17 Thread Yi Luan


Yi Luan  added the comment:

Hi Paul,

Yes, I totally agree with you, and I should follow your advice and not to pass 
timestamps as representations of arbitrary datetime for interop usage. However 
in my particular case, I'm not the person who can make such type of decisions.

Perhaps I'm very picky here but I think it would be more natural for  
`timestamp()` types of functions to return the arbitrary timestamp value(or 
vise versa) regardless of which timezone I'm in.When interop and 
international operations were involved, Python's behavior might just add 
another level of conversion into the process and create more unnecessary 
confusion.

I know I should always be aware of the timezone my machine is in and adding a 
tzinfo in the code for cross timezone operations in Python. But a simple code 
like:
>>> datetime.datetime(2019, 1, 1, 0, 0, 0).timestamp()

would generate different result on different machines across different timezone 
is, from my point of view, a confusing behavior, because, I can only be sure 
that I am the cautious one and putting tzinfo in, however, if there were 
multiple person in different timezone that didn't put tzinfo in and using 
different programming tools, the potential results of programs would be quite 
confusing (timestamp generated by python fed into other programming tools, or 
vise versa), but I understand that it is not a sound practice in the first 
place.

Also, from my point of view, when not presented with tzinfo, the machine should 
not guess what timezone the programmer want this datetime.datetime(2019, 1, 1, 
0, 0, 0) to be in, not to think that because my machine is in such such 
timezone so the timestamp() generated from datetime.datetime(2019, 1, 1, 0, 0, 
0) would be 2019/1/1 00:00:00 minus or plus some hours.

As you've mentioned:

When you have a naive datetime (with no tzinfo), the only options are to pick 
the time zone it represents and convert to UTC or to throw an error and say, 
"We don't know what time zone this represents, so we cannot do this operation." 
Python 2 used to throw an exception, but in Python 3 naive datetimes represent 
local times.


I think the appropriate option is to not pick any time zone at all, just 
viewing it as an "UTC"(return nominal value of timestamp()) other than 
"convert"-ing it to UTC(shifting by N hours based on the running machine's 
timezone), since we don't have any knowledge on which timezone this datetime 
object represents, we can't know if we have converted it truly to UTC or not, 
and to me, why bother shifting it by some hours and timestamp() it anyway, 
that's just another layer of calculation that could go wrong.

Anyways, the above is just my personal opinion, obviously there is definitely 
nothing wrong with viewing an arbitrary datetime as a local time.
Since you've mentioned that this behavior is intended, I'd assume and 
understand that this behavior is a result of balancing a lot of other choices.
But from my point of view, as a clueless user, it might give me some confusion 
as to what the actual timestamp() I'm generating, or what the actual datetime 
I've imported when presented with an arbitrary timestamp. And generating 
timestamp on naive datetime objects regardless of what timezone the machine is 
in seems to be a more straight forward and clear thing to do.

Again thanks very much for baring with me with this discussion.

--

___
Python tracker 

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



[issue39990] help output should make use of typing.get_type_hints

2020-03-17 Thread Nguyễn Gia Phong

New submission from Nguyễn Gia Phong :

With PEP 563, it is legal to annotate a function as follows

def foo(bar: 'int') -> 'bool': pass

Currently, help(foo) would print the exact signature in foo.__annotations__ and 
it's not really pretty.  My proposal is to use the type hints from 
typing.get_type_hints to make documentations more readable from the user's 
perspective.  I might not be aware of all use cases and disadvantages of this 
proposal however.

--
assignee: docs@python
components: Documentation
messages: 364399
nosy: McSinyx, docs@python
priority: normal
severity: normal
status: open
title: help output should make use of typing.get_type_hints

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2020-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is hard to find a builtin which could be easy and clearly implemented in 
Python (it means no use of dunder methods). Maybe sorted()?

def sorted(iterable, /, *, key=None, reverse=False):
"""Emulate the built in sorted() function"""
result = list(iterable)
result.sort(key=key, reverse=reverse)
return result

Although I think that this use case is less important. The primary goal of the 
feature is mentioned at the end of the section -- easy way to implement 
functions which accept arbitrary keyword arguments.

--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2020-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

divmod() should be implemented via __divmod__ and __rdivmod__. And they should 
be looked up on the type, not instance. There is no easy way to express it in 
Python accurately. This would make the example too complex.

--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2020-03-17 Thread Ammar Askar


Ammar Askar  added the comment:

I don't think that matters. The example is supposed to just serve as an 
illustration, it doesn't need to encode the dunder dispatch semantics. The 
already existing example doesn't check for a __pow__.

I'd picture it just as:

return x//y, x%y

--

___
Python tracker 

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



[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-17 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Update to BB complete. Rebuilding:

https://buildbot.python.org/all/#/builders/18/builds/162 and
https://buildbot.python.org/all/#/builders/152/builds/409

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Stefan Krah


Stefan Krah  added the comment:

A focused issue report would include at least the following:

  1) Acknowledge that gcc builds work on the AIX buildbots (a
 fact that has been entirely ignored so far).

  2) State the exact regression: msg364373 (which was also ignored,
 are you using xlc or xlc_r?) says that there have always been
 problems with xlc unless configured in a very specific manner.

 Then obviously we need the exact Python code that worked in
 3.7.6 but not in 3.7.7.


In short, given the flakiness of the xlc toolchain I'm not even
sure if anything can be classified as a regression. Most xlc users
I've talked to have switched to gcc.

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Stefan Krah


Stefan Krah  added the comment:

It is also instructive how Granlund views xlc:

https://gmplib.org/list-archives/gmp-bugs/2010-November/002119.html

--

___
Python tracker 

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



[issue39990] help output should make use of typing.get_type_hints

2020-03-17 Thread Nguyễn Gia Phong

Change by Nguyễn Gia Phong :


--
type:  -> enhancement

___
Python tracker 

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



[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

> https://buildbot.python.org/all/#/builders/152/builds/409

That's AMD64 FreeBSD Shared 3.x: there are still tons of SCTP failures.

"Log: sendfile() does currently not support SCTP sockets. Therefore, fail the 
call."

I don't understand why the test passed previously... was it simply skipped?

Test on FreeBSD 12.1:
---
vstinner@freebsd$ uname -a
FreeBSD freebsd 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC  amd64

vstinner@freebsd$ ./python -m test test_socket -v -m '*SCTP*'
== CPython 3.9.0a4+ (heads/master:a45b695b9f, Mar 17 2020, 10:42:05) [Clang 
8.0.1 (tags/RELEASE_801/final 366581)]
== FreeBSD-12.1-RELEASE-p2-amd64-64bit-ELF little-endian
== cwd: /usr/home/vstinner/python/master/build/test_python_1636
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 0.23 Run tests sequentially
0:00:00 load avg: 0.23 [1/1] test_socket
testSendmsg (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgAfterClose (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgAncillaryGenerator (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgArray (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgBadArgs (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgBadCmsg (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgBadMultiCmsg (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgDataGenerator (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgDontWait (test.test_socket.SendmsgSCTPStreamTest) ... skipped 
'MSG_DONTWAIT not known to work on this platform when sending'
testSendmsgExcessCmsgReject (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgExplicitNoneAddr (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgGather (test.test_socket.SendmsgSCTPStreamTest) ... ok
testSendmsgTimeout (test.test_socket.SendmsgSCTPStreamTest) ... ok
testRecvmsg (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgBadArgs (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgEOF (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgExplicitDefaults (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgFromSendmsg (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgLongAncillaryBuf (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgOverflow (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgPeek (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgShortAncillaryBuf (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgShorter (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgTimeout (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsgTrunc (test.test_socket.RecvmsgSCTPStreamTest) ... ok
testRecvmsg (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgAfterClose (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgEOF (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgExplicitDefaults (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgFromSendmsg (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgIntoArray (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgIntoBadArgs (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgIntoGenerator (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgIntoScatter (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgLongAncillaryBuf (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgOverflow (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgPeek (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgShortAncillaryBuf (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgShorter (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgTimeout (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok
testRecvmsgTrunc (test.test_socket.RecvmsgIntoSCTPStreamTest) ... ok

--

Ran 42 tests in 0.327s

OK (skipped=1)

== Tests result: SUCCESS ==

1 test OK.

Total duration: 746 ms
Tests result: SUCCESS
---

--

___
Python tracker 

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



[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-03-17 Thread Steve Dower


Steve Dower  added the comment:

Yeah, this is on me now. Hopefully we can just pull in the new sources and 
they'll be fine, but historically it's taken a couple of days/weeks to get the 
issues ironed out.

Unfortunately, I'm still on a flaky internet connection (but only for 
GitHub.com for some reason), so I can't clone the repos I need. But someone 
else should be able to submit PRs that I can merge:

* clone https://github.com/python/cpython-source-deps/
* disable autocrlf
* checkout tcl, delete all files (except README.md) and extract tcl-8.6.10
* git add --all; git tag tcl-core-8.6.10.0; push and send PR
* checkout tk, delete all files (except README.md) and extract tk-8.6.10
* git add --all; git tag tk-8.6.10.0; push and send PR

Once those are merged:
* checkout cpython repo and update version number in PCbuild/tcltk.props and 
PCbuild/get_externals.bat
* test build with PCbuild/prepare_tcltk.bat, then build with PCbuild/build.bat
* push, send PR

Before that is merged, I'll branch in cpython-bin-deps so that PRs keep 
building with the older version, then I can trigger the real build. I'll likely 
need somebody to download the built files and check them into the 
cpython-bin-deps repo, but I'll give it a go myself first in case my connection 
is up to it.

Any volunteers?

--
assignee: ned.deily -> steve.dower

___
Python tracker 

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



[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like there is a race condition in some tests. Running the same test 
twice on the idle buildbot worker fails randomly:

130-CURRENT-amd64% ./python -m test test_socket -v -m 
test.test_socket.RecvmsgSCTPStreamTest.testRecvmsgAfterClose
== CPython 3.9.0a4+ (heads/master:6ff79f6582, Mar 16 2020, 22:07:47) [Clang 
10.0.0 (g...@github.com:llvm/llvm-project.git llvmorg-10.0.0-rc3-1-gc290c
== FreeBSD-13.0-CURRENT-amd64-64bit-ELF little-endian
== cwd: /usr/home/haypo/python/master/build/test_python_31444
== CPU count: 2
== encodings: locale=UTF-8, FS=utf-8
(...)
testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest) ... ok
(...)

130-CURRENT-amd64% ./python -m test test_socket -v -m 
test.test_socket.RecvmsgSCTPStreamTest.testRecvmsgAfterClose
(...)
testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest) ... ERROR

==
ERROR: testRecvmsgAfterClose (test.test_socket.RecvmsgSCTPStreamTest)
--
Traceback (most recent call last):
  File "/usr/home/haypo/python/master/Lib/test/test_socket.py", line 342, in 
_setUp
self.__setUp()
  File "/usr/home/haypo/python/master/Lib/test/test_socket.py", line 2533, in 
setUp
super().setUp()
  File "/usr/home/haypo/python/master/Lib/test/test_socket.py", line 646, in 
setUp
conn, addr = self.serv.accept()
  File "/usr/home/haypo/python/master/Lib/socket.py", line 293, in accept
fd, addr = self._accept()
ConnectionAbortedError: [Errno 53] Software caused connection abort
(...)

--

___
Python tracker 

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



[issue39952] Using VS2019 to automatically build Python3 and it failed to build

2020-03-17 Thread Steve Dower


Steve Dower  added the comment:

Hi Lin, please look me up on Teams and we can chat about this. I haven't heard 
about this effort and I'd love to know what you're working on.

---

The last error is because the VS Setup team has never updated their package to 
include v142 libs 
(https://www.nuget.org/packages/Microsoft.VisualStudio.Setup.Configuration.Native/)

If you're prepared to make modifications, then it's probably easiest to 
backport the change we made in Python 3.7 to shell out to vswhere.exe instead 
of directly enumerating installs. See Lib/distutils/_msvccompiler.py (it's 
probably safe to take the entire file and just remove the 
_distutils_findvs.vcxproj project).

Or if you know that the .lib format is compatible, you could update the 
AdditionalLibraryDirectories value in _distutils_findvs.vcxproj to not use 
$(PlatformToolset) and just specify v141.

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Acknowledge that gcc builds work on the AIX buildbots (a fact that has been 
> entirely ignored so far).

I do acknowledge that. I am not saying that I am sure there is a bug in the 
code. For what I know at this point
it may be something with xlc, with the OS itself, with the libc version or 
something misconfigured on the machine.

The only thing I know is that before I could run the test suite without any 
problem on 3.7.6 and now I cannot
in 3.7.7, and because 3.7 a maintenance branch I though this is a possible 
regression, so I reported it.

> are you using xlc or xlc_r?

I am using xlc_r. I am saying xlc because that is the name of the compiler. The 
_r suffix activates thread-safe compilation (which
I am doing). Apologies for the confusion.

> State the exact regression

The **exact** regression is that I could run the test suite without any crash 
or freeze on this AIX system
with 3.7.6 and I cannot in 3.7.7. At the very least this is due to the fact 
that there is a new test that crashes/hangs.
Why this happens I still have no idea as I am currently investigating. 
Debugging on AIX is not a pleasant task.


> n short, given the flakiness of the xlc toolchain I'm not even
sure if anything can be classified as a regression. Most xlc users
I've talked to have switched to gcc.

I notified the behaviour different here so we can discuss about this as a team. 
If we decide that this is xlc's fault or
is not worth to investigate or that because AIX is not really fully supported 
we do not want to spend resources I can totally
understand it. I thought this was important enough because this change was in 
3.7, which is supposed to be stable across minor
releases (the same applies for 3.8 if the problem also appears there).

--

___
Python tracker 

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



[issue39989] Output closing parenthesis in ast.dump() on separate line

2020-03-17 Thread Mark Dickinson


Mark Dickinson  added the comment:

This feels like something that's very much down to personal preference. 

I also prefer the closing "]" and ")" characters on their own lines, but I'd be 
happy with an argument to ast.dump giving me that option.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address

2020-03-17 Thread STINNER Victor


New submission from STINNER Victor :

My FreeBSD VM has a NIC with the IPv6 address fe80::5054:ff:fe9: local-link 
IPv6 address. It's used by uuid._netstat_getnode() as a MAC address, but it 
seems like this IPv6 address doesn't respect RFC 4122 and so should be skipped.

_find_mac_under_heading() should reject IPv6 address: only use MAC address.


vstinner@freebsd$ uname -a
FreeBSD freebsd 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC  amd64

==
FAIL: test_netstat_getnode (test.test_uuid.TestInternalsWithExtModule)
--
Traceback (most recent call last):
  File "/usr/home/vstinner/python/master/Lib/test/test_uuid.py", line 767, in 
test_netstat_getnode
self.check_node(node, 'netstat')
  File "/usr/home/vstinner/python/master/Lib/test/test_uuid.py", line 736, in 
check_node
self.assertTrue(0 < node < (1 << 48),
AssertionError: False is not true : fe805054fffe9 is not an RFC 4122 node ID

==
FAIL: test_netstat_getnode (test.test_uuid.TestInternalsWithoutExtModule)
--
Traceback (most recent call last):
  File "/usr/home/vstinner/python/master/Lib/test/test_uuid.py", line 767, in 
test_netstat_getnode
self.check_node(node, 'netstat')
  File "/usr/home/vstinner/python/master/Lib/test/test_uuid.py", line 736, in 
check_node
self.assertTrue(0 < node < (1 << 48),
AssertionError: False is not true : fe805054fffe9 is not an RFC 4122 node ID



It's using a qemu VM run by virt-manager.

fe805054fffe9 seems to be the MAC address of my vtnet network interface:

vstinner@freebsd$ netstat -ian 
NameMtu Network   Address  Ipkts Ierrs IdropOpkts Oerrs 
 Coll
vtnet  1500   52:54:00:9d:0e:6710017 0 0 8174 0 
0
vtnet - fe80::%vtnet0 fe80::5054:ff:fe90 - -4 - 
-
vtnet - 192.168.122.0 192.168.122.458844 - - 8171 - 
-
lo0   16384   lo0 260148 0 0   260148 0 
0
lo0   - ::1/128   ::1193 - -  193 - 
-
  ff01::1%lo0  
  ff02::2:2eb7:74fa
  ff02::2:ff2e:b774
  ff02::1%lo0  
  ff02::1:ff00:1%lo
lo0   - fe80::%lo0/64 fe80::1%lo0  0 - -0 - 
-
  ff01::1%lo0  
  ff02::2:2eb7:74fa
  ff02::2:ff2e:b774
  ff02::1%lo0  
  ff02::1:ff00:1%lo
lo0   - 127.0.0.0/8   127.0.0.1   259955 - -   259955 - 
-
  224.0.0.1

--
components: Tests
messages: 364412
nosy: barry, vstinner
priority: normal
severity: normal
status: open
title: test_uuid.test_netstat_getnode() fails on FreeBSD VM: 
uuid._netstat_getnode() uses IPv6 address as MAC address
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



[issue24916] In sysconfig, don't rely on sys.version format

2020-03-17 Thread Thomas Kluyver


Thomas Kluyver  added the comment:

Serhiy, I think you fixed the part that was actually likely to cause problems a 
few years ago in issue #25985 & commit 885bdc4946890f4bb80557fab80c3874b2cc4d39 
. Using sys.version[:3] to get a short version like 3.8 was what I wanted to 
fix.

People are presumably still trying to change the other bits because there's 
still a FIXME comment. If we're happy with the current code, I think we can 
remove that comment and close the issue.

--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2020-03-17 Thread Berry Schoenmakers


Berry Schoenmakers  added the comment:

Maybe a use case in this direction: int(x, base=10).
Because, if you type 

int(x='3', base=12)

you get

TypeError: 'x' is an invalid keyword argument for int()

and x needs to be a positional-only to program this yourself.

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Stefan Krah


Stefan Krah  added the comment:

"The **exact** regression is that I could run the test suite without any crash 
or freeze on this AIX system
with 3.7.6 and I cannot in 3.7.7. At the very least this is due to the fact 
that there is a new test that crashes/hangs."


In other words, contrary to your earlier dismissal, you did NOT
run _decimal on AIX with MAX_PREC but just ran the 3.7.6 tests
that do not include any tests with MAX_PREC.

--

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

> In other words, contrary to your earlier dismissal, you did NOT
run _decimal on AIX with MAX_PREC but just ran the 3.7.6 tests
that do not include any tests with MAX_PREC.

I did, and it raises MemoryError:

❯ uname -a
AIX 1 7 powerpc 00CCAD974C00 AIX

❯ python3.7 --version
Python 3.7.6

❯ python3.7 Lib/test/test_decimal.py

...

==
ERROR: test_maxcontext_exact_arith (__main__.CWhitebox)
--
Traceback (most recent call last):
  File "Lib/test/test_decimal.py", line 5506, in test_maxcontext_exact_arith
self.assertEqual(Decimal(4).sqrt(), 2)
MemoryError

--

___
Python tracker 

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



[issue39992] Windows line endings of pyc file detected on Ubuntu

2020-03-17 Thread Vladimir

New submission from Vladimir :

I have problem to run pyc file on one machine with Ubuntu Server 18.04.4 LTS.

This is my source code of the file:

#!/root/PycharmProjects/Project/venv/bin/python3.7
print("Hi")

When I compile it in python console with commands:

import py_compile
py_compile.compile('test2.py')

I get test2.cpython-37.pyc file. Then I add execution access by

chmod +x test2.cpython-37.pyc

If I run

./test2.cpython-37.pyc

on first machine (Ubuntu Server 18.04.4 LTS) I get simple "Hi".

But if I run similarly compiled file on other machine with the same OS - Ubuntu 
Server 18.04.4 LTS, I get:

./test2.cpython-37.pyc: line 1: $'B\r\r': command not found
./test2.cpython-37.pyc: line 2: syntax error near unexpected token `)'
./test2.cpython-37.pyc: line 2: `z�p^=�@s
  ed�dS)ZHiN)�print�rrtest2.py�'

It looks like it is reading Windows line endings. But why? It is created, 
compiled and run on Ubuntu machine.

How can I solve this issue, and run this pyc file with the right result on 
second machine?

--
messages: 364417
nosy: vladinko0
priority: normal
severity: normal
status: open
title: Windows line endings of pyc file detected on Ubuntu
versions: Python 3.7

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Just to be clear: I am saying that the *exact* regression is manifested with 
the new test because that is the behavioural difference that I experienced and 
how I found this problem. 

> but just ran the 3.7.6 tests that do not include any tests with MAX_PREC.

Independently on other considerations, If the test suite fails in 3.7.7 and 
succeeds in 3.7.6 that is a regression.

--

___
Python tracker 

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



[issue39992] Windows line endings of pyc file detected on Ubuntu

2020-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

pyc files are not executable files. If you can run it on your machine it means 
that you have installed some loader hook which allow you to run files which are 
not machine executable files and not shell scripts. It seems it is not 
installed on your other machine. This hook is not a part of Python. You have to 
find what additional software is installed on your first machine and install 
the necessary parts on your other machine.

--
nosy: +serhiy.storchaka
resolution:  -> third party
stage:  -> 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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Stefan Krah


Stefan Krah  added the comment:

Sorry, I'm reacting like Granlund now and close. These discussions
lead nowhere.

--
status: open -> closed

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

After some debugging, I discovered that the new test succeeds if I configure 
and compile CPython without 'OBJECT_MODE=64' set.

--

___
Python tracker 

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



[issue39988] Remove AugLoad and AugStore expression context from AST

2020-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is possible also to get rid of the ctx argument at all. The context may be 
determined by the parent nodes. But it is larger and breaking change, so I'll 
open a separate issue for it.

--

___
Python tracker 

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



[issue31895] How to implement api in python website

2020-03-17 Thread sanjeev


sanjeev  added the comment:

native support for converting
https://www.extam.com/

--
nosy: +sanjeev091
title: Native hijri calendar support -> How to implement api in python website
type: enhancement -> performance

___
Python tracker 

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



[issue39988] Remove AugLoad and AugStore expression context from AST

2020-03-17 Thread sanjeev


sanjeev  added the comment:

Thank you for this question
https://www.extam.com/

--
nosy: +sanjeev091

___
Python tracker 

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



[issue39993] Language Reference - Function definition parameter_list item definition not equivalent to implementation.

2020-03-17 Thread Michael S


New submission from Michael S :

I just read
 https://docs.python.org/3/reference/compound_stmts.html#function-definitions

The item parameter_list is defined as: 

parameter_list::=  defparameter ("," defparameter)* "," "/" ["," 
[parameter_list_no_posonly]] | parameter_list_no_posonly

This definition states that the "," "/" after ("," defparameter)* are 
mandatory. But this is not true in Python 3.8, because you can define a 
function as 

def f(a):
pass

Did I miss something?

--
assignee: docs@python
components: Documentation
messages: 364425
nosy: Michael S2, docs@python
priority: normal
severity: normal
status: open
title: Language Reference - Function definition parameter_list item definition 
not equivalent to implementation.
type: enhancement
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



[issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address

2020-03-17 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39989] Output closing parenthesis in ast.dump() on separate line

2020-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

For what it's worth (which might not be much), here is what black produces:

Module(
body=[
Expr(
value=Call(
func=Name(id="spam", ctx=Load()),
args=[Name(id="eggs", ctx=Load()), Constant(value="and 
cheese")],
keywords=[],
)
)
],
type_ignores=[],
)

I agree with Mark: it's all probably personal preference, and I'd be okay 
either way.

--
nosy: +eric.smith

___
Python tracker 

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



[issue39989] Output closing parenthesis in ast.dump() on separate line

2020-03-17 Thread Mark Dickinson


Mark Dickinson  added the comment:

Ah yes; looking at the `black` output, there's also an opportunity for an 
exciting discussion about trailing commas here :-)

--

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-03-17 Thread Dong-hee Na


Dong-hee Na  added the comment:

Victor,

frozenset is the last basic builtin collection which is not applied to this 
improvement yet.
frozenset also show similar performance improvement by using vectorcall

pyperf compare_to master.json bpo-37207.json
Mean +- std dev: [master] 2.26 us +- 0.06 us -> [bpo-37207] 2.06 us +- 0.05 us: 
1.09x faster (-9%) 

> What I mean is that vectorcall should not be used for everything

I definitely agree with this opinion. So I ask your opinion before submit the 
patch.
frozenset is not frequently used than the list/set/dict.
but frozenset is also the basic builtin collection, IMHO it is okay to apply 
vectorcall.

What do you think?

--

___
Python tracker 

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



[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2020-03-17 Thread Mark Shannon


Mark Shannon  added the comment:

Consider the case where a thread that doesn't hold the GIL attempts to get a 
reference on `None`.

The problem with having a single immortal `None`, is that it will cause data 
cache thrashing as two different CPUs modify the refcount on the shared `None` 
object.
Each subinterpreter needs its own distinct `None`.

`None` could be made immortal, it just can't be shared between sub-interpreters.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue39993] Language Reference - Function definition parameter_list item definition not equivalent to implementation.

2020-03-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Did I miss something?

Yep, what you are missing is that the rule is really:

(defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]) | 
(parameter_list_no_posonly)

which means that is either 

defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]

or

parameter_list_no_posonly

and for the def(a): pass case the corresponding rule is 
parameter_list_no_posonly (check the rest of the specification).

Do you think that adding these explicit parentheses would help with help making 
this more clear?

--
nosy: +pablogsal

___
Python tracker 

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



[issue39990] help should evaluate forward reference

2020-03-17 Thread Nguyễn Gia Phong

Nguyễn Gia Phong  added the comment:

I traced it down to inspect.formatannotation(annotation).  Before checking for 
isinstance(annotation, type), IMHO we should do something like

import typing

if isinstance(annotation, str):
annotation = typing.ForwardRef(str)._evaluate(annotation)

However, is is not aware of globals and especially locals of help caller, so I 
guess more sophisticated solution is required.

--
title: help output should make use of typing.get_type_hints -> help should 
evaluate forward reference

___
Python tracker 

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



[issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset eb886db1e99a15f15a2342aa496197a5f88fa9c8 by Victor Stinner in 
branch 'master':
bpo-39991: uuid._netstat_getnode() ignores IPv6 addresses (GH-19043)
https://github.com/python/cpython/commit/eb886db1e99a15f15a2342aa496197a5f88fa9c8


--

___
Python tracker 

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



[issue39993] Language Reference - Function definition parameter_list item definition not equivalent to implementation.

2020-03-17 Thread Michael S


Michael S  added the comment:

Thanks Pablo, 

sorry, I was just stupid.

> Do you think that adding these explicit parentheses would help with help 
> making this more clear?

Maybe. I read the BNF documentation the first time today, but since it's not 
intended for beginners, I think it's clear enough.

How should we continue with this issue? I don't really see any closing button 
or the like.

--

___
Python tracker 

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



[issue39993] Language Reference - Function definition parameter_list item definition not equivalent to implementation.

2020-03-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> not a bug
stage:  -> 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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2020-03-17 Thread Mark Shannon


Mark Shannon  added the comment:

Instead of passing `_PyRuntimeState` around everywhere, why not just let it 
disappear in time.

Currently `_PyRuntimeState` manages "global" state, mainly the GIL and some 
config.
Once the GIL has been migrated to the sub-interpreters, the config part can be 
factored out and `_PyRuntimeState` can just disappear.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like this issue is a regression caused by the following change of 
bpo-28009:

commit 0bcbfa43d55d9558cdcb256d8998366281322080
Author: Michael Felt 
Date:   Thu Sep 26 20:43:15 2019 +0100

bpo-28009: Fix uuid.uuid1() and uuid.get_node() on AIX (GH-8672)

which replaced:
if len(word) == 17 and word.count(b':') == 5:
with:
if len(word) == 17:

--

___
Python tracker 

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



[issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset 0bcbfa43d55d9558cdcb256d8998366281322080 by Tal Einat (Michael 
> Felt) in branch 'master':
> bpo-28009: Fix uuid.uuid1() and uuid.get_node() on AIX (GH-8672)

This change introduced a regression: bpo-39991.

I pushed the commit eb886db1e99a15f15a2342aa496197a5f88fa9c8 to fix my case, 
but I'm not sure that the fix covers all cases.

--
nosy: +vstinner

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-17 Thread Petr Viktorin


Petr Viktorin  added the comment:

> You are the one who wanted to *introduce* a hack by dereferencing
as char and then cast to _Bool. :-)

Yes, I did change my mind after reading the documentation.

The docs say two contradicting things:
1. The '?' conversion code corresponds to the _Bool type defined by C99
2. ... any non-zero value will be True when unpacking.

So it's clear that something has to change. IMO, preserving (2) and relaxing 
(1) is the more useful choice.

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-17 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +18395
pull_request: https://github.com/python/cpython/pull/19044

___
Python tracker 

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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2020-03-17 Thread Steve Dower


Steve Dower  added the comment:

> Instead of passing `_PyRuntimeState` around everywhere, why not just let it 
> disappear in time.

Agreed. It's valuable to pass the thread state, but the runtime state should 
only be needed to create a new thread state (and arguably not even then).

--

___
Python tracker 

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



[issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

My fix is incomplete: the IPv6 address "123:2:3:4:5:6:7:8" is a valid IPv6 
address and uuid.py accepts it as a valid MAC address, whereas it's not a MAC 
address.

--

___
Python tracker 

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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

> Instead of passing `_PyRuntimeState` around everywhere, why not just let it 
> disappear in time.

Passing runtime (_PyRuntimeState) is a temporary move until more and more 
fields are moved from _PyRuntimeState into PyInterpreterState. I just created 
bpo-39984 "Move some ceval fields from _PyRuntime.ceval to 
PyInterpreterState.ceval" yesterday ;-)

Once we will manage to move the GIL into PyInterpreterState, we would still 
have to pass PyInterpreterState or PyThreadState to function which require to 
access the GIL. Passing explicitly runtime is a first step to prepare to 
migration to PyInterpreterState or PyThreadState. My intent is to show that 
many functions rely on "global variables": pass these variables instead.

If you are thinking about getting the current Python thread state using a 
thread local storage, that's a different topic and I'm not aware of an open 
issue to track this idea.


> Currently `_PyRuntimeState` manages "global" state, mainly the GIL and some 
> config. Once the GIL has been migrated to the sub-interpreters, the config 
> part can be factored out and `_PyRuntimeState` can just disappear.

I don't think that we will be able to fully remove _PyRuntimeState. It seems 
like the PEP 554 "Multiple Interpreters in the Stdlib" requires a registry of 
interpreters and it currently lives in _PyRuntimeState.

--

___
Python tracker 

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



[issue39987] Simplify setting line numbers in the compiler

2020-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 61cb3d02b83e746e59bb1351a0865e3b8714b2d6 by Serhiy Storchaka in 
branch 'master':
bpo-39987: Simplify setting lineno in the compiler. (GH-19037)
https://github.com/python/cpython/commit/61cb3d02b83e746e59bb1351a0865e3b8714b2d6


--

___
Python tracker 

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



[issue39987] Simplify setting line numbers in the compiler

2020-03-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
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



[issue39994] Redundant code in pprint module.

2020-03-17 Thread Palak Kumar Jha


New submission from Palak Kumar Jha :

In the PrettyPrinter._format method, since self._dispatch has dict.__repr__ 
[key] mapped to self._pprint_dict [value] the elif block is not needed. Its 
work is already being done by the if block above, which searches self._dispatch 
to fetch the appropriate value.

--
messages: 364442
nosy: palakjha
priority: normal
severity: normal
status: open
title: Redundant code in pprint module.
type: enhancement
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



[issue39988] Remove AugLoad and AugStore expression context from AST

2020-03-17 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg364424

___
Python tracker 

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



[issue31895] How to implement api in python website

2020-03-17 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg364423

___
Python tracker 

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



[issue39943] Meta: Clean up various issues in C internals

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 982307b9cceef36e30ac43b13032d68c3b921adc by Andy Lester in branch 
'master':
bpo-39943: Remove unused self from find_nfc_index() (GH-18973)
https://github.com/python/cpython/commit/982307b9cceef36e30ac43b13032d68c3b921adc


--
nosy: +vstinner

___
Python tracker 

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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2020-03-17 Thread Mark Shannon


Mark Shannon  added the comment:

Even if `_PyRuntime` ends up as just a list of interpreters and doesn't 
disappear completely, it won't be used anything like as much as it is now.

Many of the functions that it getting passed to will no longer need it, so why 
bother passing it now?

--

___
Python tracker 

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



[issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address

2020-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18396
pull_request: https://github.com/python/cpython/pull/19045

___
Python tracker 

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



[issue26067] test_shutil fails when gid name is missing

2020-03-17 Thread Dino Viehland


Dino Viehland  added the comment:


New changeset 52268941f37e3e27bd01792b081877ec3bc9ce12 by Matthias Braun in 
branch 'master':
bpo-26067: Do not fail test_shutil / chown when gid/uid cannot be resolved 
(#19032)
https://github.com/python/cpython/commit/52268941f37e3e27bd01792b081877ec3bc9ce12


--
nosy: +dino.viehland

___
Python tracker 

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



[issue39994] Redundant code in pprint module.

2020-03-17 Thread Palak Kumar Jha


Change by Palak Kumar Jha :


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

___
Python tracker 

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



[issue39980] importlib.resources.path() may return incorrect path when using custom loader

2020-03-17 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +barry, jaraco

___
Python tracker 

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



[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

Mark:
> The problem with having a single immortal `None`, is that it will cause data 
> cache thrashing as two different CPUs modify the refcount on the shared 
> `None` object.

Yeah, I concur with Mark: having one singleton per interpreter should provide 
better usage of the CPU caches, especially CPU data cache level 1.


Mark:
> Consider the case where a thread that doesn't hold the GIL attempts to get a 
> reference on `None`.

The main drawback of PR 18301 is that accessing "Py_None" means accessing 
tstate->interp->none. Except that the commonly used _PyThreadState_GET() 
returns NULL if the thread doesn't hold the GIL.

One alternative would be to use PyGILState_GetThisThreadState() but this API 
doesn't support subinterpreters.

Maybe we are moving towards a major backward incompatible changes required to 
make the subinterpreters implementation more efficient.

Maybe CPython should have a backward compatible behavior by default (Py_None 
can be read without holding the GIL), but running subinterpreters in parallel 
would change Py_None behavior (cannot be read without holding the GIL).

I don't know.

--

___
Python tracker 

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



[issue24916] In sysconfig, don't rely on sys.version format

2020-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

> What do you think?

I would prefer to see a PR to give my opinion :)

--

___
Python tracker 

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



[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-03-17 Thread hai shi


hai shi  added the comment:

> Maybe we should just add a private function for test in _testcapi.

Oh, there have a problem with this idea:
struct _is is defined in internal/pycore_pystate.h.
_testcapi must test the public Python C API, not CPython internal C API

--

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2020-03-17 Thread Brett Cannon


Brett Cannon  added the comment:

I'm also still in favour of the change. While people may have worked around 
this that doesn't mean we need to keep forcing them to do so. People worked 
around our lack of booleans but we chose to still fix that. ;)

--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-17 Thread Stefan Krah


Stefan Krah  added the comment:

> So it's clear that something has to change. IMO, preserving (2) and relaxing 
> (1) is the more useful choice.

But not in this issue I think. GH-18969 is a minimal change that
*removes* UB for the standard sizes.


UB for the native type is a direct consequence of using _Bool.
Native types should be left as is because that's what array
libraries expect. The docs could need a change (in another issue).


Also, UB can only happen in a constructed example --- correctly
packed arrays don't have any incorrect values.


So I think any fear of UB here is not warranted.

--

___
Python tracker 

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



[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_concurrent_futures: 
ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with -> 
test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() 
fails with OSError: [Errno 9] Bad file descriptor

___
Python tracker 

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



[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with

2020-03-17 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 Ubuntu Shared 3.x:
https://buildbot.python.org/all/#/builders/101/builds/532

test_crash (test.test_concurrent_futures.ProcessPoolSpawnExecutorDeadlockTest) 
... 
Stdout:
15.51s 

Stderr:
Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 
3)
Dangling thread: 
Dangling thread: <_MainThread(MainThread, started 140540525950528)>
Dangling thread: <_ExecutorManagerThread(Thread-111, stopped daemon 
140540401628928)>

(...)

==
ERROR: test_crash 
(test.test_concurrent_futures.ProcessPoolSpawnExecutorDeadlockTest) [exit at 
task unpickle]
--
Traceback (most recent call last):
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_concurrent_futures.py",
 line 1119, in test_crash
executor.shutdown(wait=True)
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/process.py",
 line 721, in shutdown
self._executor_manager_thread_wakeup.wakeup()
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/process.py",
 line 93, in wakeup
self._writer.send_bytes(b"")
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py",
 line 205, in send_bytes
self._send_bytes(m[offset:offset + size])
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py",
 line 416, in _send_bytes
self._send(header + buf)
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py",
 line 373, in _send
n = write(self._handle, buf)
OSError: [Errno 9] Bad file descriptor

Stdout:
15.51s 

Stderr:
Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 
3)
Dangling thread: 
Dangling thread: <_MainThread(MainThread, started 140540525950528)>
Dangling thread: <_ExecutorManagerThread(Thread-111, stopped daemon 
140540401628928)>

--

On the same build, test_concurrent_futures timed out after 15 min, while 
running test_ressources_gced_in_workers():

0:29:08 load avg: 1.46 Re-running test_concurrent_futures in verbose mode
(...)
test_map_exception 
(test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... ok
test_map_timeout 
(test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... ok
test_max_workers_negative 
(test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... ok
test_max_workers_too_large 
(test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... 
skipped 'Windows-only process limit'
test_no_stale_references 
(test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... ok
Timeout (0:15:00)!
Thread 0x7f38bf766700 (most recent call first):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 
303 in wait
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/queues.py", 
line 227 in _feed
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 
882 in run
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 
944 in _bootstrap_inner
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 
902 in _bootstrap

Thread 0x7f38bff67700 (most recent call first):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/selectors.py", line 
415 in select
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/multiprocessing/connection.py",
 line 936 in wait
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/process.py",
 line 372 in wait_result_broken_or_wakeup
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/process.py",
 line 319 in run
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 
944 in _bootstrap_inner
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 
902 in _bootstrap

Thread 0x7f38c7128640 (most recent call first):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/threading.py", line 
303 in wait
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/concurrent/futures/_base.py",
 line 434 in result
  File 
"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_concurrent_futures.py",
 line 955 in test_ressources_gced_in_workers
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", 
line 616 in _callTestMethod
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", 
line 659 in run
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", 
line 719 in __call__
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", 
line 122 in run
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suite.py", 
line 84 in __call__
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/suit

[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

> _testcapi must test the public Python C API, not CPython internal C API

Use _testinternalcapi in this case.

--

___
Python tracker 

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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2020-03-17 Thread Mauro S. M. Rodrigues


Mauro S. M. Rodrigues  added the comment:

Hi Anthony, 

Thanks for asking, yeah I'm interested in push a new version. I'll do it later 
today and I'll post a link to the pr here.

--

___
Python tracker 

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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2020-03-17 Thread Antony Lee


Change by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5b1ef200d31a74a9b478d0217d73ed0a659a8a06 by Victor Stinner in 
branch 'master':
bpo-39824: module_traverse() don't call m_traverse if md_state=NULL (GH-18738)
https://github.com/python/cpython/commit/5b1ef200d31a74a9b478d0217d73ed0a659a8a06


--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Petr and Nick for the review ;-)

Pablo Galindo Salgado:
> I think Cython makes use of PEP-489 so unless I am missing something all 
> generated extensions use PEP-489 structures.

Alright. I still consider that my change is correct and will no harm anyone ;-)

--
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



[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-03-17 Thread hai shi


hai shi  added the comment:

> Use _testinternalcapi in this case.
oh, forgive me. I don't atttention this extension module before :(

--

___
Python tracker 

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



[issue39989] Output closing parenthesis in ast.dump() on separate line

2020-03-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The current output looks like Python code.  The proposed revision looks more 
like C, and I find the example above less readable with the prominence given to 
what is close to noise.  The difference is part of the reason I left C for 
Python over 2 decades ago.  Please make the alternative an option.  The 
preferred form depends on the person and possibly the AST.  (The example in 
Pablo's message is quite different.)

--

___
Python tracker 

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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2020-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What is your use case Anthony?

--

___
Python tracker 

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



[issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval

2020-03-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18398
pull_request: https://github.com/python/cpython/pull/19047

___
Python tracker 

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



[issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ebf6bb9f5ef032d1646b418ebbb645ea0b217da6 by Victor Stinner in 
branch 'master':
bpo-39991: Enhance uuid parser for MAC address (GH-19045)
https://github.com/python/cpython/commit/ebf6bb9f5ef032d1646b418ebbb645ea0b217da6


--

___
Python tracker 

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



[issue39991] test_uuid.test_netstat_getnode() fails on FreeBSD VM: uuid._netstat_getnode() uses IPv6 address as MAC address

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, the new stricter parser should now cover all cases. If not, it should be 
easier to fix it ;-) I close the issue.

--
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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2020-03-17 Thread Anthony Sottile


Anthony Sottile  added the comment:

one example is here: 
https://github.com/pre-commit/pre-commit/blob/bb6f1efe63c168d9393d520bd60e16c991a57059/pre_commit/store.py#L137-L139

where I would want cleanup in the exceptional case

another (related but different) closed-source use case involves creating a 
temporary directory that may be deleted and currently has to be guarded by:

shutil.rmtree(..., ignore_errors=True)

(making `TemporaryDirectory` not useful since it crashes if the directory goes 
missing)

there's additionally the problem of readonly files on windows, and readonly 
directories elsewhere being undeletable without a custom rmtree but I think 
that's a different issue entirely -- 
https://github.com/pre-commit/pre-commit/blob/bb6f1efe63c168d9393d520bd60e16c991a57059/pre_commit/util.py#L250-L267

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 514c469719f149e1722a91a9d0c63bf89dfefb2a by Dong-hee Na in branch 
'master':
bpo-1635741: Port itertools module to multiphase initialization (GH-19044)
https://github.com/python/cpython/commit/514c469719f149e1722a91a9d0c63bf89dfefb2a


--

___
Python tracker 

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



[issue39717] Fix exception causes in tarfile module

2020-03-17 Thread Ram Rachum


Ram Rachum  added the comment:

Ethan, got a verdict?

--

___
Python tracker 

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



[issue26660] tempfile.TemporaryDirectory() cleanup exception if nonwriteable or non-searchable files or directories created

2020-03-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
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



[issue39996] test_multiprocessing_fork hangs on AMD64 FreeBSD Shared 3.x

2020-03-17 Thread STINNER Victor


New submission from STINNER Victor :

Sadly, faulthandler failed to dump the Python traceback and kill the process. 
Instead, the main libregrtest process had to kill the child process (process 
group) :-(

https://buildbot.python.org/all/#/builders/152/builds/420

...
0:56:25 load avg: 0.22 running: test_multiprocessing_fork (35 min 42 sec)
0:56:55 load avg: 0.40 running: test_multiprocessing_fork (36 min 12 sec)
0:57:25 load avg: 0.24 running: test_multiprocessing_fork (36 min 42 sec)
0:57:55 load avg: 0.25 running: test_multiprocessing_fork (37 min 12 sec)
Kill  process group
0:58:13 load avg: 0.24 [420/420/3] test_multiprocessing_fork timed out (37 min 
30 sec) (37 min 30 sec)

See also bpo-39995: test_concurrent_futures.test_ressources_gced_in_workers() 
timed out after 15 minutes on AMD64 Ubuntu Shared 3.x.

--
components: Tests
messages: 364464
nosy: koobs, vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing_fork hangs on AMD64 FreeBSD Shared 3.x
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



[issue39996] test_multiprocessing_fork hangs on AMD64 FreeBSD Shared 3.x

2020-03-17 Thread STINNER Victor


STINNER Victor  added the comment:

In the previous build 419, test_multiprocessing_fork took 4 min 12 sec.

--

___
Python tracker 

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



[issue31895] How to implement api in python website

2020-03-17 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
type: performance -> enhancement

___
Python tracker 

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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2020-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If you want the conditional cleanup, then TemporaryDirectory is obviously a 
wrong tool. mkdtemp looks more appropriate.

If you remove directory in process of working with temporary directory, would 
it help if you create a subdirectory in the temporary directory and work with 
it (including conditionally removing)?

As for the readonly files, was not this problem solved by PR 10320?

--

___
Python tracker 

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



  1   2   >