[issue38921] Max Recursion Depth Reached in Logging Library

2019-12-05 Thread Vinay Sajip


Vinay Sajip  added the comment:

I'll flag this as pending, and close in a week if no minimal 
needed-to-reproduce script is posted. Let me know if you are working on 
producing such a minimal script and need more time.

--
status: open -> pending

___
Python tracker 

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



[issue12769] String with NUL characters truncated by ctypes when assigning to a char array

2019-12-05 Thread Vinay Sajip


Change by Vinay Sajip :


--
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 2.7, Python 3.3

___
Python tracker 

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



[issue28404] Logging SyslogHandler not appending '\n' to the end

2019-12-05 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution: not a bug -> out of date
status: pending -> closed

___
Python tracker 

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



[issue26628] Undefined behavior calling C functions with ctypes.Union arguments

2019-12-05 Thread Vinay Sajip


Vinay Sajip  added the comment:

This is now fixed as a result of fixing bpo-16575. The unioncrash.py script now 
gives an error message:

$ python3.9 ~/tmp/unioncrash.py 
Traceback (most recent call last):
  File "/home/vinay/tmp/unioncrash.py", line 10, in 
sin.argtypes = [MyUnion]
TypeError: item 1 in _argtypes_ passes a union by value, which is unsupported.

--
resolution:  -> fixed
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



[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2019-12-05 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset efefe25443c56988841ab96cdac01352123ba268 by Inada Naoki (wim 
glenn) in branch 'master':
bpo-27413: json.tool: Add --no-ensure-ascii option. (GH-17472)
https://github.com/python/cpython/commit/efefe25443c56988841ab96cdac01352123ba268


--
nosy: +inada.naoki

___
Python tracker 

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



[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2019-12-05 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2019-12-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue38983] test_venv: test_overwrite_existing() failed on AMD64 Windows7 SP1 3.x

2019-12-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

https://bugs.python.org/issue38544#msg355041 seems like a related old report

--
nosy: +xtreak

___
Python tracker 

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



[issue38984] Value add to the wrong key in a dictionary

2019-12-05 Thread Ahmed Ramadan


Ahmed Ramadan  added the comment:

It's a bug in your code.

masterInfoDict['id1'][4] and masterInfoDict['val1'][4] point to the same list 
object ['Si1'], to which 'Si2' and 'Si1' get appended when col1ID='id2'.

--
nosy: +ramahmed

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-12-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d863ade0c7fa4826e8b71aa467809c83a711f019 by Victor Stinner in 
branch 'master':
bpo-38858: Add pycore_interp_init() code to factorize code (GH-17483)
https://github.com/python/cpython/commit/d863ade0c7fa4826e8b71aa467809c83a711f019


--

___
Python tracker 

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



[issue38984] Value add to the wrong key in a dictionary

2019-12-05 Thread Gabriele


Gabriele  added the comment:

Hi Eric,
I think is a bug and not a simple coding error. 
python is adding new value into another key in a dictionary when the key is not 
called.
I updated my code (check "programTEST.py") that can replicate perfectly my 
problem. 

Please try my program and let me know if you think is a bug or a "coding" error.

--

___
Python tracker 

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



[issue38984] Value add to the wrong key in a dictionary

2019-12-05 Thread Gabriele


Change by Gabriele :


Added file: https://bugs.python.org/file48760/programTEST.py

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-12-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16962
pull_request: https://github.com/python/cpython/pull/17483

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-12-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 81fe5bd3d78f9bb955f8255404d99df27a31c36a by Victor Stinner in 
branch 'master':
bpo-38858: new_interpreter() reuses _PySys_Create() (GH-17481)
https://github.com/python/cpython/commit/81fe5bd3d78f9bb955f8255404d99df27a31c36a


--

___
Python tracker 

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



[issue38948] os.path.ismount() returns False for current working drive

2019-12-05 Thread Eryk Sun


Eryk Sun  added the comment:

> So essentially, you say the check should always be "ntpath.isdir(d) 

I forgot that ntpath.isdir is now genericpath.isdir, so that will work. The old 
nt._isdir wouldn't work because it was equivalent to an lstat. Apparently a 
vestigial import of nt._isdir remains in ntpath.py, even though nt._isdir was 
removed:

https://hg.python.org/cpython/file/v3.3.0/Lib/ntpath.py#l677

> On the other hand, this will make ntpath.ismount meaningless on POSIX, 
> as it will always require real access to the file system. Is it worth 
> having a "pure" implementation for best effort in this case? 

I'm not suggesting an existence check in POSIX. Whoever uses ntpath in POSIX 
must be aware that ntpath.ismount is useless for detecting Unix mount points. 
It's only useful for identifying potential mount points in a pure Windows path. 
I see no reason to break this use case.

For POSIX, I'd like ntpath._abspath_fallback to handle drive-relative paths, so 
we can fix the check in ismount to use `rest and rest in seps`. It seems wrong 
for _abspath_fallback("F:") to return the relative path "F:". No drives exist 
in POSIX, so it's harmless to assume that the working directory on each drive 
is the root directory, which is the default value in Windows anyway.

> Based on the splitdrive() 

Note that splitdrive currently doesn't support "UNC" device paths (issue 
37609). For example, "//?/UNC/server/share" splits as ("//?/UNC", 
"/server/share"). "GLOBAL" device paths also aren't supported, which I'd 
prefer, but it's less important because they're only useful rarely, and I don't 
know of an existing path library that handles them. splitdrive also doesn't 
support repeated separators between the server and share components, such as 
"//server///share", which GetFullPathNameW handles nowadays. Maybe it didn't 
circa NT 5.0. The only place that's strict is the UNC root, which must be 
exactly two separators. I uploaded an implementation to issue 37609 that 
supports "UNC" and "GLOBAL" device paths, with support for repeated separators. 
Here's a complex example split: ("//?///Global///UNC///server///share", 
"///path").

Anyway, ntpath.ismount needs to distinguish between UNC and "UNC" device paths 
vs all other device paths, because a root path is only optional in the UNC 
case. For example, "//?/C:" or "//?/BootPartition" is a volume device, and 
"//?C:/" or "//?/BootPartition/" is a filesystem mount point. In Windows we can 
detect that "//?/C:" or "//?/BootPartition" isn't a directory, but in POSIX we 
need to get it right as a pure path.

--

___
Python tracker 

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



[issue29636] Specifying indent in the json.tool command

2019-12-05 Thread Daniel Himmelstein


Change by Daniel Himmelstein :


--
pull_requests: +16961
pull_request: https://github.com/python/cpython/pull/17482

___
Python tracker 

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



[issue38984] Value add to the wrong key in a dictionary

2019-12-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is almost certainly not a bug in Python.

The bug tracker isn't for giving help with your code. I suggest you ask on the 
python-list mailing list https://mail.python.org/mailman/listinfo/python-list

If you still think this is a bug in Python, you should create a simpler program 
to reproduce the problem, and one that doesn't use any third-party code.

--
nosy: +eric.smith

___
Python tracker 

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



[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-12-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16960
pull_request: https://github.com/python/cpython/pull/17481

___
Python tracker 

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



[issue38984] Value add to the wrong key in a dictionary

2019-12-05 Thread Gabriele

New submission from Gabriele :

hello,
I found this strange issue in my program:

I’m reading a file with 5 columns separated by ‘;’ . Columns 3,4 and 5 can have 
multiple values and in this case, are separated by ‘,’ .
Some values in column 3 can be repeated in each line in the same column.

Goal:
I want create a dictionary for each line using as a key the value in the first 
column and another key using the values that are in column 3.
If the key in column 3 is already in the dictionary, I want add the value in 
column 4 to the dictionary for the key that is repeated.

Example file:
col1;col2;col3;col4;col5
id1;i1;val1;Si1;Da1
id2;i2;val2,val1;Si2,Si1;Da2
id3;i3;val3;Si3;Da3

Expected Result:
{‘id1’ : [ 'id1','i1',['val1'],['Si1'],['Da1’] ] ,
 ‘id2’ : [‘ id2','i2',['val2','val1'] ,[Si2,Si1] ,['Da2’] ] , 
 ‘val1’ : [ 'id1','i1',['val2','val1'],['Si2','Si1'],['Da1','Da2’] ] , 
 ‘val2’ : [ 'id2','i2',['val2','val1'],[Si2,Si1],['Da2’] ] , 
 'id3’ : [ 'id3','i3','val3',['Si3'],['Da3’] ] , 
 ‘val3’ : [ 'id3','i3','val3',['Si3'],['Da3’] ] }

But what I obtaining is 
{'id2': ['id2', 'i2', ['val2', 'val1'], ['Si2', 'Si1'], ['Da2'], '5'], 
'id3': ['id3', 'i3', ['val3'], ['Si3'], ['Da3'], '5’],
'id1': ['id1', 'i1', ['val1'], ['Si1', 'Si2', 'Si1'], ['Da1', 'Da2'], '5'], 
'val3': ['id3', 'i3', ['val3'], ['Si3'], ['Da3'], '5'], 
'val2': ['id2', 'i2', ['val2', 'val1'], ['Si2', 'Si1'], ['Da2'], '5'], 
'val1': ['id1', 'i1', ['val1'], ['Si1', 'Si2', 'Si1'], ['Da1', 'Da2'], '5']} 

My bug:
Key id1 was called just one time in my program, but in my results, I can find 
that list in position 3 is with 3 value (Si1 , Si2 , Si1) when it supposes to 
have just Si1.

Am I doing something wrong or this is a potential bug?
I ran the program using a different machines and different python versions, but 
results don't change.

--
files: program.py
messages: 357894
nosy: malbianco
priority: normal
severity: normal
status: open
title: Value add to the wrong key in a dictionary
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48759/program.py

___
Python tracker 

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



[issue33125] Windows 10 ARM64 platform support

2019-12-05 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +16959
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/17480

___
Python tracker 

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



[issue38948] os.path.ismount() returns False for current working drive

2019-12-05 Thread Steve Dower


Steve Dower  added the comment:

> The main problem that I see here is that, in Windows (not POSIX), 
> ntpath.ismount fails to verify that a potential mount point is an existing 
> directory via os.stat and stat.S_ISDIR. ... This would be a breaking change, 
> but I think it's important enough.

So essentially, you say the check should always be "ntpath.isdir(d) and 
ntpath.ismount(d)" (plus the non-breaking improvements to ismount)? And we 
should just do the isdir() inside ismount() because otherwise the result is 
nonsense.

I'm inclined to agree, and I'm not concerned about breaking a nonsense result. 

On the other hand, this will make ntpath.ismount meaningless on POSIX, as it 
will always require real access to the file system. Is it worth having a "pure" 
implementation for best effort in this case? Based on the splitdrive() patterns 
we support (plus the fixes to support them properly)?

--

___
Python tracker 

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



[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2019-12-05 Thread Sterling Smith


Change by Sterling Smith :


--
nosy: +Sterling Smith

___
Python tracker 

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



[issue38948] os.path.ismount() returns False for current working drive

2019-12-05 Thread Eryk Sun


Eryk Sun  added the comment:

> The only thing 'F:' can ever be is a mount point.

"F:" is a relative path that has to be resolved via abspath() (i.e. 
GetFullPathNameW in Windows) before we can determine whether it's a mount 
point. ntpath.ismount handles this correctly in 3.4+. 

The working directory on drive F: is the process working directory if it's the 
same drive, else it's the value of the "=F:" environment variable if defined, 
else it defaults to the root directory. The Windows API uses "=X:" environment 
variables, but it does not create them. They're optionally created by 
applications (e.g. CMD sets them, as does Python's os.chdir). Since they're 
just environment variables (albeit hidden because they begin with "="), 
per-drive working directories are inherited by child processes by default.

The main problem that I see here is that, in Windows (not POSIX), 
ntpath.ismount fails to verify that a potential mount point is an existing 
directory via os.stat and stat.S_ISDIR. This includes junctions that 
potentially target non-existing volumes (e.g. a junction to a removable volume 
that's unavailable or a volume with removable media that's not ready). This 
would be a breaking change, but I think it's important enough. Returning true 
for non-existing 'mount points' is nonsensical, since no filesystem actually 
mounts the path and the path itself may not even exist (e.g. an undefined drive 
or device). It needs to be and existing path in a device namespace (a device 
namespace is not necessarily a filesystem; all devices in NT have their own 
namespace, with a root path, whether mounted or not), and it has to at least be 
a subdirectory of a filesystem, if not the root directory. 

A common example of a mount point that's not at the root path of a device is a 
UNC share. For example, "\\;LanmanRedirector\;X:\server\share" 
resolves to opening "\Device\Mup\;LanmanRedirector\;X:\server\share", 
which is the form that's used for mapping an SMB share as a drive, except that 
a mapped drive can also target a subdirectory of a share. The opened path 
includes an explicit reference to the redirector device (to bypass prefix 
resolution), the drive and logon session for the cached connection (to bypass 
connecting), and an arbitrary number of prefix components (typically just 
"server\share"). 

Another related concern is the test for a root directory, `rest in seps`, which 
makes ntpath.ismount("F:") true in POSIX for the wrong reason. Since `seps` is 
a string, this check should actually be `rest and rest in seps' in order to 
avoid the vacuous truth when `rest` is an empty string. This problem is 
particular to POSIX because ntpath._abspath_fallback mishandles drive-relative 
paths. For example, ntpath.abspath("F:") returns "F:" in POSIX. It should 
special case a drive-relative path to insert a backslash (e.g. "F:" -> "F:\\", 
and "F:spam\\eggs" -> "F:\\spam\\eggs").

---

On the subject of junctions, a UNC path should not short-circuit out of 
checking for a junction, as it currently does. UNC paths can contain mount 
points, which get evaluated on the server.

In 3.8+, ntpath.ismount could also (and IMO should) support junctions that are 
bind mount points (i.e. mounting a subdirectory of a filesystem to a non-root 
path of a device) -- as posixpath.ismount does in POSIX. We already support 
bind mounts as subst and mapped drives and UNC shares, so it's just making 
ismount consistent, and for the better. This would require an os.lstat call to 
check st_file_attributes for stat.FILE_ATTRIBUTE_REPARSE_POINT and whether 
st_reparse_tag is stat.IO_REPARSE_TAG_MOUNT_POINT. It would still need an 
os.stat call and stat.S_ISDIR to verify that the target is an existing 
directory.

--

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> It seems to me that the performance gains here really outweigh any weird 
> usage of LD_PRELOAD.

I am very convinced of this assertion, but other users could not be, I think 
the discussion is how to provide/activate the option in the less intrusive way 
and without breaking too many use cases.

To be honest, I think it would be very rare for users to use LD_PRELOAD in this 
way, so I am fine if we activate it by default. But I still think it would be 
good to discuss these cases and take them into consideration :)

--

___
Python tracker 

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



[issue21161] list comprehensions don't see local variables in pdb in python3

2019-12-05 Thread Andreas Kloeckner


Change by Andreas Kloeckner :


--
nosy: +inducer

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread Ammar Askar


Ammar Askar  added the comment:

Just for a quick datapoint: llvm/clang do this by default and you need an 
explicit `-fsemantic-interposition` to disable it 
http://lists.llvm.org/pipermail/llvm-dev/2016-November/107625.html

It seems to me that the performance gains here really outweigh any weird usage 
of LD_PRELOAD.

--
nosy: +ammar2

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I think it will add to the complexity of the --with-optimizations flag which 
> already implies PGO and LTO.

That is why I was suggesting it: --with-optimizations for me means "activate 
everything that you can to make python faster".

--

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

> Maybe it should only be default when using --with-optimizations

I think it will add to the complexity of the --with-optimizations flag which 
already implies PGO and LTO.

Maybe an opt-in flag would be better IMHO.

--
nosy: +cstratak

___
Python tracker 

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



[issue38979] ContextVar[str] should return ContextVar class, not None

2019-12-05 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

I'd be happy to work on this!

--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue38981] better name for re.error Exception class.

2019-12-05 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Thanks for the advice I've done that ! 

Have a good day.

--

___
Python tracker 

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



[issue38973] Shared Memory List Returns 0 Length

2019-12-05 Thread Yury Selivanov


Change by Yury Selivanov :


--
nosy:  -yselivanov

___
Python tracker 

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



[issue38978] Implement __class_getitem__ for Future, Task, Queue

2019-12-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm actually missing context, so I will leave this up to you all.

--

___
Python tracker 

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



[issue38981] better name for re.error Exception class.

2019-12-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since it affects more than one module I suggest to discuss the idea about 
renaming exceptions of the Python-Ideas maillist first. Until different 
decision be made I am closing. Personally I think this is a duplicate of just 
discussed and rejected idea.

--
status: open -> closed

___
Python tracker 

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



[issue38981] better name for re.error Exception class.

2019-12-05 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Most of the module specific classes are `Error`, not `error`, at least with an 
uppercase E you know it's a class. 

if a novice sees :

> error: missing ), unterminated subpattern at position 0

It will be relatively tough or them to figure out that `error` is the type of 
the exception. 

Also it's not because something works that you can't improve it ...

--
status: closed -> open

___
Python tracker 

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



[issue38979] ContextVar[str] should return ContextVar class, not None

2019-12-05 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
keywords: +easy (C)

___
Python tracker 

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



[issue38981] better name for re.error Exception class.

2019-12-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also the discussion about renaming json.loads(): 
https://mail.python.org/archives/list/python-id...@python.org/thread/EJTIVQ2ZFSVHALTLRGFCOMOYGZYMKGQU/

--

___
Python tracker 

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



[issue38983] test_venv: test_overwrite_existing() failed on AMD64 Windows7 SP1 3.x

2019-12-05 Thread STINNER Victor


New submission from STINNER Victor :

Failure on AMD64 Windows7 SP1 3.x:
https://buildbot.python.org/all/#builders/81/builds/16

==
ERROR: test_overwrite_existing (test.test_venv.BasicTest)
--
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_venv.py", 
line 225, in test_overwrite_existing
builder.create(self.env_dir)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\venv\__init__.py", 
line 65, in create
context = self.ensure_directories(env_dir)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\venv\__init__.py", 
line 108, in ensure_directories
self.clear_directory(env_dir)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\venv\__init__.py", 
line 91, in clear_directory
shutil.rmtree(fn)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 731, 
in rmtree
return _rmtree_unsafe(path, onerror)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 613, 
in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 611, 
in _rmtree_unsafe
os.rmdir(path)
OSError: [WinError 145] The directory is not empty: 
'C:\\Users\\Buildbot\\AppData\\Local\\Temp\\tmp9y0m6j7z\\Scripts'

==
ERROR: test_overwrite_existing (test.test_venv.BasicTest)
--
Traceback (most recent call last):
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 380, in _force_run
return func(*args)
PermissionError: [WinError 5] Access is denied: 
'C:\\Users\\Buildbot\\AppData\\Local\\Temp\\tmp9y0m6j7z\\Scripts\\activate.bat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_venv.py", 
line 71, in tearDown
rmtree(self.env_dir)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 502, in rmtree
_rmtree(path)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 443, in _rmtree
_waitfor(_rmtree_inner, path, waitall=True)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 391, in _waitfor
func(pathname)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 439, in _rmtree_inner
_waitfor(_rmtree_inner, fullname, waitall=True)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 391, in _waitfor
func(pathname)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 442, in _rmtree_inner
_force_run(fullname, os.unlink, fullname)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 385, in _force_run
os.chmod(path, stat.S_IRWXU)
PermissionError: [WinError 5] Access is denied: 
'C:\\Users\\Buildbot\\AppData\\Local\\Temp\\tmp9y0m6j7z\\Scripts\\activate.bat'

--
components: Tests
messages: 357881
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_venv: test_overwrite_existing() failed on AMD64 Windows7 SP1 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



[issue38887] test_asyncio: test_pipe_handle() failed on AMD64 Windows7 SP1 3.x

2019-12-05 Thread STINNER Victor


STINNER Victor  added the comment:

New failure on AMD64 Windows7 SP1 3.x:
https://buildbot.python.org/all/#/builders/81/builds/16

ERROR: test_pipe_handle (test.test_asyncio.test_windows_utils.PipeTests)
--
Traceback (most recent call last):
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_asyncio\test_windows_utils.py",
 line 78, in test_pipe_handle
raise RuntimeError('expected ERROR_INVALID_HANDLE')
RuntimeError: expected ERROR_INVALID_HANDLE

--

___
Python tracker 

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



[issue36732] Windows: test_asyncio: test_huge_content_recvinto() fails randomly with ProactorEventLoop

2019-12-05 Thread STINNER Victor


STINNER Victor  added the comment:

New failure on AMD64 Windows7 SP1 3.x:
https://buildbot.python.org/all/#/builders/81/builds/16

ERROR: test_huge_content_recvinto 
(test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests)

also:

ERROR: test_pipe_handle (test.test_asyncio.test_windows_utils.PipeTests)

--

___
Python tracker 

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



[issue38981] better name for re.error Exception class.

2019-12-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is common practice that the module specific exception is called just 
"error". There is nothing wrong with this.

I do not see a need to introduce a different alias.

--
nosy: +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



[issue38979] ContextVar[str] should return ContextVar class, not None

2019-12-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue38979] ContextVar[str] should return ContextVar class, not None

2019-12-05 Thread Yury Selivanov


Yury Selivanov  added the comment:

> The issue is minor, I suspect nobody wants to derive from ContextVar class.

I don't think that's allowed, actually.

> The generic implementation for __class_getitem__ is returning unmodified self 
> argument. Yuri, is there a reason to behave differently in the case of 
> ContextVar?

No, just an oversight, probably.

--

___
Python tracker 

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



[issue38978] Implement __class_getitem__ for Future, Task, Queue

2019-12-05 Thread Batuhan


Batuhan  added the comment:

I want to be a volunteer, if no one is working on this.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue38978] Implement __class_getitem__ for Future, Task, Queue

2019-12-05 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

I see the point in using ``__class_getitem__`` in Python classes too, we can 
probably start using a dummy method returning class object itself now. Also PEP 
585 already has a long list of candidates for "proper" ``__class_getitem__`` 
support. Maybe we can add these classes to that list? Maybe it would make sense 
to also have ``PathLike`` there?

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue38698] While parsing email message id: UnboundLocalError

2019-12-05 Thread miss-islington


miss-islington  added the comment:


New changeset e21aa61e96f8343200e765d119ebe778873a6bf1 by Miss Islington (bot) 
in branch '3.8':
bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id (GH-17277)
https://github.com/python/cpython/commit/e21aa61e96f8343200e765d119ebe778873a6bf1


--

___
Python tracker 

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



[issue38982] test_asyncio: SubprocessPidfdWatcherTests..test_close_dont_kill_finished() leaks a file descriptor

2019-12-05 Thread STINNER Victor


STINNER Victor  added the comment:

The test only fails on the Fedora Rawhide buildbot, likely because other Linux 
Refleak buildbots are using a kernel or libc without pidfd_open() ;-)

--

___
Python tracker 

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



[issue38974] using tkinter.filedialog.askopenfilename() freezes python 3.8

2019-12-05 Thread Steve Dower


Steve Dower  added the comment:

Temporarily uninstalling your Dropbox client is the easiest way.

--

___
Python tracker 

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



[issue38982] test_asyncio: SubprocessPidfdWatcherTests..test_close_dont_kill_finished() leaks a file descriptor

2019-12-05 Thread STINNER Victor


STINNER Victor  added the comment:

Attached PR 17477 fix the leak.

PidfdChildWatcher was added to asyncio by bpo-38692:

commit 3ccdd9b180f9a3f29c8ddc8ad1b331fe8df26519
Author: Benjamin Peterson 
Date:   Wed Nov 13 19:08:50 2019 -0800

closes bpo-38692: Add a pidfd child process watcher to asyncio. (GH-17069)

--

___
Python tracker 

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



[issue38982] test_asyncio: SubprocessPidfdWatcherTests..test_close_dont_kill_finished() leaks a file descriptor

2019-12-05 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38698] While parsing email message id: UnboundLocalError

2019-12-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16957
pull_request: https://github.com/python/cpython/pull/17476

___
Python tracker 

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



[issue38974] using tkinter.filedialog.askopenfilename() freezes python 3.8

2019-12-05 Thread Daniel Preston


Daniel Preston  added the comment:

How would I do that?

--

___
Python tracker 

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



[issue38982] test_asyncio: SubprocessPidfdWatcherTests..test_close_dont_kill_finished() leaks a file descriptor

2019-12-05 Thread STINNER Victor


New submission from STINNER Victor :

See on AMD64 Fedora Rawhide Refleaks 3.x:
https://buildbot.python.org/all/#/builders/82/builds/7

I found the leaking test using test.bisect_cmd:

$ ./python -m test test_asyncio -R 3:3 --fail-env-changed -v -m 
test.test_asyncio.test_subprocess.SubprocessPidfdWatcherTests.test_close_dont_kill_finished
...
test_asyncio leaked [1, 1, 1] file descriptors, sum=3

--
components: Tests, asyncio
messages: 357869
nosy: asvetlov, pablogsal, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio: 
SubprocessPidfdWatcherTests..test_close_dont_kill_finished() leaks a file 
descriptor
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



[issue38974] using tkinter.filedialog.askopenfilename() freezes python 3.8

2019-12-05 Thread Steve Dower


Steve Dower  added the comment:

Potentially. I don't have it installed, so I can't test, but I know in the past 
it added a shell extension that would display overlays over files it controlled.

That shell extension will be loaded into most system file picker dialogs, and 
at various points has executed Python code. I doubt they're on 3.8, but it's 
possible that there is some kind of conflict.

Can you try uninstalling or disabling its shell integration?

--

___
Python tracker 

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



[issue38981] better name for re.error Exception class.

2019-12-05 Thread Matthias Bussonnier


New submission from Matthias Bussonnier :

better error/exception name for re.compile error. 

Currently the error raise by re.compile when it fails to compile is `error` 
defined in sre_constants.py: 

```
class error(Exception):
"""Exception raised for invalid regular expressions.

```

This is quite disturbing as most exception start with an uppercase and have a 
tiny bit more descriptive name. 

Would it be possible to have it renamed as something more explicit like 
`ReCompileError`, and still keeping the potential `error` alias as deprecated ?

--
components: Regular Expressions
messages: 357867
nosy: ezio.melotti, mbussonn, mrabarnett
priority: normal
severity: normal
status: open
title: better name for re.error Exception class.

___
Python tracker 

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



[issue38270] Tests: Avoid MD5 or check for MD5 availablity

2019-12-05 Thread miss-islington


miss-islington  added the comment:


New changeset cfdaf92221da3c264d0da9c588994fefe4073196 by Miss Islington (bot) 
in branch '3.8':
[3.8] bpo-38270: Fix indentation of test_hmac assertions (GH-17446) (GH-17450)
https://github.com/python/cpython/commit/cfdaf92221da3c264d0da9c588994fefe4073196


--

___
Python tracker 

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



[issue38955] Non indemnpotent behavior of asyncio.get_event_loop and asyncio.run sequence.

2019-12-05 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Thanks Andrew; 

I'd still would love to have a way to get the current eventloop outside of 
async code that is consistent. 

I guess throwing an error with `get_event_loop()` is ok, it's just that 
`RuntimeError` feel like a weird thing to catch.

Alternatively is the current event loop is None I feel like returning None 
would also make sens imho. 

Feel free to close if you think this will not get fixed/updated.

--

___
Python tracker 

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



[issue38978] Implement __class_getitem__ for Future, Task, Queue

2019-12-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Well, __class_getitem__ was added primarily to allow classes implemented in
*C* to support "generics". This is helpful to support PEP 585. For classes
written in Python I don't see the point.

But I'll leave the rest of this to Ivan.

--

___
Python tracker 

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



[issue37096] Add large-file tests for modules using sendfile(2)

2019-12-05 Thread Petr Viktorin


Petr Viktorin  added the comment:

The test passes with a 8GB /tmp, but not a 6GB one.

That could suggest the test needs 3*2GB disk space for temporary files, plus 
something extra.

--

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Could these user use a "./configure --with-interposition --enable-shared" 
> build?

Sure, but the problem is the default value, no?

Maybe it should only be default when using --with-optimizations

--

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread STINNER Victor


STINNER Victor  added the comment:

> If we do this by default, once functions will be inlined these use cases will 
> be broken.

Could these user use a "./configure --with-interposition --enable-shared" build?

--

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I have seen people using LD_PRELOAD to interpose some auditing functions that 
can modify the actual call into libpython, or to interpose faster versions of 
some functions or to collect metrics (although there are better ways).

If we do this by default, once functions will be inlined these use cases will 
be broken.

--

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread Miro Hrončok

Change by Miro Hrončok :


--
nosy: +hroncok

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread STINNER Victor


STINNER Victor  added the comment:

Maybe we need to offer a way to *opt out* from -fno-semantic-interposition. For 
example, ./configure --with-interposition. The default would be 
--without-interposition.

--

___
Python tracker 

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



[issue37096] Add large-file tests for modules using sendfile(2)

2019-12-05 Thread Petr Viktorin


Petr Viktorin  added the comment:

It seems that the test actually requires >4GB disk space, because it's copying 
a 2GB file from one place to another.

Also, it's using a temporary directory. On Fedora /tmp is memory-backed by 
default, it doesn't use regular disk space.

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue38978] Implement __class_getitem__ for Future, Task, Queue

2019-12-05 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I thought __class_getitem__ was invented exactly to simplify generic types 
support.

The only thing that confuses me an example from PEP 560:

class MyList:
def __getitem__(self, index):
return index + 1
def __class_getitem__(cls, item):
return f"{cls.__name__}[{item.__name__}]"

It prevents from instantiating a generic on inheritance, e.g. the following 
code raises TypeError:

class MyOtherList(MyList[int]):
pass

It would be nice if Ivan clarifies what is the best practice in this case.
I think the method should return unmodified class, not a string.

--

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-05 Thread STINNER Victor


New submission from STINNER Victor :

The Fedora packaging has been modified to compile libpython with 
-fno-semantic-interposition flag: it makes Python up to 1.3x faster without 
having to touch any line of the C code! See pyperformance results:
https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup#Benefit_to_Fedora

The main drawback is that -fno-semantic-interposition prevents to override 
Python symbols using a custom library preloaded by LD_PRELOAD. For example, 
override PyErr_Occurred() function.

We (authors of the Fedora change) failed to find any use case for LD_PRELOAD.

To be honest, I found *one* user in the last 10 years who used LD_PRELOAD to 
track memory allocations in Python 2.7. This use case is no longer relevant in 
Python 3 with PEP 445 which provides a supported C API to override Python 
memory allocators or to install hooks on Python memory allocators. Moreover, 
tracemalloc is a nice way to track memory allocations.

Is there anyone aware of any special use of LD_PRELOAD for libpython?

To be clear: -fno-semantic-interposition only impacts libpython. All other 
libraries still respect LD_PRELOAD. For example, it is still possible to 
override glibc malloc/free.

Why -fno-semantic-interposition makes Python faster? There are multiple 
reasons. For of all, libpython makes a lot of function calls to libpython. Like 
really a lot, especially in the hot code paths. Without 
-fno-semantic-interposition, function calls to libpython requires to get 
through "interposition": for example "Procedure Linkage Table" (PLT) 
indirection on Linux. It prevents function inlining which has a major impact on 
performance (missed optimization). In short, even with PGO and LTO, libpython 
function calls have two performance "penalities":

* indirect function calls (PLT)
* no inlining

I'm comparing Python performance of "statically linked Python" (Debian/Ubuntu 
choice: don't use ./configure --enable-shared, python is not linked to 
libpython) to "dynamically linked Python" (Fedora choice: use "./configure 
--enable-shared", python is dynamically linked to libpython).

With -fno-semantic-interposition, function calls are direct and can be inlined 
when appropriate. You don't have to trust me, look at pyperformance benchmark 
results ;-)

When using ./configure --enable-shared (libpython), the "python" binary is 
exactly one function call and that's all:

int main(int argc, char **argv)
{ return Py_BytesMain(argc, argv); }

So 100% of the time is only spent in libpython.

For a longer rationale, see the accepted Fedora change:
https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup

--
components: Build
messages: 357856
nosy: inada.naoki, pablogsal, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Compile libpython with -fno-semantic-interposition
type: performance
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



[issue36077] Inheritance dataclasses fields and default init statement

2019-12-05 Thread Martijn Pieters


Martijn Pieters  added the comment:

I've supported people hitting this issue before (see 
https://stackoverflow.com/a/53085935/100297, where I used a series of mixin 
classes to make use of the changing MRO when the mixins share base classes, to 
enforce a field order from inherited classes.

I'd be very much in favour of dataclasses using the attrs approach to field 
order: any field named in a base class *moves to the end*, so you can 'insert' 
your own fields by repeating parent fields that need to come later:

@attr.s(auto_attribs=True)
class Parent:
foo: str
bar: int
baz: bool = False


@attr.s(auto_attribs=True)
class Child(Parent):
spam: str
baz: bool = False


The above gives you a `Child(foo: str, bar: int, spam: str, baz: bool = False)` 
object, note that `baz` moved to the end of the arguments.

`dataclasses` currently doesn't do this, so it'd be a breaking change.

--
nosy: +mjpieters

___
Python tracker 

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



[issue38978] Implement __class_getitem__ for Future, Task, Queue

2019-12-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

In principle I think this is a good idea.

If this was user code, we would inherit from typing.Generic. I understand you 
wanting to avoid the overhead of that. But will it work correctly at runtime 
with other typing constructors? I guess __annotations__ will not show the 
generic type's parameter. Will anybody care?

Maybe we need to walk through some detailed examples.

--

___
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-12-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1f9f69dd4c5ee232c0b2f782933a89359932a67f by Victor Stinner 
(Sergey Fedoseev) in branch 'master':
bpo-27961: Replace PY_LLONG_MAX, PY_LLONG_MIN and PY_ULLONG_MAX with standard 
macros (GH-15385)
https://github.com/python/cpython/commit/1f9f69dd4c5ee232c0b2f782933a89359932a67f


--

___
Python tracker 

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



[issue38529] Python 3.8 improperly warns about closing properly closed streams

2019-12-05 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue38978] Implement __class_getitem__ for Future, Task, Queue

2019-12-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue38529] Python 3.8 improperly warns about closing properly closed streams

2019-12-05 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue38439] Python needs higher resolution app/menu icons

2019-12-05 Thread STINNER Victor


STINNER Victor  added the comment:

Oh ok, I confirm that https://github.com/python/cpython/pull/17473 is an icon 
drew by Andrew Clover.

https://www.doxdesk.com/file/software/py/v/pyicons-full-0.4.zip from 
https://www.doxdesk.com/software/py/pyicons.html contains py0032.png which is 
the same picture (same pixels), but the MD5 is different because metadata are 
different.

That's the website of Andrew Clover: https://www.doxdesk.com/personal/

--
nosy: +vstinner

___
Python tracker 

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



[issue36383] Virtual environment sysconfig.get_path() and distutils.sysconfig.get_python_inc() reports base Python include directory

2019-12-05 Thread Tzu-ping Chung


Tzu-ping Chung  added the comment:

I can replicate this on Linux as well. Furthormore, 
sysconfig.get_path('include') also returns the global path.

--
components: +Library (Lib)
nosy: +uranusjr
title: In Windows 10 virtual environments distutils.sysconfig.get_python_inc() 
reports base Python include directory -> Virtual environment 
sysconfig.get_path() and distutils.sysconfig.get_python_inc() reports base 
Python include directory

___
Python tracker 

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



[issue1490384] PC new-logo-based icon set

2019-12-05 Thread Miro Hrončok

Change by Miro Hrončok :


--
pull_requests: +16955
pull_request: https://github.com/python/cpython/pull/17473

___
Python tracker 

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



[issue38439] Python needs higher resolution app/menu icons

2019-12-05 Thread Miro Hrončok

Change by Miro Hrončok :


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

___
Python tracker 

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



[issue38979] ContextVar[str] should return ContextVar class, not None

2019-12-05 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
type:  -> behavior

___
Python tracker 

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



[issue38979] ContextVar[str] should return ContextVar class, not None

2019-12-05 Thread Andrew Svetlov


New submission from Andrew Svetlov :

The issue is minor, I suspect nobody wants to derive from ContextVar class.

The generic implementation for __class_getitem__ is returning unmodified self 
argument. Yuri, is there a reason to behave differently in the case of 
ContextVar?

If no, we can mark the issue as easy(C) and wait for a volunteer, the fix seems 
trivial.

--
components: Extension Modules
messages: 357850
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: ContextVar[str] should return ContextVar class, not None
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



[issue38439] Python needs higher resolution app/menu icons

2019-12-05 Thread Miro Hrončok

Miro Hrončok  added the comment:

https://bugs.python.org/issue1490384
https://www.doxdesk.com/software/py/pyicons.html

--

___
Python tracker 

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



[issue38978] Implement __class_getitem__ for Future, Task, Queue

2019-12-05 Thread Andrew Svetlov


New submission from Andrew Svetlov :

Typeshed declares asyncio.Future, asyncio.Task and asyncio.Queue as generic 
types, which is 100% correct.

The problem is that these classes don't support generic instantiation in 
runtime, e.g. Future[str] raises TypeError.

The feature should be implemented by adding __class_getitem__ methods which 
return self.

The patch is trivial but requires a few lines of C code for C Accelerated CTask 
and CFuture as well as updating Python code.

A volunteer is welcome!

--
components: asyncio
keywords: easy, easy (C)
messages: 357848
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Implement __class_getitem__ for Future, Task, Queue
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



[issue38846] async: Return context manager from open(_unix)_connection

2019-12-05 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> wont fix
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



[issue38951] Use threading.main_thread() check in asyncio

2019-12-05 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue38951] Use threading.main_thread() check in asyncio

2019-12-05 Thread miss-islington


miss-islington  added the comment:


New changeset 99eb70a9eb9493602ff6ad8bb92df4318cf05a3e by Miss Islington (bot) 
(Hill Ma) in branch 'master':
bpo-38951: Use threading.main_thread() check in asyncio (GH-17433)
https://github.com/python/cpython/commit/99eb70a9eb9493602ff6ad8bb92df4318cf05a3e


--
nosy: +miss-islington

___
Python tracker 

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



[issue38439] Python needs higher resolution app/menu icons

2019-12-05 Thread Miro Hrončok

Miro Hrončok  added the comment:

At 
https://mgabrail.wordpress.com/2011/08/19/5-reasons-why-you-should-learn-python-programming/
 I have found https://mgabrail.files.wordpress.com/2011/08/python.png - I have 
no idea what is the license of this file or where it originated from, but this 
looks fairly like the icon in question.

Google images reveal more liek it, usually resized or jpeged.

--
Added file: https://bugs.python.org/file48758/python.png

___
Python tracker 

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



[issue24565] the f_lineno getter is broken

2019-12-05 Thread daniel hahler

daniel hahler  added the comment:

This is likely covered by existing/linked issues already, but wanted to leave 
it here nonetheless:

Given t-pdb.py:
```
import sys


def main():
sys.stdout.write("main...\n")
assert 0


if __name__ == "__main__":
main()
```

Without the fix from the PR:
```
% python3.8 -m pdb -c cont t-pdb.py
main...
Traceback (most recent call last):
  File "…/pyenv/3.8.0/lib/python3.8/pdb.py", line 1702, in main
pdb._runscript(mainpyfile)
  File "…/pyenv/3.8.0/lib/python3.8/pdb.py", line 1571, in _runscript
self.run(statement)
  File "…/pyenv/3.8.0/lib/python3.8/bdb.py", line 587, in run
exec(cmd, globals, locals)
  File "", line 1, in 
  File "…/Vcs/cpython/t-pdb.py", line 1, in 
import sys
  File "…/Vcs/cpython/t-pdb.py", line 6, in main
assert 0
AssertionError
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> …/Vcs/cpython/t-pdb.py(6)main()
-> assert 0
(Pdb)
```

With the fix:
```
% /tmp/cpython-bisect/bin/python3.8 -m pdb -c cont t-pdb.py
main...
Traceback (most recent call last):
  File "/tmp/cpython-bisect/lib/python3.8/pdb.py", line 1703, in main
pdb._runscript(mainpyfile)
  File "/tmp/cpython-bisect/lib/python3.8/pdb.py", line 1572, in _runscript
self.run(statement)
  File "/tmp/cpython-bisect/lib/python3.8/bdb.py", line 583, in run
exec(cmd, globals, locals)
  File "", line 1, in 
  File "…/Vcs/cpython/t-pdb.py", line 10, in 
main()
  File "…/Vcs/cpython/t-pdb.py", line 6, in main
assert 0
AssertionError
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> …/Vcs/cpython/t-pdb.py(6)main()
-> assert 0
(Pdb)
```

As you can see the traceback in the fixed case contains `main()` correctly,
while it has `import sys` (the scripts first line) otherwise.

I can only repeat myself to ask for reviewing/merging 
https://github.com/python/cpython/pull/12419.

--
nosy: +blueyed

___
Python tracker 

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



[issue38977] python3.8 and namedlist1.7 is Incompatible

2019-12-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

>From Python 3.8, type_ignores is also mandatory for ast.Module as discussed in 
>issue35894 which also needs to be fixed in the module. Closing this as third 
>party as I don't see any apparent regression here in 3.8.

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



[issue38977] python3.8 and namedlist1.7 is Incompatible

2019-12-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This issue tracker is for issues related to CPython. Please report this to the 
respective issue tracker at https://bitbucket.org/ericvsmith/namedlist/issues. 
The error message looks related to handling positional only arguments that 
needs to be fixed in the library during ast construction at probably  
https://bitbucket.org/ericvsmith/namedlist/src/8db03a94fcc15184ccdf7a58f91c48bc5bcd3331/namedlist.py#lines-159.
 I think this can be closed as third party.

--
nosy: +eric.smith, xtreak

___
Python tracker 

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



[issue38977] python3.8 and namedlist1.7 is Incompatible

2019-12-05 Thread Simon.yu


New submission from Simon.yu :

When I use pytest based on python3.8, met a problem,it seems namedlist1.7 is 
incompatible!!

see blow logs:
--
  File "C:\Program Files\Python38\lib\site-packages\namedlist.py", line 180, in 
_make_fn
code = compile(module_node, '', 'exec')
TypeError: required field "posonlyargs" missing from arguments
--

--
components: Library (Lib)
messages: 357842
nosy: ling...@outlook.com
priority: normal
severity: normal
status: open
title: python3.8 and namedlist1.7 is Incompatible
type: behavior
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



[issue38974] using tkinter.filedialog.askopenfilename() freezes python 3.8

2019-12-05 Thread Daniel Preston


Daniel Preston  added the comment:

I have dropbox installed, would that be what's causing the problem?

--

___
Python tracker 

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



[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2019-12-05 Thread wim glenn


Change by wim glenn :


--
pull_requests: +16953
pull_request: https://github.com/python/cpython/pull/17472

___
Python tracker 

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



[issue38970] [PDB] NameError in list comprehension in PDB

2019-12-05 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I think this is same as https://bugs.python.org/issue26072#msg277578 and is 
reproducible with below sample script without depending on turbogears. The 
attached patch in the issue fixes this. Try using interact command from pdb as 
a workaround.

import pdb

def foo():
  pdb.set_trace()

foo()

--
nosy: +xdegaye, xtreak

___
Python tracker 

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