[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-16 Thread Yurii Karabas


Change by Yurii Karabas <1998uri...@gmail.com>:


--
pull_requests: +4
pull_request: https://github.com/python/cpython/pull/23335

___
Python tracker 

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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2020-11-16 Thread Andrey Bienkowski


Andrey Bienkowski  added the comment:

I'm working on fixing this

--

___
Python tracker 

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



[issue42384] Inconsistent sys.path between python and pdb

2020-11-16 Thread Andrey Bienkowski


Andrey Bienkowski  added the comment:

I'll look into fixing this after I fix #42383

--

___
Python tracker 

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



[issue42120] Depreciated MACRO of copysign for MSVC

2020-11-16 Thread miss-islington


miss-islington  added the comment:


New changeset 2c38e49dba88a39679b2182ca3f5f478d3a3f647 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-42120: Remove macro defining copysign to _copysign on Windows 
(GH-23326) (GH-23331)
https://github.com/python/cpython/commit/2c38e49dba88a39679b2182ca3f5f478d3a3f647


--

___
Python tracker 

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



[issue42382] No easy way to get the distribution which provided a importlib.metadata.EntryPoint

2020-11-16 Thread Pedro Algarvio


Change by Pedro Algarvio :


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

___
Python tracker 

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



[issue42384] Inconsistent sys.path between python and pdb

2020-11-16 Thread Andrey Bienkowski


New submission from Andrey Bienkowski :

The first entry in sys.path is different between `python foo.py` and `python -m 
pdb foo.py`. In the former it is the absolute path to the parent directory of 
foo.py while in the later it is a relative path (unless the debug target was 
specified using an absolute path). The meaning of the absolute path does not 
change when the current directory changes (e.g. via os.chdir()) while the 
meaning of the relative path does. Like any environment inconsistency between 
regular program execution and the debugger this may lead to bugs that 
mysteriously vanish when you try to debug them.

$ cat > print-path.py
import sys
from pprint import pprint

pprint(sys.path)
$ python3 print-path.py 
['/home/user',
 '/usr/lib64/python38.zip',
 '/usr/lib64/python3.8',
 '/usr/lib64/python3.8/lib-dynload',
 '/usr/lib64/python3.8/site-packages',
 '/usr/lib/python3.8/site-packages']
$ python3 -m pdb print-path.py  
> /home/user/print-path.py(1)()
-> import sys
(Pdb) c
['',
 '/usr/lib64/python38.zip',
 '/usr/lib64/python3.8',
 '/usr/lib64/python3.8/lib-dynload',
 '/usr/lib64/python3.8/site-packages',
 '/usr/lib/python3.8/site-packages']

--
messages: 381215
nosy: hexagonrecursion
priority: normal
severity: normal
status: open
title: Inconsistent sys.path between python and pdb

___
Python tracker 

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



[issue31121] Unable to exit pdb when script becomes invalid

2020-11-16 Thread Andrey Bienkowski


Andrey Bienkowski  added the comment:

Another way to reproduce this that will continue to work once #42383 is fixed 
is to delete or move the script while it's being debugged.

--
nosy: +hexagonrecursion

___
Python tracker 

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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2020-11-16 Thread Andrey Bienkowski


New submission from Andrey Bienkowski :

This was mentioned in #31121, but I believe this deserves its own separate 
issue. If the debug target is specified using a relative path and later the 
current directory is changed, pdb tries to search for the target in the new 
current directory. This currently causes pdb to be unable to exit, which is 
what #31121 and #14743 are about, but even if they are fixed we would still be 
left with pdb exiting instead of restarting the target. This issues is about 
the latter.

To reproduce (same as #31121):

$ mkdir foo
$ cat > foo/script.py
import os
os.chdir('foo')
$ python3 -m pdb foo/script.py 
> /home/user/foo/script.py(1)()
-> import os
(Pdb) c
The program finished and will be restarted
Traceback (most recent call last):
  File "/usr/lib64/python3.8/pdb.py", line 1704, in main
pdb._runscript(mainpyfile)
  File "/usr/lib64/python3.8/pdb.py", line 1570, in _runscript
with io.open_code(filename) as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'foo/script.py'
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /usr/lib64/python3.8/pdb.py(1570)_runscript()
-> with io.open_code(filename) as fp:

--
messages: 381213
nosy: hexagonrecursion
priority: normal
severity: normal
status: open
title: Pdb does not correclty restart the target if it changes the current 
directory

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2020-11-16 Thread Thomas


Thomas  added the comment:

I have simplified the test case a bit more:

import multiprocessing.pool, zipfile

# Create a ZipFile with two files and same content
with zipfile.ZipFile("test.zip", "w", zipfile.ZIP_STORED) as z:
z.writestr("file1", b"0"*1)
z.writestr("file2", b"0"*1)

# Read file1  with two threads at once
with zipfile.ZipFile("test.zip", "r") as z:
pool = multiprocessing.pool.ThreadPool(2)
while True:
pool.map(z.read, ["file1", "file1"])

Two files are sufficient to cause the error. It does not matter which files are 
read or which content they have.

I also narrowed down the point of failure a bit. After

self._file.seek(self._pos)

in _SharedFile.read ( 
https://github.com/python/cpython/blob/c79667ff7921444911e8a5dfa5fba89294915590/Lib/zipfile.py#L742
 ), the following assertion should hold:

assert(self._file.tell() == self._pos)

The issue occurs when seeking to position 35 (size of header + length of name). 
Most of the time, self._file.tell() will then be 35 as expected, but sometimes 
it is 8227 instead, i.e. 35 + 8192.

I am not sure how this can happen since the file object should be locked.

--

___
Python tracker 

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



[issue40383] weakref class name are hardcoded in reprs

2020-11-16 Thread OhBonsai


Change by OhBonsai :


--
nosy:  -OhBonsai

___
Python tracker 

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



[issue42382] No easy way to get the distribution which provided a importlib.metadata.EntryPoint

2020-11-16 Thread Pedro Algarvio


New submission from Pedro Algarvio :

With `pkg_resources` an `EntryPoint` has a dist attribute which allows you to 
get the distribution that provided that specific entry-point, however, with 
`importlib.metafata` and `importlib_metadata` that's not an east task.

```python
USE_IMPORTLIB_METADATA_STDLIB = USE_IMPORTLIB_METADATA = False
try:
# Py3.8+
import importlib.metadata

USE_IMPORTLIB_METADATA_STDLIB = True
except ImportError:
# < Py3.8 backport package
import importlib_metadata

USE_IMPORTLIB_METADATA = True


def get_distribution_from_entry_point(entry_point):
loaded_entry_point = entry_point.load()
if isinstance(loaded_entry_point, types.ModuleType):
module_path = loaded_entry_point.__file__
else:
module_path = sys.modules[loaded_entry_point.__module__].__file__
if USE_IMPORTLIB_METADATA_STDLIB:
distributions = importlib.metadata.distributions
else:
distributions = importlib_metadata.distributions

for distribution in distributions():
try:
relative = pathlib.Path(module_path).relative_to(
distribution.locate_file("")
)
except ValueError:
pass
else:
if relative in distribution.files:
return distribution
```

The above solution has the additional drawback that you're iterating the 
distributions list, once per EntryPoint, which, was already iterated to get the 
entry-points listing.

I propose we attach the Distribution instance to each of the found EntryPoint 
to avoid this low performance workaround.

I don't have an issue with providing a pull-request, but should that pull 
request be done against `importlib_metadata` or `importlib.metadata`?

--
components: Library (Lib)
messages: 381211
nosy: jaraco, s0undt3ch
priority: normal
severity: normal
status: open
title: No easy way to get the distribution which provided a 
importlib.metadata.EntryPoint
type: enhancement

___
Python tracker 

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



[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2020-11-16 Thread hongweipeng


hongweipeng  added the comment:

Class `Triffid` failed to create in `__init_subclass__`, so 
`Triffid._abc_cache` uses its base class `_abc_cache`.

--
nosy: +hongweipeng

___
Python tracker 

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



[issue17157] issubclass() should accept iterables in 2nd arg

2020-11-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

except ... is another instance of (exception) class or tuple of classes.

--

___
Python tracker 

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



[issue11604] Have type(n,b,d) check for type(b[i]) is module

2020-11-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I cannot anymore remember seeing this. So closing.

--
resolution:  -> out of date
stage: test needed -> resolved
status: pending -> closed

___
Python tracker 

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



[issue42335] Python Crashes Exception code 0xc0000374 ntdll.dll

2020-11-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thank you.  Good luck tracking down the problem.

--

___
Python tracker 

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



[issue12726] explain that locale.getlocale() does not read system's locales

2020-11-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

locale.getlocale(category=LC_CTYPE)

Returns the current setting for the given locale category as sequence 
containing language code, encoding. category may be one of the LC_* values 
except LC_ALL. It defaults to LC_CTYPE.

Except for the code 'C', the language code corresponds to RFC 1766. 
language code and encoding may be None if their values cannot be determined.
---
The non-standard 'C' language code is documented.  I am not sure that 'current 
program setting' is an improvement, especially if details have changed.  So 
closing as 'good enough'

--
resolution:  -> works for me
stage: needs patch -> 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



[issue9640] Improved doctest REPORT_*DIFFs with ELLIPSIS and/or NORMALIZE_WHITESPACE

2020-11-16 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +tim.peters

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2020-11-16 Thread Thomas


Thomas  added the comment:

Scratch what I said in the previous message. I thought that the lock was 
created in _SharedFile and did not notice that it was passed as a parameter.

--

___
Python tracker 

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-16 Thread miss-islington


miss-islington  added the comment:


New changeset f03d318ca42578e45405717aedd4ac26ea52aaed by Yurii Karabas in 
branch 'master':
bpo-42345: Fix three issues with typing.Literal parameters (GH-23294)
https://github.com/python/cpython/commit/f03d318ca42578e45405717aedd4ac26ea52aaed


--
nosy: +miss-islington

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Guido van Rossum

Guido van Rossum  added the comment:

Let’s make sure this is all written up in whatsnew.

--

___
Python tracker 

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



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2020-11-16 Thread Eryk Sun


Eryk Sun  added the comment:

> The patch adding 'name' and 'path' to the ImportError str/repr 
> was not merged yet.

It's up to whatever code raises an ImportError to determine how the name and 
path should be included in the error message. In Windows, the DLL name was 
added to the exception message in 3.8. So I'm closing this issue again, with 
regard to its final scope. 

With regard to its original scope, the reason for closing is "wont fix". There 
are no plans to extend the import error of an extension module in Windows to 
include the missing DLL dependency that caused the import to fail. There are 
tools such as the "DLL Diagnostics" package on PyPI that implement a proper 
trace by parsing loader snaps, and at the very least there are tools such as 
dumpbin.exe (or link.exe /dump) to manually list the direct dependencies of a 
DLL.

--
nosy: +eryksun
status: open -> closed

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +1
pull_request: https://github.com/python/cpython/pull/2

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset b0aba1fcdc3da952698d99aec2334faa79a8b68c by Pablo Galindo in 
branch 'master':
bpo-42381: Allow walrus in set literals and set comprehensions (GH-23332)
https://github.com/python/cpython/commit/b0aba1fcdc3da952698d99aec2334faa79a8b68c


--

___
Python tracker 

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



[issue42202] Optimize function annotation

2020-11-16 Thread Inada Naoki


Inada Naoki  added the comment:

> Yes, but the code for creating a dict can be simpler. In any case we will 
> better see what format is better when try to write a code.

Note that many annotations are not accessed. RAM usage of annotation 
information is important than how easy to create dict.

I don't like `(('x', 'int'), ('z', 'float'), ('return', 'Hoge'))` because it 
creates 4 tuples. It means use more memory, load pyc slower.

Please use ('x', 'int', 'z', 'float', 'return', 'Hoge') instead.

--

___
Python tracker 

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



[issue42287] Use Py_NewRef & Py_XNewRef where applicable

2020-11-16 Thread Yonatan Goldschmidt


Yonatan Goldschmidt  added the comment:

> I don't see how Py_NewRef() or Py_XNewRef() is less error prone. In my 
> experience, any change is more likely to introduce new bugs than leaving the 
> code unchanged.

Agree that inserting changes opens a door to introducing bugs.

However, the "end state" of having Py_NewRef() is desired, I think. It is more 
concise. It is less error prone because where you use it, you literally can't 
miss the "increment refcount" part when stealing a reference from another 
source. Py_INCREF has to come before/after stealing a ref, leaving room for 
error, IMHO.

> In general, we don't accept changes which are only coding style changes.

Didn't know that. Well if that's the case, then obviously there is no reason to 
work specifically on this conversion.

--

___
Python tracker 

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



[issue42368] Make set ordered

2020-11-16 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thank for the suggestion.  We've considered it a couple of times before but 
there are downsides that get in the way:

* The related mathematical concept of sets is unordered.

* It isn't clear what ordering should be returned
  by set operations like intersection, union, and 
  difference especially if we want the first two
  to be commutative and if we want consistent
  in-place and data removal options.

* It gets in the way of existing performance optimizations
  some of which are significant.

* Other programming languages don't seem to have 
  found compelling the need for this.

So yes, it is something we could do, but probably shouldn't.

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



[issue12726] explain that locale.getlocale() does not read system's locales

2020-11-16 Thread Eryk Sun


Eryk Sun  added the comment:

> I tried "import locale; locale.getlocale()" on macOS and 
> windows (3.10) and linux (3.7) and in all cases I got 
> non-None values.  

In Windows, starting with Python 3.8, Python sets the LC_CTYPE locale to the 
user (not system) default locale instead of the CRT's initial "C" locale. (This 
is possibly an unintended consequence of redesigning the interpreter startup 
code, but what's done is done.) The same has been implemented in POSIX going 
back to Python 3.1. It's not a significant change for the core interpreter and 
standard library, which do not use the LC_CTYPE encoding for much in Windows, 
but it might affect third-party code. Embedding applications can use an 
isolated configuration that doesn't modify LC_CTYPE.

locale.getdefaultlocale() is not based on C setlocale() in Windows. It returns 
the language and region of the user locale from WinAPI GetLocaleInfo() paired 
with the process code page from WinAPI GetACP(). The latter is generally the 
same as the system code page, but possibly not in Windows 10 if the application 
manifest sets the process "activeCodePage" to UTF-8. (python.exe as distributed 
doesn't use the "activeCodePage" setting in its manifest, but an embedding 
application might.)

> Given the next paragraph describing 'C' as a non-standard language 
> code, I would have expected ('C',None), but it is as it is.

The documentation is unclear. Locale normalization handles the common cases, 
for better or worse. "C.ASCII" maps to "C", which is parsed as (None, None). 
"C.UTF8" maps to "en_US.UTF-8", and "C.ISO88591" maps to "en_US.ISO8859-1". 
Other encodings combined with the "C" locale have no alias, in which case "C" 
is returned as the language code, even though it's not a valid RFC 1766 code.

--
nosy: +eryksun
status: pending -> open

___
Python tracker 

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



[issue41625] Add splice() to the os module

2020-11-16 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue41625] Add splice() to the os module

2020-11-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset a57b3d30f66c90f42da751bf82256b9b22961ed0 by Pablo Galindo in 
branch 'master':
bpo-41625: Expose the splice() system call in the os module (GH-21947)
https://github.com/python/cpython/commit/a57b3d30f66c90f42da751bf82256b9b22961ed0


--

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay.

--

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

> Nagging question — is there sufficient difference between {x := y} and {x: y} 
> ?

I think there is enough distinction, yes. It will also be a bit odd if is 
allowed in list and list comps but not set and set comps

--

___
Python tracker 

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



[issue14643] Security page out of date

2020-11-16 Thread Irit Katriel


Irit Katriel  added the comment:

"out of date" is prettier for this one. :)

--
resolution: fixed -> out of date

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

While {(a:='a'): (b:=1)} looks somewhat cleaner to me.

--

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Guido van Rossum

Guido van Rossum  added the comment:

Not in anything dict please.

Nagging question — is there sufficient difference between {x := y} and {x: y} ?

--

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

> dict comprehension

FWIW, unparenthesized walruses are still disallowed in dictcomps and to be 
honest, I'm not sure if we should allow them or not. I feel that allowing too 
many colons there would be too noisy.

{a:='a': b:=1} doesn't really look too beautiful.

--

___
Python tracker 

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



[issue17157] issubclass() should accept iterables in 2nd arg

2020-11-16 Thread Irit Katriel


Irit Katriel  added the comment:

Good discussion. There seems to be agreement that this should not be done.

--
nosy: +iritkatriel
resolution:  -> rejected
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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The only question left is that if we should allow this on dict literals and 
dict comprehensions as well (because these constructs have a ":" in the middle 
that can be noisy if there are walrus, the answer isn't immediately obvious to 
me).

--

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Apparently we currently don't allow walruses in set literals either:

>>> {y := 4, 4**2, 3**3}
  File "", line 1
{y := 4, 4**2, 3**3}
   ^
SyntaxError: invalid syntax

But they should be allowed as well per PEP 572 (as the pep mentions all 
comprehensions):

There is one special case: an assignment expression occurring in a list, set or 
dict comprehension or in a generator expression (below collectively referred to 
as "comprehensions") binds the target in ...

--

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue42120] Depreciated MACRO of copysign for MSVC

2020-11-16 Thread miss-islington


miss-islington  added the comment:


New changeset 4f54ca07341c656b763c8c71a051f7f86a2a256c by Miss Islington (bot) 
in branch '3.8':
bpo-42120: Remove macro defining copysign to _copysign on Windows (GH-23326)
https://github.com/python/cpython/commit/4f54ca07341c656b763c8c71a051f7f86a2a256c


--

___
Python tracker 

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



[issue42374] Unparenthesized walrus is not allowed in genexps

2020-11-16 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:


New changeset 2b800ef809eefbc96a536e4b43a8285f2353f64d by Lysandros Nikolaou in 
branch '3.9':
bpo-42374: Allow unparenthesized walrus in genexps (GH-23319) (GH-23329)
https://github.com/python/cpython/commit/2b800ef809eefbc96a536e4b43a8285f2353f64d


--

___
Python tracker 

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



[issue42374] Unparenthesized walrus is not allowed in genexps

2020-11-16 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2020-11-16 Thread Irit Katriel


Irit Katriel  added the comment:

The patch adding 'name' and 'path' to the ImportError str/repr was not merged 
yet.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.9 -Python 3.3

___
Python tracker 

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



[issue14643] Security page out of date

2020-11-16 Thread STINNER Victor


STINNER Victor  added the comment:

No. I close the issue :)

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



[issue40939] Remove the old parser

2020-11-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> The removals are documented, but the developers who are affected have no clue 
> what to do. What do you think?

Here is difficult to recommend a canonical Path because as I mentioned, there 
is no replacement for these functions because that functions returned CST nodes 
and those not exist anymore.

--

___
Python tracker 

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



[issue42120] Depreciated MACRO of copysign for MSVC

2020-11-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22219
pull_request: https://github.com/python/cpython/pull/23331

___
Python tracker 

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



[issue42120] Depreciated MACRO of copysign for MSVC

2020-11-16 Thread Steve Dower


Steve Dower  added the comment:


New changeset 9cc9e277254023c0ca08e1a9e379fd89475ca9c2 by Steve Dower in branch 
'master':
bpo-42120: Remove macro defining copysign to _copysign on Windows (GH-23326)
https://github.com/python/cpython/commit/9cc9e277254023c0ca08e1a9e379fd89475ca9c2


--

___
Python tracker 

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



[issue42120] Depreciated MACRO of copysign for MSVC

2020-11-16 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +22218
pull_request: https://github.com/python/cpython/pull/23330

___
Python tracker 

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



[issue13962] multiple lib and include directories on Linux

2020-11-16 Thread Irit Katriel


Irit Katriel  added the comment:

I think the suggestion here is to replace "if MACOS:" with a condition that 
hold for "unixy" platforms. 
https://github.com/python/cpython/blob/master/setup.py#L805

(based on https://bugs.python.org/msg150788).

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7

___
Python tracker 

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



[issue42374] Unparenthesized walrus is not allowed in genexps

2020-11-16 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +22217
pull_request: https://github.com/python/cpython/pull/23329

___
Python tracker 

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



[issue42316] Walrus Operator in list index

2020-11-16 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:


New changeset cae60187cf7a7b26281d012e1952fafe4e2e97e9 by Lysandros Nikolaou in 
branch 'master':
bpo-42316: Allow unparenthesized walrus operator in indexes (GH-23317)
https://github.com/python/cpython/commit/cae60187cf7a7b26281d012e1952fafe4e2e97e9


--

___
Python tracker 

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



[issue42374] Unparenthesized walrus is not allowed in genexps

2020-11-16 Thread miss-islington


miss-islington  added the comment:


New changeset cb3e5ed0716114393696ec7201e51fe0595eab4f by Lysandros Nikolaou in 
branch 'master':
bpo-42374: Allow unparenthesized walrus in genexps (GH-23319)
https://github.com/python/cpython/commit/cb3e5ed0716114393696ec7201e51fe0595eab4f


--
nosy: +miss-islington

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, I suppose the comprehensions should all have the same syntax inside their 
various brackets.

--

___
Python tracker 

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



[issue42131] [zipimport] Update zipimport to use specs

2020-11-16 Thread Brett Cannon


Change by Brett Cannon :


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



[issue25710] zipimport is not PEP 3147 or PEP 488 compliant

2020-11-16 Thread Brett Cannon


Change by Brett Cannon :


--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue40939] Remove the old parser

2020-11-16 Thread Miro Hrončok

Miro Hrončok  added the comment:

Thanks. I feel like the What's new document should teach people what to do when 
they are hit by the removals. The removals are documented, but the developers 
who are affected have no clue what to do. What do you think?

(Sorry I wasn't able to provide this feedback before the PR was merged.)

--

___
Python tracker 

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



[issue14643] Security page out of date

2020-11-16 Thread Irit Katriel


Irit Katriel  added the comment:

http://www.python.org/news/security/ no longer exists. Is this issue still 
relevant?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue42120] Depreciated MACRO of copysign for MSVC

2020-11-16 Thread Steve Dower


Steve Dower  added the comment:

Turns out a straight delete is fine, as both names are defined in UCRT. I think 
it's safe to backport as well, since it's only going to affect other people's 
code poorly (and they'll need to recompile to see any change anyway).

--
assignee:  -> steve.dower
versions: +Python 3.8, Python 3.9

___
Python tracker 

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



[issue42120] Depreciated MACRO of copysign for MSVC

2020-11-16 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

Since unparenthesized walruses are allowed in list comprehensions and in 
generator expressions, should we maybe allow them in set comprehensions as well?

--
components: Interpreter Core
messages: 381173
nosy: gvanrossum, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Allow unparenthesized walrus in set comprehensions
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue40939] Remove the old parser

2020-11-16 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Victor, Miro, both removal of the parser module and of all the C API functions 
are now documented in the 3.10 whatsnew document. Do you feel that this is 
enough for us to close this issue again?

--

___
Python tracker 

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



[issue5405] There is no way of determining which ABCs a class is registered against

2020-11-16 Thread Irit Katriel


Change by Irit Katriel :


--
type: behavior -> enhancement
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.1

___
Python tracker 

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



[issue42339] official embedded Python fails to import certain modules

2020-11-16 Thread Jelle Geerts


Jelle Geerts  added the comment:

Thanks to you too, Steve! *tips imaginary hat*

--

___
Python tracker 

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



[issue42336] Make PCbuild/build.bat build x64 by default

2020-11-16 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +22215
pull_request: https://github.com/python/cpython/pull/23325

___
Python tracker 

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



[issue5880] Remove unneeded "context" pointer from getters and setters

2020-11-16 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 3.3

___
Python tracker 

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



[issue18838] The order of interactive prompt and traceback on Windows

2020-11-16 Thread Adam Bartoš

Adam Bartoš  added the comment:

So far I could reproduce the issue on Python 3.7, Windows Vista 64bit. I'll try 
with newer versions.

The output I got:
>>> from subprocess import *
>>> Popen("py -i foo.py", stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()
(b'', b'>>> Traceback (most recent call last):\r\n  File "foo.py", line 2, in 
\r\n1/0\r\nZeroDivisionError: division by zero\r\n\r\n')

--
status: pending -> open

___
Python tracker 

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



[issue38506] Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 3.x

2020-11-16 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the patch, Zackery!

--
assignee:  -> steve.dower
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



[issue10479] cgitb.py should assume a binary stream for output

2020-11-16 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.1, Python 3.2

___
Python tracker 

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



[issue7955] TextIOWrapper Buffering Inconsistent Between _io and _pyio

2020-11-16 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.6, Python 2.7, Python 
3.1, Python 3.2

___
Python tracker 

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



[issue42278] Remove usage of tempfile.mktemp in stdlib

2020-11-16 Thread Steve Dower


Steve Dower  added the comment:

Just left a blocking review on the PR - I don't want to rely on the shell being 
able to use an already open file.

There's at least one other issue about making NamedTemporaryFile work for this 
case. Once that is done, this can be made to work.

--

___
Python tracker 

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



[issue42380] Build windows binaries with MS VS2019 16.8+ / MSVC 19.28+

2020-11-16 Thread h-vetinari


New submission from h-vetinari :

While Visual Studio 16.8 (<-> MSVC 19.28) has _just_ been released, I think it 
would be worthwhile to consider upgrading the compiler toolchain that's used to 
build the CPython windows binaries, particularly before the release of 3.10.

That's because many libraries (e.g. numpy/scipy) are stuck to the same 
compilers as CPython for ABI-compatibility, and generally, MSVC is by far the 
lowest common denominator in terms of C/C++ compliance, cf. 
https://github.com/scipy/scipy/blob/master/doc/source/toolchain.rst

For example, dropping python 3.6 support in scipy should finally enable them to 
use C++14/C++17, since python 3.7+ is built with Visual Studio 15.7, which has 
essentially complete support, cf. 
https://en.cppreference.com/w/cpp/compiler_support & 
https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering.

However (& as far as I can tell), the windows compiler version for CPython 
hasn't moved since the release of 3.7, cf. 
https://pythondev.readthedocs.io/windows.html#python-and-visual-studio-version-matrix
 (I know that's not an official page, but vstinner can hardly be considered a 
questionable source), and every release without upgrading the toolchain means 
another year of waiting for the ecosystem to unlock more modern C/C++.

The reason why Visual Studio 16.8 is particularly interesting, is that MS has 
for a very long time not paid attention to C compliance, and only recently 
completed C99 support, with C11/C17 following in 16.8 (though as of yet without 
optional aspects of the standard like atomics, threading, VLAs, complex types, 
etc.), cf. 
https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/.

Looking at the table from 
https://github.com/scipy/scipy/blob/master/doc/source/toolchain.rst, it would 
be cool if we could add the last line as follows
===   ==   ===
CPython   MS Visual C++C Standard
===   ==   ===
2.7, 3.0, 3.1, 3.2   9.0   C90
3.3, 3.410.0   C90 & some of C99
3.5, 3.614.0   C90 & most of C99
3.7 15.7   C90 & most of C99
3.8 15.7   C90 & most of C99
3.9 15.7   C90 & most of C99
3.1016.8   C99, C11*, C17
===   ==   ===
* [comment about lack of C11 optionals]

--
components: Windows
messages: 381167
nosy: h-vetinari, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Build windows binaries with MS VS2019 16.8+ / MSVC 19.28+
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-16 Thread David Edelsohn


David Edelsohn  added the comment:

I believe that Michael was trying to probe under what circumstances the failure 
appears.  But, not GCC 4.7 is not relevant.

--

___
Python tracker 

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



[issue38506] Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 3.x

2020-11-16 Thread Steve Dower


Steve Dower  added the comment:


New changeset f62dad16b8e540486a0a0fed41e723d36986f860 by Zackery Spytz in 
branch 'master':
bpo-38506: Fix the Windows py.exe launcher's misordering of 3.10 (GH-18307)
https://github.com/python/cpython/commit/f62dad16b8e540486a0a0fed41e723d36986f860


--

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-16 Thread STINNER Victor


STINNER Victor  added the comment:

> Back to the bot: AIX 7.1 TL4 SP8 and gcc-4.7.4

The latest GCC version is GCC 10. Is it still relevant to test GCC 4.7 released 
8 years ago? (Well, I'm not sure that the C compiler explains all issues.)

--

___
Python tracker 

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



[issue42339] official embedded Python fails to import certain modules

2020-11-16 Thread Steve Dower


Steve Dower  added the comment:

I added a note to the 3.8 docs.

Pretty sure there's another open issue about improving FormatMessage, and if 
not, one can be opened.

Thanks for the report, Jelle, and for helping us figure it out!

--
components: +Documentation
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



[issue42339] official embedded Python fails to import certain modules

2020-11-16 Thread Steve Dower


Steve Dower  added the comment:


New changeset fa86614078f1f700f350f98486dddf83587ab69e by Steve Dower in branch 
'3.8':
bpo-42339: Adds note about KB2533623 to embeddable package docs (GH-23322)
https://github.com/python/cpython/commit/fa86614078f1f700f350f98486dddf83587ab69e


--

___
Python tracker 

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



[issue13561] os.listdir documentation should mention surrogateescape

2020-11-16 Thread STINNER Victor


STINNER Victor  added the comment:

> I think this was added in another section of this doc. See the second 
> paragraph in 
> https://docs.python.org/3/library/os.html#file-names-command-line-arguments-and-environment-variables

Right, this section now explains encodings and the error handler.

Moreover, I recently reworked the documentation of the filesystem encoding and 
error handler:
* 
https://docs.python.org/dev/glossary.html#term-filesystem-encoding-and-error-handler
* https://docs.python.org/dev/library/os.html#python-utf-8-mode
* https://docs.python.org/dev/library/sys.html#sys.getfilesystemencoding
* etc.

I consider that it's now enough, I close the issue ;-) If someone wants to 
enhance the doc, please submit a PR. This issue is now quite old :-)

--
resolution:  -> fixed
stage: needs patch -> 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



[issue11604] Have type(n,b,d) check for type(b[i]) is module

2020-11-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Special cases aren't special enough to break the rules.

I think this issue should be closed. This is not common user error, especially 
in Python 3. I can even imagine that you can subclass module, if it is an 
instance of special ModuleType subclass. It is a feature of Python that you can 
subclass any objects, not only classes, if they provide the particular 
interface.

--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hi Rose, this is a FAQ:

https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects

although it's also a feature that does cause beginners some trouble, see for 
example my comment here for more information:

https://bugs.python.org/msg361451

--
nosy: +steven.daprano

___
Python tracker 

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



[issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH

2020-11-16 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



[issue42102] Make builtins.callable "generic"

2020-11-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

We specially introduced __mro_entries__ to make types in the typing module not 
classes. Turning builtins.callable into a class is a step back.

--

___
Python tracker 

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



[issue42339] official embedded Python fails to import certain modules

2020-11-16 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +22214
pull_request: https://github.com/python/cpython/pull/23322

___
Python tracker 

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



[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is defined behavior in the language, so it's not a bug. The "pythonic" way 
to deal with this is usually:

def funct(self, array = None):
if array is None:
 array = []

--
components: +Interpreter Core -ctypes
nosy: +eric.smith
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



[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Rose Ridder


Rose Ridder  added the comment:

Sorry, incorrect code pasted in. The full comment and code is below:

When creating several objects in one program, if there are lists passed into 
functions as optional arguments, those lists are persistent across all objects.

# -*- coding: utf-8 -*-

class Obj:
def __init__(self, num):
self.num = num
self.var = self.funct()

def funct(self, array = []):
array += [1,2,3] # issue also occurs with .append()
return array



def main():
obj1 = Obj(1)
print (obj1.num, obj1.var) # prints: 1 [1, 2, 3]

obj2 = Obj(2)

print (obj1.num, obj1.var) # prints: 1 [1, 2, 3, 1, 2, 3]
print (id(obj1), id(obj1.var)) # prints a unique address for obj1, but the 
address for the var attribute is the same as for obj2
print (obj2.num, obj2.var) # prints: 2 [1, 2, 3, 1, 2, 3]
print (id(obj2), id(obj2.var)) # prints a unique address for obj2, but the 
address for the var attribute is the same as for obj1


if __name__ == "__main__": 
main()

--

___
Python tracker 

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



[issue42102] Make builtins.callable "generic"

2020-11-16 Thread Shantanu


Shantanu  added the comment:

My implementation in PR 22848 turns callable into a type and uses `__new__`. It 
isn't too bad. It does appear to affect performance of callable though.

Here's some data on how often typing imports are used. This is the number of 
files in which `from typing import X` is present in mypy_primer's corpus 
(searched using the AST). My read of this is that Callable is meaningfully more 
used than anything else in collections.abc.
```
'Optional': 2563
'Any': 2402
'List': 2383
'Dict': 2150
'Tuple': 1592
'Union': 1269
'Callable': 1058
'Iterable': 609
'Set': 580
'cast': 505
'Sequence': 465
'Type': 438
'Iterator': 385
'TYPE_CHECKING': 357
'TypeVar': 302
'Mapping': 301
'Generator': 194
'NamedTuple': 138
'Text': 127
'IO': 120
'Awaitable': 116
...
```

--

___
Python tracker 

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



[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Rose Ridder


Rose Ridder  added the comment:

Including script explicitly:


# -*- coding: utf-8 -*-

class Obj:
def __init__(self, num):
self.num = num
self.var = self.funct()

def funct(self, array = []):
print (array)
array = [1,2,3]
return array



def main():
obj1 = Obj(1)
print (obj1.num, obj1.var) # prints: 1 [1, 2, 3]


obj2 = Obj(2)

print (obj1.num, obj1.var) # prints: 1 [1, 2, 3, 1, 2, 3]
print (obj2.num, obj2.var) # prints: 2 [1, 2, 3, 1, 2, 3]


if __name__ == "__main__": 
main()

--

___
Python tracker 

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



[issue42379] Optional List Args Persist Across Objects

2020-11-16 Thread Rose Ridder


New submission from Rose Ridder :

When creating several objects in one program, if there are lists passed into 
functions as optional arguments, those lists are persistent across all objects.

--
components: ctypes
files: PythonObjectListIssue.py
messages: 381153
nosy: rosadenderon
priority: normal
severity: normal
status: open
title: Optional List Args Persist Across Objects
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file49604/PythonObjectListIssue.py

___
Python tracker 

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



[issue3735] allow multiple threads to efficiently send the same requests to a processing.Pool without incurring duplicate processing

2020-11-16 Thread Irit Katriel


Irit Katriel  added the comment:

If nobody will object in the next couple of weeks I will close this, as 
suggested in the previous comment.

--
keywords:  -needs review
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue42102] Make builtins.callable "generic"

2020-11-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

>From implementation perspective it is not easy at all. You will need to create 
>a special class with methods __call__ and __getitem__ (and several other 
>methods and attributes, like __repr__, __reduce__, __name__, __doc__, 
>__module__, __text_signature__, etc) and make builtins.callable an instance 
>instead of just built-in function. It can also affect performance of 
>callable().

--

___
Python tracker 

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



[issue9261] [doc] include higher (../../) dirs fails

2020-11-16 Thread Christian Heimes


Christian Heimes  added the comment:

Works as intended. MANINFEST can only include files in the current directory 
and subdirectories.

--
nosy: +christian.heimes
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



[issue9640] Improved doctest REPORT_*DIFFs with ELLIPSIS and/or NORMALIZE_WHITESPACE

2020-11-16 Thread Irit Katriel


Irit Katriel  added the comment:

The patch needs to be converted into a github PR. Trevor, are you interested in 
doing that?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue9261] [doc] include higher (../../) dirs fails

2020-11-16 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Documentation -Distutils
title: include higher (../../) dirs fails -> [doc] include higher (../../) dirs 
fails
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.6

___
Python tracker 

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



[issue39463] ast.Constant, bytes, and ast.unparse

2020-11-16 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

We added the warnings, and I believe we can close this safely (since there is 
no intend to change the behavior of ast.unparse)

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



[issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH

2020-11-16 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
components: +macOS
nosy: +ned.deily

___
Python tracker 

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



[issue12594] Docs for "Using Python on a Macintosh" needs to be updated

2020-11-16 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
components: +macOS
nosy: +ronaldoussoren

___
Python tracker 

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



[issue21521] Tkinter + OSX + Spaces : Multiple file dialogues created

2020-11-16 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
components: +macOS
nosy: +ronaldoussoren

___
Python tracker 

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



[issue11604] Have type(n,b,d) check for type(b[i]) is module

2020-11-16 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +newcomer friendly
versions: +Python 3.10, Python 3.9 -Python 3.3

___
Python tracker 

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



[issue42202] Optimize function annotation

2020-11-16 Thread Jakub Stasiak


Change by Jakub Stasiak :


--
nosy: +jstasiak

___
Python tracker 

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



[issue42377] allow typing.cast with TYPE_CHECKING

2020-11-16 Thread Daniel Pinyol

New submission from Daniel Pinyol :

Executing the following code we get this error on the "cast" call
NameError: name 'A' is not defined


```
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, cast
if TYPE_CHECKING:
   class A:
 pass

def f(a: A):
   pass


f(cast(A, "anything"))
```

It would be nice that you could use "cast" to force casts when the symbol is 
only available during TYPE_CHECKING. According to the "cast" specs, cast only 
works during type checking, but not during runtime. Hence, I think would be 
desirable that this code was legal. thanks

This returns the value unchanged. To the type checker this signals that the 
return value has the designated type, but at runtime we intentionally don’t 
check anything (we want this to be as fast as possible).

--

___
Python tracker 

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



[issue42378] logging reopens file with same mode, possibly truncating

2020-11-16 Thread Ed Catmur


New submission from Ed Catmur :

If a logging.FileHandler is configured with mode='w', or if logging.basicConfig 
is called with filemode='w' (as suggested by the Basic Logging Tutorial 
https://docs.python.org/3/howto/logging.html#logging-basic-tutorial)
and if some code logs during shutdown, after logging has closed its handlers 
(asyncio is prone to do this, e.g.),
then logging.FileHandler._open will reopen the log file with the same mode as 
it was originally opened with, potentially truncating it and losing valuable 
information:

import atexit
atexit.register(lambda: logging.info("so long"))
import logging
logging.basicConfig(filename='test.log', filemode='w', level=logging.INFO)
logging.info("super important stuff")

$ python truncate.py
$ cat test.log
INFO:root:so long

I have a hunch that the fix to issue 26789 will potentially make things worse, 
as previously at least there was a chance that logging had been fully unloaded 
so that the call to open would fail.

https://stackoverflow.com/questions/39838616/why-is-python-logging-framework-losing-messages

--
components: Library (Lib)
messages: 381146
nosy: ecatmur2
priority: normal
severity: normal
status: open
title: logging reopens file with same mode, possibly truncating
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



  1   2   >