[issue44636] It is possible to create a 1-type union type

2021-07-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-07-15 Thread hongweipeng


Change by hongweipeng :


--
pull_requests: +25714
pull_request: https://github.com/python/cpython/pull/27177

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-07-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The posted code is incomplete, improperly indented, and a bit jumbled with 
respect to prompts.  If the bug is real, it should be possible to reproduce 
without pytz.  I do not have it on either Windows or macOS.  Vyacheslav, can 
you post a better failing example?

--

___
Python tracker 

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



[issue44646] hash() of the unity type is not consistent with equality

2021-07-15 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue44651] An unclear definition in Doc/glossary.rst

2021-07-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue35332] shutil.rmtree(..., ignore_errors=True) doesn't ignore errors from os.close()

2021-07-15 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

May be related: https://bugs.python.org/issue43666

--

___
Python tracker 

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



[issue35332] shutil.rmtree(..., ignore_errors=True) doesn't ignore errors from os.close()

2021-07-15 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I've looked a bit into this and it seems like ESTALE can be caused in two cases:

 - Under WPAR environment
https://www.ibm.com/docs/en/aix/7.1?topic=aix-wpar-concepts

https://www.ibm.com/support/pages/apar/IV50544
> When using WPAR setup under AIX, with each WPAR configured as an NFS client, 
> it is possible that asynchronous READDIR operations fail with ESTALE error

 - http://www.audentia-gestion.fr/IBM/PDF/basetrf2_pdf.pdf
ESTALE. The process's root or current directory is located in a virtual file 
system that has been unmounted.


In the first case, the solution given is to run READDIR under a different CID. 
I've found the definition of CID just 10 minutes ago but now can't find it 
again :(. Anyway, it seems to be an ID corresponding to the WPAR environment.

In the 2nd case, it's pretty clear that we shouldn't silence it: if you unmount 
a virtual partition while running rmtree on it, I'm 99.9% sure it was 
unintended!

In the first case, I don't think Python has any specific support for WPAR? 
Maybe? If not, we shouldn't do anything, if yes, maybe it can be fixed to 
handle this.

It sounds like Ronal may have ran into the first case, or something else 
entirely.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44651] An unclear definition in Doc/glossary.rst

2021-07-15 Thread Steven Hsu


New submission from Steven Hsu :

In Doc/glossary.rst, the definition about "coercion" is as below:

"The implicit conversion of an instance of one type to another during an 
operation which involves two arguments of the same type."

However, in the example following this definition, it shows the arguments of 
"different" type in an adding operation, and one of them was converted to 
`float` for the operation.

Therefore, we should fix the definition of the coercion to as below:

"The implicit conversion of an instance of one type to another during an 
operation which involves two arguments of the different type."

Or am I realize this sentence wrong?
Thanks for review.

https://github.com/python/cpython/blob/main/Doc/glossary.rst

--
assignee: docs@python
components: Documentation
messages: 397597
nosy: StevenHsuYL, docs@python
priority: normal
severity: normal
status: open
title: An unclear definition in Doc/glossary.rst
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-07-15 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-15 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> My python version is 3.8.9 and zipp is at 3.5.0 (but 3.4.1 behaves the same 
> for me).

It's not enough to have `zipp` 3.5.0. You need to use `zipp.Path` over 
`zipfile.Path`.

--

___
Python tracker 

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



[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-15 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Using zipfile.Path with several files prematurely closes zip

___
Python tracker 

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



[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-15 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Changing the repro to:

```
import zipfile

try:
import zipp
except ImportError:
import zipfile as zipp

zip_file = zipfile.ZipFile('zipfile.zip')
name = zip_file.namelist()[0]
zipp.Path(zip_file)
zip_file.open(name)
```

I'm able now to test against zipfile or zipp. And I notice that the issue 
occurs only on zipp<3.2 or Python<3.10.

```
draft $ pip-run -q 'zipp<3.3' -- issue44638.py
draft $ pip-run -q 'zipp<3.2' -- issue44638.py
Traceback (most recent call last):
  File "/Users/jaraco/draft/issue44638.py", line 11, in 
zip_file.open(name)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", 
line 1518, in open
fheader = zef_file.read(sizeFileHeader)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", 
line 741, in read
self._file.seek(self._pos)
ValueError: seek of closed file
```

```
draft $ python3.10 issue44638.py
draft $ python3.9 issue44638.py
Traceback (most recent call last):
  File "/Users/jaraco/draft/issue44638.py", line 11, in 
zip_file.open(name)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", 
line 1518, in open
fheader = zef_file.read(sizeFileHeader)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", 
line 741, in read
self._file.seek(self._pos)
ValueError: seek of closed file
```

Looking at the changelog 
(https://zipp.readthedocs.io/en/latest/history.html#v3-2-0), it's clear now 
that this issue is a duplicate of bpo-40564 and the problem goes away using the 
original repro and Python 3.10:

```
draft $ cat > issue44638.py
import zipfile


class TestClass:
def __init__(self, path):
self.zip_file = zipfile.ZipFile(path)

def iter_dir(self):
return [each.name for each in zipfile.Path(self.zip_file).iterdir()]

def read(self, filename):
with self.zip_file.open(filename) as file:
print(file.read())

root = "zipfile.zip"
test = TestClass(root)
files = test.iter_dir()
test.read(files[0])
draft $ python3.10 issue44638.py
b'import zipfile\n\n\nclass TestClass:\ndef __init__(self, path):\n
self.zip_file = zipfile.ZipFile(path)\n\ndef iter_dir(self):\n
return [each.name for each in zipfile.Path(self.zip_file).iterdir()]\n\ndef 
read(self, filename):\nwith self.zip_file.open(filename) as file:\n 
   print(file.read())\n\nroot = "zipfile.zip"\ntest = 
TestClass(root)\nfiles = test.iter_dir()\ntest.read(files[0])\n'

```

The solution is to use zipp>=3.2 or Python 3.10.

--

___
Python tracker 

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



[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-15 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Even simpler:

```
zip_file = zipfile.ZipFile('zipfile.zip')
name = zip_file.namelist()[0]
zipfile.Path(zip_file)
zip_file.open(name)
```

--

___
Python tracker 

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



[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-15 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

This also reproduces the failure:

```
zip_file = zipfile.ZipFile('zipfile.zip')
path = zipfile.Path(zip_file)
name = zip_file.namelist()[0]
del path
zip_file.open(name)
```

Removing `del path` bypasses the issue. Something about the destructor for 
zipfile.Path is causing the closing of the handle for zip_file.

--

___
Python tracker 

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



[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-15 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Even simpler:

```
import zipfile


zip_file = zipfile.ZipFile('zipfile.zip')
names = [each.name for each in zipfile.Path(zip_file).iterdir()]
zip_file.open(names[0])
```

--

___
Python tracker 

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



[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-15 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Here's a much simpler repro that avoids the class construction but triggers the 
same error:

```
import zipfile


zip_file = zipfile.ZipFile('zipfile.zip')
names = [each.name for each in zipfile.Path(zip_file).iterdir()]
with zip_file.open(names[0]) as file:
print(file.read())
```

--

___
Python tracker 

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



[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-15 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I was able to replicate the error using the script as posted:

```
draft $ cat > issue44638.py
import zipfile


class TestClass:
def __init__(self, path):
self.zip_file = zipfile.ZipFile(path)

def iter_dir(self):
return [each.name for each in zipfile.Path(self.zip_file).iterdir()]

def read(self, filename):
with self.zip_file.open(filename) as file:
print(file.read())

root = "zipfile.zip"
test = TestClass(root)
files = test.iter_dir()
test.read(files[0])
draft $ python -m zipfile -c zipfile.zip issue44638.py
draft $ python issue44638.py
Traceback (most recent call last):
  File "/Users/jaraco/draft/issue44638.py", line 18, in 
test.read(files[0])
  File "/Users/jaraco/draft/issue44638.py", line 12, in read
with self.zip_file.open(filename) as file:
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", 
line 1518, in open
fheader = zef_file.read(sizeFileHeader)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", 
line 741, in read
self._file.seek(self._pos)
ValueError: seek of closed file
```

--

___
Python tracker 

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



[issue43950] Include column offsets for bytecode instructions

2021-07-15 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 919ad537510fdc2c750109e0bc4eceea234324b2 by Batuhan Taskaya in 
branch 'main':
bpo-43950: make BinOp specializations more reliable (GH-27126)
https://github.com/python/cpython/commit/919ad537510fdc2c750109e0bc4eceea234324b2


--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread miss-islington


miss-islington  added the comment:


New changeset 298ee657ab8170adf75a186c0414b7ca3baf1991 by Miss Islington (bot) 
in branch '3.9':
bpo-44184: Fix subtype_dealloc() for freed type (GH-26274)
https://github.com/python/cpython/commit/298ee657ab8170adf75a186c0414b7ca3baf1991


--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread Thomas Wouters


Thomas Wouters  added the comment:


New changeset 0b4704973dbef712d05bdd62349bb4244f545430 by Miss Islington (bot) 
in branch '3.9':
bpo-44184: Apply GH-26274 to the non-GC-type branch of subtype_dealloc 
(GH-27165) (GH-27175)
https://github.com/python/cpython/commit/0b4704973dbef712d05bdd62349bb4244f545430


--

___
Python tracker 

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



[issue42095] plistlib: Add tests that compare with plutil(1)

2021-07-15 Thread Hasan


Change by Hasan :


--
pull_requests:  -25709

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread Thomas Wouters


Change by Thomas Wouters :


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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread Thomas Wouters


Thomas Wouters  added the comment:

Fix extended to the other branch (and backported to 3.10), and both parts 
backported to 3.9. I don't think it counts as a security issue, so not 
backporting to 3.8.

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread Thomas Wouters


Thomas Wouters  added the comment:


New changeset 6aa59c68dc7910c0675ad23c1f9d88edfb81dfcb by Miss Islington (bot) 
in branch '3.10':
bpo-44184: Apply GH-26274 to the non-GC-type branch of subtype_dealloc 
(GH-27165) (GH-27174)
https://github.com/python/cpython/commit/6aa59c68dc7910c0675ad23c1f9d88edfb81dfcb


--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25713
pull_request: https://github.com/python/cpython/pull/27176

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25712
pull_request: https://github.com/python/cpython/pull/27175

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25711
pull_request: https://github.com/python/cpython/pull/27174

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread Thomas Wouters


Thomas Wouters  added the comment:


New changeset 074e7659f208051b6b973f7fdb654dd22b93aaa2 by T. Wouters in branch 
'main':
bpo-44184: Apply GH-26274 to the non-GC-type branch of subtype_dealloc 
(GH-27165)
https://github.com/python/cpython/commit/074e7659f208051b6b973f7fdb654dd22b93aaa2


--

___
Python tracker 

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



[issue42095] plistlib: Add tests that compare with plutil(1)

2021-07-15 Thread Hasan


Change by Hasan :


--
pull_requests: +25710
pull_request: https://github.com/python/cpython/pull/27173

___
Python tracker 

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



[issue42095] plistlib: Add tests that compare with plutil(1)

2021-07-15 Thread Hasan


Change by Hasan :


--
pull_requests: +25709
pull_request: https://github.com/python/cpython/pull/27172

___
Python tracker 

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



[issue34828] sqlite.iterdump does not work for (most) databases with autoincrement

2021-07-15 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue44634] Version is duplicated in name of app in list of installed apps

2021-07-15 Thread Pavel Moiseenko


Pavel Moiseenko  added the comment:

This does not cause any problems in the operation of the app, but visually it 
looks strange. Most other apps don't indicate the version of the app in the 
name of the app, but just indicate it in a specially made field for this. 
Therefore, it would be nice if your app followed this behavior.

Perhaps these links will also be helpful: 
https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key, 
https://stackoverflow.com/questions/26156405/how-to-change-add-remove-program-name-using-wix-installer

And can you tell me where the WiX config file is?

--

___
Python tracker 

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



[issue44641] [sqlite3] Use vectorcall in pysqlite_collation_callback

2021-07-15 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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



[issue44650] Move test_futures files*.py into a subdirectory of Lib/test

2021-07-15 Thread Leonardo Freua


Leonardo Freua  added the comment:

List of files:

test_future.py
test_future3.py
test_future4.py
test_future5.py

Obs.: In fact there are 5 files, since the number 2 doesn't exist.

--

___
Python tracker 

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



[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-15 Thread Andrei Kulakov


Change by Andrei Kulakov :


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

___
Python tracker 

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



[issue44650] Move test_futures files* into a subdirectory of Lib/test

2021-07-15 Thread Leonardo Freua


Change by Leonardo Freua :


--
components: +Library (Lib), Tests
type:  -> enhancement
versions: +Python 3.11

___
Python tracker 

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



[issue44650] Move test_futures files*.py into a subdirectory of Lib/test

2021-07-15 Thread Leonardo Freua


Change by Leonardo Freua :


--
title: Move test_futures files* into a subdirectory of Lib/test -> Move 
test_futures files*.py into a subdirectory of Lib/test

___
Python tracker 

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



[issue44650] Move test_futures files* into a subdirectory of Lib/test

2021-07-15 Thread Leonardo Freua


New submission from Leonardo Freua :

There are currently 6 files referring to __future__ tests, these are in the 
root directory Lib/test.

It would be interesting to move them to a directory called Lib/test/test_future.

This change could contribute to the organization of the tests that have already 
been discussed in other issues (e.g https://bugs.python.org/issue15907).

I wait for the ok to send the PR.

--
messages: 397581
nosy: Leonardofreua
priority: normal
severity: normal
status: open
title: Move test_futures files* into a subdirectory of Lib/test

___
Python tracker 

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



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

2021-07-15 Thread Leonardo Freua


Leonardo Freua  added the comment:

After so long a reason came up that prevents the movement of tests of ctypes, 
lib2to3, and idlelib (which even continues in the same folder, only the 
nomenclature was changed)?

--
nosy: +Leonardofreua

___
Python tracker 

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



[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-15 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 95596d5921eeab9ae49f0dc31263a249013b6849 by Miss Islington (bot) 
in branch '3.9':
bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on 
Windows (GH-27161) (#27170)
https://github.com/python/cpython/commit/95596d5921eeab9ae49f0dc31263a249013b6849


--

___
Python tracker 

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



[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 356bdff1e952f2ab7fdebae855bd78b401b735c4 by Miss Islington (bot) 
in branch '3.10':
bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on 
Windows (GH-27161) (#27169)
https://github.com/python/cpython/commit/356bdff1e952f2ab7fdebae855bd78b401b735c4


--

___
Python tracker 

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



[issue44636] It is possible to create a 1-type union type

2021-07-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm, you are right. Make it so, Mr. Spock! :-)

--

___
Python tracker 

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



[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-15 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +25706
pull_request: https://github.com/python/cpython/pull/27169

___
Python tracker 

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



[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25707
pull_request: https://github.com/python/cpython/pull/27170

___
Python tracker 

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



[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 82b218f36ce6ef910bda5af227a9fd5be613c94f by Łukasz Langa in 
branch 'main':
bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on 
Windows (GH-27161)
https://github.com/python/cpython/commit/82b218f36ce6ef910bda5af227a9fd5be613c94f


--

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-07-15 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith
nosy: +eric.smith

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-07-15 Thread Christodoulos Tsoulloftas

New submission from Christodoulos Tsoulloftas :

I am trying the new slots directive but I get an AttributeError when I try to 
access a field with init=False


>>> from dataclasses import dataclass, field
>>> 
>>> @dataclass(slots=True)
... class Example:
... a: str
... b: str = field(default="b", init=False)
... 
>>> obj = Example("a")
>>> obj.__slots__
('a', 'b')
>>> obj.
obj.a  obj.b  
>>> obj.a
'a'
>>> obj.b
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: b. Did you mean: 'b'?
>>> 



❯ python --version
Python 3.10.0b4+

--
components: Library (Lib)
messages: 397575
nosy: tefra
priority: normal
severity: normal
status: open
title: dataclasses slots with init=False field raises AttributeException
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



[issue44600] match/case statements trace incorrectly in 3.10.0b4

2021-07-15 Thread Brandt Bucher


Brandt Bucher  added the comment:

Thanks, that test framework looks good for this.

My initial hunch (just from looking at this) is that this has to do with how we 
handle cleanup after failed matches. Our "fail pop" blocks probably have 
whatever the last line number compiled was (which I think is always the last 
line of the preceding case block).

The fix *should* be as simple as calling "SET_LOC(c, 
whatever_the_last_pattern_was)" before compiling these blocks.

I have some new-ish contributors who might want to take this. As far as 
compiler issues go, this one seems pretty straightforward.

--

___
Python tracker 

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



[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-15 Thread Andrei Kulakov


New submission from Andrei Kulakov :

[ins] In [63]: class A:pass

[ins] In [64]: import inspect

[ins] In [65]: inspect.getsource(A)

[snip]

/usr/local/Cellar/python@3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/inspect.py
 in getfile(object)
664 if getattr(module, '__file__', None):
665 return module.__file__
--> 666 raise TypeError('{!r} is a built-in class'.format(object))

The error is 'X is a built-in class', instead it should be OSError, source code 
is not available.

--
messages: 397573
nosy: andrei.avk
priority: normal
severity: normal
status: open
title: Inspect.getsource raises wrong error on classes in interactive session
type: behavior
versions: Python 3.11

___
Python tracker 

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



[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-15 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-15 Thread Łukasz Langa

Change by Łukasz Langa :


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

___
Python tracker 

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



[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-15 Thread Łukasz Langa

New submission from Łukasz Langa :

GH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This 
test serializes all of `os.environ` on the server side.  For non-UTF8 locales 
this can fail for some Unicode characters found in environment variables.

This started failing this week on Azure Pipelines with their rollout of a new 
Windows 2019 image version that included a "BUILD_SOURCEVERSIONAUTHOR" env 
variable. For me specifically it includes a leading Unicode character so all my 
PRs started failing on Azure Pipelines Windows 2019 alone.

The result was truncated output from the CGI HTTP server, like:

==
FAIL: test_accept (test.test_httpservers.CGIHTTPServerTestCase) 
[OrderedDict([('Accept', 
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')])]
--
Traceback (most recent call last):
  File "D:\a\1\s\lib\test\test_httpservers.py", line 860, in test_accept
self.assertIn(expected.encode('ascii'), res.read())
^^^
AssertionError: b"'HTTP_ACCEPT': 
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'" not found in 
b''


The root cause is that the CGI script in question (`cgi_file6` in 
test_httpservers.py) is crashing on server-side reaching the 
`print(repr(os.environ))` line. However, this exception isn't visible on the 
client side where the test is running. The only visible issue is truncated 
output.

I suggest adding ENSURE_UNICODE_WORKS=Łukasz to the testing env so that this 
never regresses.

--
messages: 397572
nosy: lukasz.langa
priority: normal
severity: normal
status: open
title: Non-ASCII characters in os.environ cause silent failures in 
test_httpservers
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44611] CPython uses deprecated randomness API

2021-07-15 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue44616] Incorrect tracing for "except" with variable

2021-07-15 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

Thanks Ned.  Seems you might be right.  I thought I'd done a clean test, but in 
any event, I just pulled 3.10 head and verified that it's producing 100% 
coverage.  Thanks all for the fix!

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

___
Python tracker 

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



[issue44642] Union of a type and the typing module function

2021-07-15 Thread Ken Jin


Ken Jin  added the comment:

@Serhiy
> 1. Make NewType a class and add more strict test.

See also: issue44353 (https://bugs.python.org/issue44353). We had some 
discussion there about converting to class but it ended in a deadlock.

--

___
Python tracker 

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



[issue44642] Union of a type and the typing module function

2021-07-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is only reminder that our test for NewType is arbitrary. And it is not 
compatible with PR 9951. Possible solutions are:

1. Make NewType a class and add more strict test. Pro -- we can make arbitrary 
repr, contra -- it has small negative effect on performance. See issue34963.

2. Remove the test for NewType at all and allow or-ing types and arbitrary 
functions.

3. Introduce a special attribute to distinguish unionable objects. It will make 
the code of unionobject.c simpler.

I lean towards option 1 (not excluding 3). Small performance losses seem 
inevitable.

--

___
Python tracker 

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



[issue44626] Incorrect tracing of nested if/if/for/yield

2021-07-15 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset a86f7dae0acf918d54086cb85e5a0b0bedeedce7 by Mark Shannon in 
branch 'main':
bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks 
without line numbers (GH-27138)
https://github.com/python/cpython/commit/a86f7dae0acf918d54086cb85e5a0b0bedeedce7


--

___
Python tracker 

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



[issue44646] hash() of the unity type is not consistent with equality

2021-07-15 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

There is a rule: equal hashable objects should have the same hash. The unity 
type violates it.

>>> x = int | str
>>> y = str | int
>>> x == y
True
>>> hash(x) == hash(y)
False

And hashes of equal unity type and typing.Union are different too.

>>> import typing
>>> z = typing.Union[int, str]
>>> x == z
True
>>> hash(x) == hash(z)
False

There is also a problem with a single type (see issue44636).

--
components: Interpreter Core
messages: 397567
nosy: gvanrossum, kj, serhiy.storchaka
priority: normal
severity: normal
status: open
title: hash() of the unity type is not consistent with equality
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue42095] plistlib: Add tests that compare with plutil(1)

2021-07-15 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
 added the comment:

Hasan, Please raise a PR on GitHub.

--
nosy: +thatiparthy

___
Python tracker 

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



[issue44616] Incorrect tracing for "except" with variable

2021-07-15 Thread Ned Batchelder


Ned Batchelder  added the comment:

Barry, is it possible you accidentally used the beta 4?  I ran the test suite 
with a freshly built 3.10, but by mistake was still using the beta, and was 
surprised.  Once I really got the latest build in place (Python 3.10.0b4+ 
(heads/3.10:47695e3c88, Jul 15 2021, 11:55:52)), I got these results:

platform darwin -- Python 3.10.0b4+, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
cachedir: .tox/py310/.pytest_cache
rootdir: /System/Volumes/Data/root/src/foo/bug1187/flufl.lock, configfile: 
setup.cfg, testpaths: test, docs
plugins: cov-2.12.1
collected 108 items

test/test_api.py .  
[  
0%]
test/test_lock.py ...   
[ 
25%]
docs/using.rst 

 [100%]

 
warnings summary 
=
.tox/py310/lib/python3.10/site-packages/sybil/integration/pytest.py:58: 80 
warnings
  
/System/Volumes/Data/root/src/foo/bug1187/flufl.lock/.tox/py310/lib/python3.10/site-packages/sybil/integration/pytest.py:58:
 PytestDeprecationWarning: A private pytest class or function was used.
self._request = fixtures.FixtureRequest(self)

-- Docs: https://docs.pytest.org/en/stable/warnings.html

-- coverage: platform darwin, python 3.10.0-beta-4 ---
Name  Stmts   Miss Branch BrPart  Cover   Missing
-
flufl/lock/__init__.py5  0  0  0   100%
flufl/lock/_lockfile.py 253  0 80  0   100%
-
TOTAL   258  0 80  0   100%
Coverage XML written to file coverage.xml

Required test coverage of 100.0% reached. Total coverage: 100.00%

--

___
Python tracker 

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



[issue44636] It is possible to create a 1-type union type

2021-07-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is a difference with typing.Union which can cause confusion. If the union 
type is like a tuple and we leave a 1-type union, why do we bother with 
deduplication? Why int | str | int is collapsed into int | str?

Also it complicates the comparison implementation and produces surprising 
exceptions:

>>> int | str == {}
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unhashable type: 'dict'

Also it breaks one of fundamental properties -- equal objects should have equal 
hashes.

>>> (int | int) == int
True
>>> hash(int | int) == hash(int)
False

--

___
Python tracker 

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



[issue44637] Quoting issue on header Reply-To

2021-07-15 Thread R. David Murray


R. David Murray  added the comment:

Yes, compat32 uses a different parser and folder (the legacy ones), that have a 
lot of small bugs relative to the RFCs (which is why I rewrote it).

--

___
Python tracker 

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



[issue44641] [sqlite3] Use vectorcall in pysqlite_collation_callback

2021-07-15 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5007a4f23c551f8821483d15e76d0d15d5cb9945 by Erlend Egeberg 
Aasland in branch 'main':
bpo-44641: Use vectorcall in sqlite3 collation callback (GH-27158)
https://github.com/python/cpython/commit/5007a4f23c551f8821483d15e76d0d15d5cb9945


--
nosy: +pablogsal

___
Python tracker 

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



[issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs

2021-07-15 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Alexander: sorry, I didn't notice your PR because I was first working on a 
different issue, and then found this as a duplicate, and only noticed there's 
already an open PR here. If you prefer, we can close my PR and work on updating 
yours.

--

___
Python tracker 

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



[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-15 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue44611] CPython uses deprecated randomness API

2021-07-15 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs

2021-07-15 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I've put up the doc update PR here:
https://github.com/python/cpython/pull/27166

I've also reviewed a few dozen SO questions about filecmp.cmp and shallow arg, 
many of them find the docs confusing or lacking, so I thought updating docs is 
definitely very useful.

I haven't seen any of them asking for "force shallow" behavior, but there's 
many of them and I haven't read all; searching for "force shallow" doesn't find 
any.

I think it might be useful to also add a new 'force shallow' arg, but I hope 
more people ask for it or compile a list of SO questions asking for it, 
otherwise it might not be worth additional complexity.

--

___
Python tracker 

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



[issue44605] functools.total_ordering doesn't work with metaclasses

2021-07-15 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
versions:  -Python 3.10, 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



[issue44605] functools.total_ordering doesn't work with metaclasses

2021-07-15 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs

2021-07-15 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
pull_requests: +25702
pull_request: https://github.com/python/cpython/pull/27166

___
Python tracker 

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



[issue44636] It is possible to create a 1-type union type

2021-07-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

I feel that keeping the singleton is more consistent. This normalization seems 
to me an example of the typing module doing too much. Singleton tuples are 
different from scalar values too.

--

___
Python tracker 

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



[issue44642] Union of a type and the typing module function

2021-07-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Is it worth being picky about this? The internal data structures are safe. A 
static checker will complain. What more do you need?

--

___
Python tracker 

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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2021-07-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Way to go Irit!--
--Guido (mobile)

--

___
Python tracker 

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



[issue44622] async-for loops are traced incorrectly in Python 3.10

2021-07-15 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue44622] async-for loops are traced incorrectly in Python 3.10

2021-07-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 47695e3c88343e794d37333853b2ba3f16505c5d by Mark Shannon in 
branch '3.10':
bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. 
(GH-27160) (GH-27163)
https://github.com/python/cpython/commit/47695e3c88343e794d37333853b2ba3f16505c5d


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44637] Quoting issue on header Reply-To

2021-07-15 Thread Julien Castiaux


Julien Castiaux  added the comment:

Update, it works fine with the compat32 policy

--

___
Python tracker 

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



[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-15 Thread Mark Shannon


Mark Shannon  added the comment:

https://github.com/python/cpython/pull/18334 assumes that since all loops will 
contain a backwards edge, checking for interrupts on JUMP_ABSOLUTE should be 
sufficient.

However, https://github.com/python/cpython/pull/23743 changed the back edges in 
while statements. So `worker` compiles to:

  2   0 LOAD_GLOBAL  0 (cont)
  2 POP_JUMP_IF_FALSE7 (to 14)

  3 >>4 NOP

  2   6 LOAD_GLOBAL  0 (cont)
  8 POP_JUMP_IF_TRUE 2 (to 4)
 10 LOAD_CONST   0 (None)
 12 RETURN_VALUE
>>   14 LOAD_CONST   0 (None)
 16 RETURN_VALUE

which has no CALL or JUMP_ABSOLUTE instructions.

--

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread Thomas Wouters


Change by Thomas Wouters :


--
pull_requests: +25701
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/27165

___
Python tracker 

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



[issue44184] crash on windows invoking flake8

2021-07-15 Thread Thomas Wouters


Thomas Wouters  added the comment:

Reopening this issue, as there is another branch (for non-GC heaptypes) earlier 
in subtype_dealloc that I believe suffers from the same problem. Actually 
triggering the error in a test has been difficult because as far as I can tell 
it relies on garbage collection at the right time, but reading the code it 
seems clear it's problematic. I'll prepare a PR to fix it there.

I'm also reopening this issue because I believe it should've been backported to 
3.9, and possibly 3.8 (if it's considered a security problem to get python to 
read and write freed memory). I found this issue in 3.9 while debugging a 
pybind11 crash. I'll backport after the other PR is in (or rejected).

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



[issue44622] async-for loops are traced incorrectly in Python 3.10

2021-07-15 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +25700
pull_request: https://github.com/python/cpython/pull/27163

___
Python tracker 

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



[issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__

2021-07-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 2ce8af3cbcb368a35a05a5a9f97a09405124f239 by Miss Islington (bot) 
in branch '3.10':
bpo-42073: allow classmethod to wrap other classmethod-like descriptors 
(GH-27115) (GH-27162)
https://github.com/python/cpython/commit/2ce8af3cbcb368a35a05a5a9f97a09405124f239


--

___
Python tracker 

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



[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable

2021-07-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 2ce8af3cbcb368a35a05a5a9f97a09405124f239 by Miss Islington (bot) 
in branch '3.10':
bpo-42073: allow classmethod to wrap other classmethod-like descriptors 
(GH-27115) (GH-27162)
https://github.com/python/cpython/commit/2ce8af3cbcb368a35a05a5a9f97a09405124f239


--

___
Python tracker 

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



[issue44622] async-for loops are traced incorrectly in Python 3.10

2021-07-15 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset f333ab0f2edec26a769ed558263ac662e5475451 by Mark Shannon in 
branch 'main':
bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. 
(GH-27160)
https://github.com/python/cpython/commit/f333ab0f2edec26a769ed558263ac662e5475451


--

___
Python tracker 

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



[issue44622] async-for loops are traced incorrectly in Python 3.10

2021-07-15 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-15 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
components: +Interpreter Core
stage:  -> needs patch

___
Python tracker 

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



[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-15 Thread Jesús Cea Avión

New submission from Jesús Cea Avión :

After https://github.com/python/cpython/pull/18334, a "while condition: pass" 
in a thread will preclude releasing the GIL, hanging the program with CPU at 
100%.

Trivial to reproduce:

"""
#!/usr/bin/env python3.10

import threading
import time

def worker():
while cont:
pass

def main():
global cont
cont = True
t = threading.Thread(target=worker)
t.start()
time.sleep(1)
cont = False
t.join()

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

--
keywords: 3.10regression
messages: 397549
nosy: Mark.Shannon, jcea, pablogsal
priority: release blocker
severity: normal
status: open
title: Python 3.10: Under some trivial circunstances, GIL not released
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



[issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__

2021-07-15 Thread Łukasz Langa

Change by Łukasz Langa :


--
versions: +Python 3.11 -Python 3.9

___
Python tracker 

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



[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable

2021-07-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25699
pull_request: https://github.com/python/cpython/pull/27162

___
Python tracker 

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



[issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__

2021-07-15 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +25698
pull_request: https://github.com/python/cpython/pull/27162

___
Python tracker 

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



[issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__

2021-07-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset b83861f0265e07207a6ae2c49c40fa8f447893f2 by Łukasz Langa in 
branch 'main':
bpo-42073: allow classmethod to wrap other classmethod-like descriptors (#27115)
https://github.com/python/cpython/commit/b83861f0265e07207a6ae2c49c40fa8f447893f2


--

___
Python tracker 

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



[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable

2021-07-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset b83861f0265e07207a6ae2c49c40fa8f447893f2 by Łukasz Langa in 
branch 'main':
bpo-42073: allow classmethod to wrap other classmethod-like descriptors (#27115)
https://github.com/python/cpython/commit/b83861f0265e07207a6ae2c49c40fa8f447893f2


--

___
Python tracker 

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



[issue44637] Quoting issue on header Reply-To

2021-07-15 Thread Julien Castiaux


Julien Castiaux  added the comment:

Hello David,

I'm working in the same company as Baptiste and I'm trying to solve the 
problem. The issue is indeed related to the folding algorithm, the DBQUOTE 
character is lost in the parse_tree AST thus when the folding algo split the 
children to find a sweat spot to split the line it doesn't re-introduce the 
DBQUOTE and instead inject the content of the BareQuotedString right away.

I'm working on a fix which consist of adding two DBQUOTE, one at the beginning 
and one at the end, of the BareQuotedString token when it is created 
(_header_value_parser.py@get_bare_quoted_string()). I was inspired by how the 
angles < and > are injected around the AddrSpec token in a AngleAddr token.

Right now my fix isn't correct, there are some unittest falling. I'm trying to 
get it working and hopefully get back to you with a nice pull-request :)

Regards,
Julien

--

___
Python tracker 

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



[issue31791] Ensure that all PyTypeObject fields are set to non-NULL defaults

2021-07-15 Thread Irit Katriel


Change by Irit Katriel :


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



[issue44637] Quoting issue on header Reply-To

2021-07-15 Thread R. David Murray


R. David Murray  added the comment:

Forget what I said about my different error, I made a mistake running the test 
script.

Interesting.  If it is related to the length of the name, then the problem is 
most likely in the folding algorithm, specifically in what happens when the 
"display-name" token is wrapped across lines.  And indeed, if we clone the SMTP 
policy and set the max_line_len to 1000 in your sample script. it renders the 
header correctly.

The problem here is that the surrounding quotation marks are added by the 
'value' property of DisplayName, but that property isn't invoked when handling 
parts of the display name separately during mulit-line folding.  I was always 
bothered by the handling of the quotation marks in the part of the parser and 
folder dealing with quoted strings, but I never hit on a better way to do it.  
This, unfortunately, is going to be non-trivial problem to solve.  It is 
probably going to require an ugly hack in the folding code :(

Really, the handling of quoted strings throughout the _header_value_parser code 
is...a hack :(  There are probably other places where it breaks down during 
multi-line folding.  If we are lucky the hack can just add special handling for 
the quoted-string token type in the folder.  If we aren't it will get messier :(

Glancing at the folder code (it's been a long time since I worked on it), one 
possible approach (not necessarily the best one) would be to mark the first and 
last sub-tokens in a quoted-string so that folder knows to put in a leading or 
trailing quote mark, respectively, during folding.

--

___
Python tracker 

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



[issue43948] sysconfig's osx_framework_user puts headers in different locations from distutils

2021-07-15 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks! ✨ 🍰 ✨

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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2021-07-15 Thread Irit Katriel


Change by Irit Katriel :


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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2021-07-15 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 641345d636320a6fca04a5271fa4c4c5ba3e5437 by Irit Katriel in 
branch 'main':
bpo-26280: Port BINARY_SUBSCR to PEP 659 adaptive interpreter (GH-27043)
https://github.com/python/cpython/commit/641345d636320a6fca04a5271fa4c4c5ba3e5437


--

___
Python tracker 

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



[issue44644] Implement “Happy Eyeballs” algorithim (RFC 8503) in socket.create_connection()

2021-07-15 Thread origin400-p

New submission from origin400-p :

While support for the so-called “Happy Eyeballs” algorithim described in RFC 
8503 was implemented for asyncio in Issue #33530, socket's create_connection 
function remains left without it causing suboptimal performance in broken 
dual-stack environments.

--
components: Library (Lib)
messages: 397542
nosy: origin400-p
priority: normal
severity: normal
status: open
title: Implement “Happy Eyeballs” algorithim (RFC 8503) in 
socket.create_connection()
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



[issue44070] __file__ is now fully qualified in 3.8 and 3.9

2021-07-15 Thread Thomas Grainger

Thomas Grainger  added the comment:

hello, just chiming in to let you know that this broke CI on twisted: 
https://github.com/twisted/twisted/pull/1628/ (As above for Chalice, I think 
this didn't actually break the framework itself, just the tests for the 
framework. )

do you know what the correct usage of importlib.util.spec_from_file_location is 
to match importlib.import_module ?


I have a tree like this:

.
└── mypkg
├── demo.py
├── __init__.py
└── __pycache__
├── __init__.cpython-38.pyc
└── __init__.cpython-39.pyc

2 directories, 4 files


but I'm not sure how to get a spec for ./mypkg/demo.py:


Python 3.9.6 (default, Jul  3 2021, 16:40:50) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python39.zip', '/usr/lib/python3.9', 
'/usr/lib/python3.9/lib-dynload', '/usr/local/lib/python3.9/dist-packages', 
'/usr/lib/python3/dist-packages']
>>> import os
>>> os.getcwd()
'/home/graingert/projects/syspath-tests'
>>> import importlib.util
>>> importlib.util.spec_from_file_location(name="mypkg.demo", 
>>> location="mypkg/demo.py")
ModuleSpec(name='mypkg.demo', 
loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fc94644bfd0>, 
origin='mypkg/demo.py')
>>> import mypkg.demo
>>> mypkg.demo.__spec__
ModuleSpec(name='mypkg.demo', 
loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fc94645a160>, 
origin='/home/graingert/projects/syspath-tests/mypkg/demo.py')
>>>

--
nosy: +graingert

___
Python tracker 

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



  1   2   >