[issue43550] pip.exe is missing from the NuGet package

2021-03-18 Thread Georgios Petrou


New submission from Georgios Petrou :

When downloading a package from https://www.nuget.org/packages/python the 
pip.exe is not included. As far as I understand, the recommended way to use pip 
from a script is to call it from subprocess. Would it be possible to include 
the exe in the package?

--
components: Windows
messages: 389055
nosy: gipetrou, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: pip.exe is missing from the NuGet package
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue43175] filecmp is not working for UTF-8 BOM file.

2021-03-18 Thread Eryk Sun


Eryk Sun  added the comment:

I'm closing this as not a bug. You showed that all of the criteria used in a 
non-shallow comparison are the same on your end, i.e. they're both regular 
files with the same reported size and the same contents. Something is going on, 
which is a mystery, but it's not a bug in os.stat() or filecmp.

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



[issue33030] GetLastError() may be overwritten by Py_END_ALLOW_THREADS

2021-03-18 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.9 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue21130] equivalent functools.partial instances should compare equal

2021-03-18 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue29270] super call in ctypes subclass fails

2021-03-18 Thread Eryk Sun


Change by Eryk Sun :


--
stage: patch review -> needs patch
title: super call in ctypes sub-class fails in 3.6 -> super call in ctypes 
subclass fails
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue41883] ctypes pointee goes out of scope, then pointer in struct dangles and crashes

2021-03-18 Thread Eryk Sun


Eryk Sun  added the comment:

The ctypes issue is bpo-12836, which has a suggested solution. This issue is a 
third-party problem introduced by a workaround, which needs to be addressed at 
the source, such as with helper functions and subclasses that close the loop.

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32745] ctypes string pointer fields should accept embedded null characters

2021-03-18 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.9 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue27274] [ctypes] Allow from_pointer creation

2021-03-18 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue43549] Outdated descriptions for configuring valgrind.

2021-03-18 Thread Xinmeng Xia


New submission from Xinmeng Xia :

At line 12-20, cpython/Misc/README.valgrind, the descriptions are out of date. 
File "Objects/obmalloc.c" does not contain Py_USING_MEMORY_DEBUGGER any more 
since Python 3.6.  The descriptions should be modified for Python 3.6-3.10


Attached line 12-20, cpython/Misc/README.valgrind: 
=

If you don't want to read about the details of using Valgrind, there

are still two things you must do to suppress the warnings. First,

you must use a suppressions file. One is supplied in

Misc/valgrind-python.supp. Second, you must do one of the following:



* Uncomment Py_USING_MEMORY_DEBUGGER in Objects/obmalloc.c,

then rebuild Python

* Uncomment the lines in Misc/valgrind-python.supp that

suppress the warnings for PyObject_Free and PyObject_Realloc
=

--
assignee: docs@python
components: Documentation
messages: 389052
nosy: docs@python, xxm
priority: normal
severity: normal
status: open
title: Outdated descriptions for configuring valgrind.
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43548] RecursionError depth exceptions break pdb's interactive tracing.

2021-03-18 Thread behind thebrain


Change by behind thebrain :


--
type:  -> crash

___
Python tracker 

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



[issue43548] RecursionError depth exceptions break pdb's interactive tracing.

2021-03-18 Thread behind thebrain


New submission from behind thebrain :

If pdb encounters most exception types, it handles them as would be expected. 
However, if pdb encounters a RecursionError: maximum recursion depth exceeded 
while calling a Python object, then it will continue to execute the code 
accurately, but the debugger itself will no longer interactively wait for user 
input, but instead, just speed through the rest of execution. The code below 
reproduces the error on python 3.7, 3.8, and 3.9.

```python3
import sys
import inspect

sys.setrecursionlimit(50)


def except_works() -> None:
raise Exception


try:
except_works()
except Exception as e:
print("Exception was:", e)


def funcy(depth: int) -> None:
print(f"Stack depth is:{len(inspect.stack())}")
if depth == 0:
return
funcy(depth - 1)


try:
funcy(60)
except Exception as e:
print("Exception was:", e)

print("This executes without the debugger navigating to it.")
```

--
components: Interpreter Core
files: runawaystepping.py
messages: 389051
nosy: behindthebrain
priority: normal
severity: normal
status: open
title: RecursionError depth exceptions break pdb's interactive tracing.
versions: Python 3.8
Added file: https://bugs.python.org/file49891/runawaystepping.py

___
Python tracker 

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



[issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

2021-03-18 Thread Eryk Sun


Change by Eryk Sun :


--
components: +ctypes

___
Python tracker 

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



[issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

2021-03-18 Thread Eryk Sun


Eryk Sun  added the comment:

> The Documentation component is for issues that only change the docs

That's not clear in the triaging guide for the multi-select component field. 
(However, it is clearly stated as such for the GitHub PR label 
"type-documentation".) If that's really the case, then I'll manually nosy the 
docs team in cases such as this. When wording is disputed and needs to be 
clarified, I want an expert at documentation to propose or review the change.

> Adding 'Documentation' amounts to rejecting this patch or anything 
> else that changes the code.

That was not my intent. I accepted Tom's position that "string" means a C 
string, which must be null-terminated. So I added the "Lib" tag and left it as 
a "behavior" issue instead of changing it to "enhancement". 

I'm concerned that the old c_buffer() function is defined to call 
create_string_buffer(), and it's not officially deprecated in the docs or the 
source code. (There's a commented-out deprecation warning.) A related concern 
is that the documentation says that the length of a byte-string initializer 
should not be used if the size is specified, which allows creating a 
character-array that's not null-terminated. If it raises a ValueError in this 
case, the wording should be clear that the value of `size` must be large enough 
to set the initial value as a null-terminated string. I also would want 
c_buffer() to get a separate implementation in this case. 

If accepted, create_unicode_buffer(init, size) should also be changed to 
require that init is set as a null-terminated string.

--
components: +Library (Lib)
priority: low -> normal
stage: needs patch -> patch review
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't have a PR in-hand.  I just ran across this when trying to explain 3.9 
vs 3.10 timings and M-1 vs Intel timings.   Ideally, all of these PRs should be 
reverted.  Short of that, each change needs to be reviewed to see if it created 
extra work inside a loop.  There are 35 calls to PyLong_GetOne and 3 for 
PyLong_GetZero.  Each of those should be checked.

--

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

>  What changed?

It comes up almost every week that I teach a Python course.  Eventually, I've 
come to see the light :-)

Also, I worked though the steps and found an efficiency gain for new code with 
no detriment to existing code.

Lastly, I used to worry a lot about join() also being defined for bytes() and 
bytearray().  But after working through the use cases, I can see that we get an 
even bigger win.  People seem to have a hard time figuring out how to convert a 
single integer to a byte.  The expression "bytes([x])" isn't at all intuitive; 
it doesn't look nice in a list comprehension, and is incomprehensible when used 
with map() and lambda.

--

___
Python tracker 

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



[issue31103] Windows Installer Product does not include micro version in display name

2021-03-18 Thread Steve Dower


Steve Dower  added the comment:

Eryk is correct, the displayed version number is the one that determines 
whether to update existing files or not, and the fourth field is (IIUC) not 
used for this by WiX (our installer technology). We also cannot override the 
displayed version using this technology.

It's also worth noting that the Windows Store package is similarly limited, and 
has a slightly different scheme again (I forget why, but if it could've been 
identical then it would have been - I guess it was because we cannot do 
prerelease versions there).

So the only real fix is for someone to rewrite the entire installer using a new 
technology. I'm not volunteering to do that, and as long as I'm the build 
manager I'm not going to accept any PRs doing it (though that's not to say that 
I won't do it myself, just that I'm not currently considering unsolicited 
contributions and doing it would be a waste of your time). Consistency between 
releases is more important right now - it's not difficult to find the version 
number for a particular install if needed (just look at its file properties).

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



[issue43521] Allow `ast.unparse` to handle NaNs and empty sets

2021-03-18 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



[issue43521] Allow `ast.unparse` to handle NaNs and empty sets

2021-03-18 Thread miss-islington


miss-islington  added the comment:


New changeset e8e341993e3f80a3c456fb8e0219530c93c13151 by Miss Islington (bot) 
in branch '3.9':
bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)
https://github.com/python/cpython/commit/e8e341993e3f80a3c456fb8e0219530c93c13151


--

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2021-03-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +23690
pull_request: https://github.com/python/cpython/pull/24928

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2021-03-18 Thread miss-islington


miss-islington  added the comment:


New changeset 50511677f59464e612cfef0cd0e139fe07e87737 by Miss Islington (bot) 
in branch '3.8':
bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915)
https://github.com/python/cpython/commit/50511677f59464e612cfef0cd0e139fe07e87737


--

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2021-03-18 Thread miss-islington


miss-islington  added the comment:


New changeset 3365e684a83a6bc9e2e2198dca54b42711bd3c90 by Miss Islington (bot) 
in branch '3.9':
bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915)
https://github.com/python/cpython/commit/3365e684a83a6bc9e2e2198dca54b42711bd3c90


--

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2021-03-18 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Extension Modules -Build
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue27318] Add support for symlinks to zipfile

2021-03-18 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue21506] [Windows] installations should include pythonX.exe and pythonX.Y.exe executables

2021-03-18 Thread Eryk Sun


Eryk Sun  added the comment:

One issues with versioned "X.Y" executables is interference with normal 
handling of the ".exe" extension. For example, in "python3.10" the ".10"  
counts as an extension, so normally ".exe" won't be appended when searching for 
the name. 

This affects SearchPathW() searches that supply a default ".exe" extension, 
such as what CreateProcessW() uses to find the executable parsed from 
lpCommandLine. For example, subprocess.call('python3.9') won't append '.exe' to 
find "python3.9.exe" in the search path. 

It also affects the shell API's "App Paths" search, since the shell won't 
append ".exe" to a name that already has an extension. (The machine and user 
"App Paths" keys are the Windows shell equivalent of Unix "/usr/bin" and 
"$HOME/.local/bin", but more powerful.) For example, the store app distribution 
of Python 3.9 creates a "python3.9.exe" entry in the user's "App Paths", but 
os.startfile('python3.9') doesn't work; it has to be 
os.startfile('python3.9.exe').

Using "_" instead of "." would be compatible with Windows filename conventions 
-- e.g. "python3_10.exe". But this is an uphill battle against a Unix 
convention that's probably been in use since the 1970s or 1980s.

--
components:  -Build
nosy: +paul.moore
title: Windows MSI installer should mklink (symlink) python.exe to 
python2.7.exe -> [Windows] installations should include pythonX.exe and 
pythonX.Y.exe executables
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2021-03-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23689
pull_request: https://github.com/python/cpython/pull/24926

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2021-03-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23688
pull_request: https://github.com/python/cpython/pull/24925

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2021-03-18 Thread miss-islington


miss-islington  added the comment:


New changeset f6c6b5821bff815bdc810de53992fd1fbdb2edd4 by Christian Heimes in 
branch 'master':
bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915)
https://github.com/python/cpython/commit/f6c6b5821bff815bdc810de53992fd1fbdb2edd4


--

___
Python tracker 

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



[issue43547] support ZIP files with zeroed out fields (e.g. for reproducible builds)

2021-03-18 Thread Hans-Christoph Steiner


Hans-Christoph Steiner  added the comment:

I just found another specific example in _open_to_write().  0 is a valid value 
for zinfo.external_attr.  But this code always forces 0 to something else:

if not zinfo.external_attr:
zinfo.external_attr = 0o600 << 16  # permissions: ?rw---

--

___
Python tracker 

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



[issue43547] support ZIP files with zeroed out fields (e.g. for reproducible builds)

2021-03-18 Thread Hans-Christoph Steiner


New submission from Hans-Christoph Steiner :

It is now standard for Java JARs and Android APKs (both ZIP files) to zero out 
lots of the fields in the ZIP header.  For example:

* each file entry has the date set to zero
* the create_system is always set to zero on all platforms

zipfile currently cannot create such ZIPs because of two small restrictions 
that it introduced:

* must use a tuple of 6 values to set the date
* forced create_system value based on sys.platform == 'win32'
* maybe other fields?

I lump these together because it might make sense to handle this with a single 
argument, something like zero_header=True.  The use case is for working with 
ZIP, JAR, APK, AAR files for reproducible builds.  The whole build system for 
F-Droid is built in Python.  We need to be able to copy the JAR/APK signatures 
in order to reproduce signed builds using only the source code and the 
signature files themselves.  Right now, that's not possible because building a 
ZIP with Python's zipfile cannot zero out the ZIP header like other tools can, 
including Java.

--
components: IO, Library (Lib)
messages: 389040
nosy: eighthave
priority: normal
severity: normal
status: open
title: support ZIP files with zeroed out fields (e.g. for reproducible builds)
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43546] "Impossible" KeyError from importlib._bootstrap acquire line 110

2021-03-18 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



[issue35056] Test leaks of memory not managed by Python allocator

2021-03-18 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> _sqlite: call sqlite3_config(SQLITE_CONFIG_MALLOC, pMem) to use 
> PyMem_RawMalloc()

SQLite requires the xSize member of sqlite3_mem_methods to be implemented for 
this to work, so we'd have to implement msize(). The msize() idea seems to have 
been rejected in PEP 445, though it mentions using debug hooks to implement it.

See also https://www.sqlite.org/c3ref/mem_methods.html

Anyway, attached is a PoC patch with a fixed 10k mem pool for the sqlite3 
module :)

--
keywords: +patch
Added file: https://bugs.python.org/file49890/patch.diff

___
Python tracker 

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



[issue43546] "Impossible" KeyError from importlib._bootstrap acquire line 110

2021-03-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It looks like method _ModuleLock.acquire() was re-entered in the same thread.

* Enter acquire() first time, set _blocking_on[tid].
* Trigger some callback (profiler, debugger, tracemalloc) which uses import and 
calls acquire() again from the same thread.
* Enter acquire() second time, set _blocking_on[tid].
* Delete _blocking_on[tid] and leave the second acquire().
* Try to leave the first acquire() and delete _blocking_on[tid] again.

--
nosy: +brett.cannon, eric.snow, ncoghlan, pitrou, serhiy.storchaka, vstinner

___
Python tracker 

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



[issue43546] "Impossible" KeyError from importlib._bootstrap acquire line 110

2021-03-18 Thread Anentropic


Anentropic  added the comment:

It turns out splitting the tests across 2 nodes rather than 4 also prevents the 
error.

So it's not a case of "too many" tests.

So then I think maybe it needs to be a specific number to trigger the error?

And yes, if I duplicate one of our test cases (I mean test method in a TestCase 
class) so that there is one more than before... that also prevents the error!

--

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-03-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +23687
pull_request: https://github.com/python/cpython/pull/24923

___
Python tracker 

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



[issue43546] "Impossible" KeyError from importlib._bootstrap acquire line 110

2021-03-18 Thread Anentropic


Anentropic  added the comment:

https://docs.python.org/3/library/_thread.html#_thread.get_ident

> Thread identifiers may be recycled when a thread exits and another thread is 
> created.

I still don't see how we get that KeyError but it feels like it might be 
something to do with this

--

___
Python tracker 

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



[issue43546] "Impossible" KeyError from importlib._bootstrap acquire line 110

2021-03-18 Thread Anentropic


Anentropic  added the comment:

FWIW...

django-nose==1.4.6
nose==1.3.7

The only use of threading I can see in Nose is here:
https://github.com/nose-devs/nose/blob/release_1.3.7/nose/plugins/logcapture.py

But we are passing --nologcapture flag and nosetests echoes that flag back to 
us at the top of the test run, so I believe the feature is disabled

--

___
Python tracker 

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



[issue43546] "Impossible" KeyError from importlib._bootstrap acquire line 110

2021-03-18 Thread Anentropic


New submission from Anentropic :

We have a Django 2.2.19 project on Python 3.9.2 on Debian (slim-buster) in 
Docker.

A bizarre problem started happening to us this week.

First I'll show the symptom, we started getting the following error:

...
  File 
"/root/.pyenv/versions/3.9.2/lib/python3.9/site-packages/django/db/migrations/autodetector.py",
 line 10, in 
from django.db.migrations.optimizer import MigrationOptimizer
  File "", line 1004, in _find_and_load
  File "", line 158, in __enter__
  File "", line 110, in acquire
KeyError: 140426340123264

If I look at the source for _bootstrap.py, that error should be impossible:
https://github.com/python/cpython/blob/v3.9.2/Lib/importlib/_bootstrap.py#L110

At the top of the acquire method it does:

tid = _thread.get_ident()
_blocking_on[tid] = self

and then on line 110 where we get the KeyError:

del _blocking_on[tid]

both `tid` and `_blocking_on` are local vars and none of the other lines in the 
method touch them

So how do we get a KeyError?

I can only think that something mutates the underlying value of `tid`, but it's 
supposed to be an int so that's very weird.

I started with the symptom because our context for this is complicated to 
explain. I did find a fix that prevents the error but I do not understand the 
link between cause and effect.

Our context:
- we have a large unit test suite for the project which we run in Jenkins
- we split the tests across several Jenkins nodes to run in parallel in 
isolated docker environments
- we use some bash to like this to split the test cases:
  find project/ -iname "test*.py" -print0 | \
xargs --null grep -E '(def test)|(def step_)' -l | \
split -n "r/$NODE_ID/$NODES" | \
xargs ci/bin/run-tests
- ci/bin/run-tests is just a wrapper which calls Django's manage.py test command
  so it receives a list of filenames like 
"project/metrics/tests/test_client.py" as args
- using "nose" test runner via django-nose FWIW

We currently split tests across 3 nodes, and it was always node 2 which would 
fail.
I found that commenting out a test case in any of the files being passed to 
node 2 would prevent the error from occurring.
Note that in this case we are still passing *exactly the same filenames* as cli 
args to the test runner.

Splitting the tests across 4 nodes instead of 3 also seems to prevent the error.
So it seems like, in some way I don't understand, we just have too many test 
cases.
Perhaps nose is doing something wrong or inefficient when given lots of 
filenames.

But I'm reporting here because the error we get from importlib._bootstrap looks 
like it should be impossible.

--
messages: 389034
nosy: anentropic
priority: normal
severity: normal
status: open
title: "Impossible" KeyError from importlib._bootstrap acquire line 110
type: crash
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



[issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10

2021-03-18 Thread Brett Cannon


Brett Cannon  added the comment:

The documentation states in the deprecation notice for 
https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module
 that create_module() and exec_module() are what are necessary. But the it 
isn't a direct 1:1 replacement and people are expected to use all of the helper 
code so it's going to be very specific to the need of the code.

--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-03-18 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991
nosy_count: 8.0 -> 9.0
pull_requests: +23686
pull_request: https://github.com/python/cpython/pull/24922

___
Python tracker 

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



[issue43521] Allow `ast.unparse` to handle NaNs and empty sets

2021-03-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23685
pull_request: https://github.com/python/cpython/pull/24921

___
Python tracker 

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



[issue43521] Allow `ast.unparse` to handle NaNs and empty sets

2021-03-18 Thread miss-islington


miss-islington  added the comment:


New changeset 08ff4369afca84587b1c82034af4e9f64caddbf2 by Kodi Arfer in branch 
'master':
bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)
https://github.com/python/cpython/commit/08ff4369afca84587b1c82034af4e9f64caddbf2


--
nosy: +miss-islington

___
Python tracker 

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



[issue40645] Use OpenSSL's HMAC API

2021-03-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +23684
pull_request: https://github.com/python/cpython/pull/24920

___
Python tracker 

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



[issue8704] cgitb sends a bogus HTTP header if the app crashes before finishing headers

2021-03-18 Thread coyot linden


coyot linden  added the comment:

Ran into this also, got:

AH02429: Response header name 

[issue43543] Spam

2021-03-18 Thread Zachary Ware


Change by Zachary Ware :


--
components:  -C API
nosy:  -yotabestww
title: stupid download -> Spam
type: resource usage -> 

___
Python tracker 

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



[issue43543] stupid download

2021-03-18 Thread Zachary Ware


Change by Zachary Ware :


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

___
Python tracker 

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'd add a note to the docs about it, then open a feature request to change the 
behavior. You could turn this issue into a documentation fix.

Unfortunately I don't know if there's a core dev who pays attention to the XML 
parsers. But I can probably find out.

--

___
Python tracker 

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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-18 Thread Paul


Change by Paul :


--
nosy: +Jukka Lehtosalo, lukasz.langa

___
Python tracker 

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



[issue43483] Loss of content in simple (but oversize) SAX parsing

2021-03-18 Thread Larry Trammell


Larry Trammell  added the comment:

Eric, now that you know as much as I do about the nature and scope of the 
peculiar parsing behavior, do you have any suggestions about how to proceed 
from here?

--

___
Python tracker 

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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-18 Thread Paul


Paul  added the comment:

@kj
Thank you, Ken! I'll try it on the list as advised by you!

--

___
Python tracker 

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



[issue40645] Use OpenSSL's HMAC API

2021-03-18 Thread Christian Heimes


Christian Heimes  added the comment:

memo to me: switch to new C implementation of HMAC.

--
priority: normal -> critical
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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-18 Thread Ken Jin


Ken Jin  added the comment:

@paul-dest
Anyone can add them using the bug tracker Web interface in the "Nosy List" 
field above the message box.

Yes they will receive a notification. Adding people sends them an email and 
subscribes them to this issue (even if closed).

I don't know if Jukka is on this bug tracker (at the very least I can't find 
them in the search). You may have better luck getting an opinion from others if 
you send an email to typing-sig instead 
https://mail.python.org/archives/list/typing-...@python.org/. That's usually 
where PEP change/interpretation-related discussion goes (from my own 
experience).

--

___
Python tracker 

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



[issue43545] Use LOAD_GLOBAL to set __module__ in class def

2021-03-18 Thread Dan Snider


New submission from Dan Snider :

Other than obvious performance implications this has, usage of LOAD_NAME makes 
defining cls.__name__ from within metaclass.__prepare__ difficult.

--
messages: 389026
nosy: bup
priority: normal
severity: normal
status: open
title: Use LOAD_GLOBAL to set __module__ in class def
type: behavior

___
Python tracker 

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



[issue23767] Library and include paths not added when cross-compiling on localized system

2021-03-18 Thread Matthias Klose


Matthias Klose  added the comment:

that looks fine. Maybe also set LANG=C ?

--

___
Python tracker 

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



[issue43544] mimetype default list make a wrong guess for illustrator file

2021-03-18 Thread Guénaël Muller

New submission from Guénaël Muller :

mimetypes lib consider illustrator file ('.ai') as 'application/postscript' 
type. This is correct... but also wrong.

Old illustrator file (illustrator 9) are real postscript file but modern one 
are technically pdf. So guessing .ai as postscript lead to wrong guessing if 
you're using some software that make decision based on mimetype, you can of 
course, check both file_extension and mimetype but this remove usefulness of 
mimetype.

--
messages: 389023
nosy: Inkhey
priority: normal
severity: normal
status: open
title: mimetype default list make a wrong guess for illustrator file
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43543] stupid download

2021-03-18 Thread Petr Viktorin


Change by Petr Viktorin :


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



[issue43543] stupid download

2021-03-18 Thread Йота : 3

New submission from Йота :3 :

fucking retards, how to new or default people can download old versions  of 
python? Maybe you can made better and easy desing? Stupud idiots

--
components: C API
messages: 389022
nosy: yotabestww
priority: normal
severity: normal
status: open
title: stupid download
type: resource usage

___
Python tracker 

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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-18 Thread Paul

Paul  added the comment:

The authors of PEP 544 are Ivan Levkivskyi, Jukka Lehtosalo, and Łukasz Langa. 
I think their opinion should count.

I can see "levkivskyi" in the noisy list, but not the other two. And don't see 
any possibility to add them. Who can add them?

And if added: will they read a notification of an issue in state "closed"?

--

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2021-03-18 Thread Christian Heimes


Christian Heimes  added the comment:

Dimitri John Ledkov from Canonical has opened a feature request for a context 
validation feature on the OpenSSL issue tracker, 
https://github.com/openssl/openssl/issues/14607

--

___
Python tracker 

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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-18 Thread Guido van Rossum

Guido van Rossum  added the comment:

To be honest, I just don’t have time to deal,with this, so I’m hoping some
other core dev has an opinion. But I can’t help you find one either. Sorry,
but that’s the reality of open source development. --
--Guido (mobile)

--

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

The work on this issue started in Python 3.9 with bpo-21120 which excluded 
Python-ast.h, ast.h and asdl.h from the limited C API: commit 
421a72af4deaec96a49a79951b9c2546a2faa13d.

--

___
Python tracker 

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



[issue12575] add a AST validator

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset eec8e61992fb654d4cf58de4d727c18622b8303e by Victor Stinner in 
branch 'master':
bpo-43244: Remove the PyAST_Validate() function (GH-24911)
https://github.com/python/cpython/commit/eec8e61992fb654d4cf58de4d727c18622b8303e


--

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset eec8e61992fb654d4cf58de4d727c18622b8303e by Victor Stinner in 
branch 'master':
bpo-43244: Remove the PyAST_Validate() function (GH-24911)
https://github.com/python/cpython/commit/eec8e61992fb654d4cf58de4d727c18622b8303e


--

___
Python tracker 

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



[issue43541] PyEval_EvalCodeEx() can no longer be called with code which has (CO_NEWLOCALS | CO_OPTIMIZED) flags

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fc980e0be19776ee05dfc5380eb5d6a8092935cb by Victor Stinner in 
branch 'master':
bpo-43541: Fix PyEval_EvalCodeEx() regression (GH-24918)
https://github.com/python/cpython/commit/fc980e0be19776ee05dfc5380eb5d6a8092935cb


--

___
Python tracker 

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



[issue43541] PyEval_EvalCodeEx() can no longer be called with code which has (CO_NEWLOCALS | CO_OPTIMIZED) flags

2021-03-18 Thread STINNER Victor


Change by STINNER Victor :


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



[issue43493] EmailMessage mis-folding headers of a certain length

2021-03-18 Thread R. David Murray


R. David Murray  added the comment:

Parsing and newlines have nothing to do with this bug, actually.  I don't think 
your foldfix post-processing is going to do what you want in the general case.

The source of the bug here is in the folding algorithm in _header_value_parser. 
 It has checks to see if the "text so far" will fit within the header width, 
and it starts a new line under vafious conditions.  For example, if there is a 
single word after Subject: whose length is, say, 70, it would produce the 
effect you show, because the single word would fit without folding or encoding 
on a new line.  I don't think this violates the RFC.  What your example shows 
makes it look like the folder is treating all of the text as if it were a 
single word, which is obviously wrong.  It is supposed to break at spaces.  You 
will note that if you increase the repeat count in your example to 16 it folds 
the line correctly.  So the bug has something to do with the total text so far 
accumulated for the line being right in that window where it won't fit on the 
first line but does fit on a line by itself.  This is obviously a bug in the 
folder, since it should be splitting that text if it isn't a sin
 gle word, not moving it to a new line as a whole.

Note that this bug is still present on master.

--

___
Python tracker 

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



[issue23767] Library and include paths not added when cross-compiling on localized system

2021-03-18 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
nosy_count: 4.0 -> 5.0
pull_requests: +23683
pull_request: https://github.com/python/cpython/pull/24919

___
Python tracker 

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



[issue43541] PyEval_EvalCodeEx() can no longer be called with code which has (CO_NEWLOCALS | CO_OPTIMIZED) flags

2021-03-18 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-18 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43542] Add image/heif(heic) to list of media types in mimetypes.py

2021-03-18 Thread Ilya


Change by Ilya :


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

___
Python tracker 

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



[issue43541] PyEval_EvalCodeEx() can no longer be called with code which has (CO_NEWLOCALS | CO_OPTIMIZED) flags

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

In commit 46496f9d12582bf11f4911ad0f23315d6f277907, I modified 
_PyEval_BuiltinsFromGlobals() to return a borrowed reference rather than a 
strong reference. It seems like I forgot to remove a Py_DECREF() in 
PyEval_EvalCodeEx()!

I'm working on a fix.

--

___
Python tracker 

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



[issue43542] Add image/heif(heic) to list of media types in mimetypes.py

2021-03-18 Thread Ilya


New submission from Ilya :

Add HEIF and HEIC format to list of media types. It has IANA registration.

IANA: https://www.iana.org/assignments/media-types/image/heic
HEIF Github: https://github.com/nokiatech/heif

--
components: Library (Lib)
messages: 389012
nosy: martbln
priority: normal
severity: normal
status: open
title: Add image/heif(heic) to list of media types in mimetypes.py
type: enhancement

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-03-18 Thread E. Paine


Change by E. Paine :


--
versions: +Python 3.10, Python 3.8

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-03-18 Thread E. Paine


Change by E. Paine :


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

___
Python tracker 

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



[issue43541] PyEval_EvalCodeEx() can no longer be called with code which has (CO_NEWLOCALS | CO_OPTIMIZED) flags

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

If I the comment the following assertion in PyEval_EvalCodeEx():

assert PyCodeObject *)_co)->co_flags & (CO_NEWLOCALS | CO_OPTIMIZED)) == 0);

The garbage collector fails while visiting builtins of the function with 
func_traverse(), at line:

   Py_VISIT(f->func_builtins);

I guess that the problem is that f->func_builtins doesn't hold a strong 
reference to builtins.


Error:

Modules/gcmodule.c:113: gc_decref: Assertion "gc_get_refs(g) > 0" failed: 
refcount is too small
Enable tracemalloc to get the memory block allocation traceback

object address  : 0x7fffea69d650
object refcount : 2265
object type : 0x870e80
object type name: dict
object repr : {'__name__': 'builtins', '__doc__': "Built-in functions, 
exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; 
Ellipsis represents `...' in slices.", '__package__': '', '__loader__': , '__spec__': ModuleSpec(name='builtins', 
loader=, origin='built-in'), 
'__build_class__': , '__import__': , 'abs': , 'all': , 'any': , 'ascii': , ...}

Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: initialized

Current thread 0x77c20740 (most recent call first):
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Symtab.py",
 line 339 in __init__
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Symtab.py",
 line 1953 in __init__
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Symtab.py",
 line 2066 in __init__
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Symtab.py",
 line 1549 in declare_c_class
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Nodes.py",
 line 4782 in analyse_declarations
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Nodes.py",
 line 431 in analyse_declarations
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/ModuleNode.py",
 line 124 in analyse_declarations
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/ParseTreeTransforms.py",
 line 1608 in visit_ModuleNode
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/ParseTreeTransforms.py",
 line 1598 in __call__
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Pipeline.py",
 line 335 in run
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Pipeline.py",
 line 355 in run_pipeline
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Main.py",
 line 515 in run_pipeline
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Compiler/Main.py",
 line 727 in compile_single
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Build/Dependencies.py",
 line 1208 in cythonize_one
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Build/Dependencies.py",
 line 1102 in cythonize
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Build/Cythonize.py",
 line 97 in cython_compile
  File 
"/home/vstinner/dev/numpy/env/lib/python3.10/site-packages/Cython/Build/Cythonize.py",
 line 223 in main
  File "/home/vstinner/dev/numpy/env/bin/cythonize", line 33 in 

Extension modules: Cython.Plex.Actions, Cython.Plex.Scanners, 
Cython.Compiler.Scanning, Cython.Tempita._tempita, Cython.Compiler.Visitor, 
Cython.Compiler.FlowControl (total: 6)

Program received signal SIGABRT, Aborted.

--

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-03-18 Thread E. Paine


E. Paine  added the comment:

Thank you for reporting this. The problem appears to be a regression with 
https://github.com/python/cpython/commit/3d569fd6 where the dialog tries to be 
transient to the user-passed parent rather than the default root. I will create 
a PR to hopefully rectify this.

--
nosy: +epaine, serhiy.storchaka

___
Python tracker 

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



[issue43541] PyEval_EvalCodeEx() can no longer be called with code which has (CO_NEWLOCALS | CO_OPTIMIZED) flags

2021-03-18 Thread STINNER Victor


New submission from STINNER Victor :

Cython generates a __Pyx_PyFunction_FastCallDict() function which calls 
PyEval_EvalCodeEx(). With Python 3.9, it worked well. With Python 3.10 in debug 
mode, it fails with an assertion error:

python3.10: Python/ceval.c:5148: PyEval_EvalCodeEx: Assertion `(((PyCodeObject 
*)_co)->co_flags & (CO_NEWLOCALS | CO_OPTIMIZED)) == 0' failed.

With Python 3.10 in release mode, it does crash.

Context of the failed assertion:

* Assertion added recently to CPython 3.10 by python/cpython@0332e56
* The code object flags = (CO_NEWLOCALS | CO_OPTIMIZED | CO_NOFREE)
* Code co_argcount = 2
* Code co_kwonlyargcount = 0
* Cython __Pyx_PyFunction_FastCallDict() called with: nargs=1 and kwargs=NULL

See the Cython issue to a reproducer: 
https://github.com/cython/cython/issues/4025#issuecomment-801829541

In Python 3.9, _PyFunction_Vectorcall() has the following fast-path:

if (co->co_kwonlyargcount == 0 && nkwargs == 0 &&
(co->co_flags & ~PyCF_MASK) == (CO_OPTIMIZED | CO_NEWLOCALS | 
CO_NOFREE))
{
if (argdefs == NULL && co->co_argcount == nargs) {
return function_code_fastcall(tstate, co, stack, nargs, globals);
}
else if (nargs == 0 && argdefs != NULL
 && co->co_argcount == PyTuple_GET_SIZE(argdefs)) {
/* function called with no arguments, but all parameters have
   a default value: use default values as arguments .*/
stack = _PyTuple_ITEMS(argdefs);
return function_code_fastcall(tstate, co,
  stack, PyTuple_GET_SIZE(argdefs),
  globals);
}
}

When the bug occurs, __Pyx_PyFunction_FastCallDict() doesn't take the fast-path 
because nargs < co_argcount (1 < 2).

In Python 3.10, _PyFunction_Vectorcall() is very different:

if (((PyCodeObject *)f->fc_code)->co_flags & CO_OPTIMIZED) {
return _PyEval_Vector(tstate, f, NULL, stack, nargs, kwnames);
}
else {
return _PyEval_Vector(tstate, f, f->fc_globals, stack, nargs, kwnames);
}


PyEval_EvalCodeEx() must not crash if the code object has (CO_NEWLOCALS | 
CO_OPTIMIZED | CO_NOFREE) flags.

--
components: C API
messages: 389009
nosy: Mark.Shannon, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: PyEval_EvalCodeEx() can no longer be called with code which has 
(CO_NEWLOCALS | CO_OPTIMIZED) flags
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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-18 Thread Paul


Paul  added the comment:

Regarding "At runtime, protocol classes will be simple ABCs." (PEP 544):
Unfortunately, this is currently not the case. Actually, there is an extra 
metaclass for protocols, solely to provide an __instancecheck__.
https://github.com/python/cpython/blob/3.9/Lib/typing.py#L1096

```
class _ProtocolMeta(ABCMeta):
# This metaclass is really unfortunate and exists only because of
# the lack of __instancehook__.
def __instancecheck__(cls, instance):
# We need this method for situations where attributes are
# assigned in __init__.
if ((not getattr(cls, '_is_protocol', False) or
_is_callable_members_only(cls)) and
issubclass(instance.__class__, cls)):
return True
if cls._is_protocol:
if all(hasattr(instance, attr) and
# All *methods* can be blocked by setting them to None.
(not callable(getattr(cls, attr, None)) or
 getattr(instance, attr) is not None)
for attr in _get_protocol_attrs(cls)):
return True
return super().__instancecheck__(instance)
```


Regarding "There is no intent to provide sophisticated runtime instance and 
class checks against protocol classes." (PEP 544):
I fully understand that. But a runtime instance check that simply checks, if a 
protocol member is there, is not sophisticated. And as you can see in the code 
above, these checks are already implemented, but unfortunately they don't cover 
the case reported by me in the initial message.

I could provide a patch for the _ProtocolMeta to cover the case reported by me. 
It's just a matter of a couple of lines. Even if the runtime isinstance() 
checking is not required to give the right answer, I think the right answer 
would be nice - at least for the most basic checks as "Are the protocol members 
there?"

Regarding "if you inherit from a protocol you are deemed to implement it":
I couldn't find a rule with this meaning in any of the typing PEPs.

But in my point of view, the problem is a different one:
If the instance to check is of a class implemented by another developer (maybe 
the class is from a third-party library - Bob's library), then such a rule does 
not help the first developer (Alice). Alice doesn't know anything about 
such-a-rule-compliance of Bob's classes. She just wants to check if the 
instance returned by one of Bob's functions complies to the protocol.

-

The bottom line is:
I'd like to provide a patch if you want me to.

If you think the current implementation must not be touched, then I would 
appreciate if the reported case could be documented. I could deliver a draft 
for this, as well. Currently, the last examples in the sections "Protocol 
members" and "Explicitly declaring implementation" in PEP 544 contain protocol 
members with no default implementation in the protocol, but do not suggest the 
behavior reported above.

--

___
Python tracker 

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



[issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10

2021-03-18 Thread STINNER Victor


New submission from STINNER Victor :

The load_module() method of importlib loaders is deprecated which cause test 
failures in multiple projects.

It is not easy to guess how to replace it. Examples:

* pkg_resources fix adding create_module() and exec_module() methods: 
https://github.com/pypa/setuptools/commit/6ad2fb0b78d11e22672f56ef9d65d13ebd3475a9
* pkg_resources fix replacing importlib.load_module() function call (not loader 
methods) with importlib.import_module(): 
https://github.com/pypa/setuptools/commit/a54d9e6b30c6da0542698144d2ff149ae7cadc9a

Cython uses this code:

if sys.version_info[:2] < (3, 3):
import imp
def load_dynamic(name, module_path):
return imp.load_dynamic(name, module_path)
else:
from importlib.machinery import ExtensionFileLoader
def load_dynamic(name, module_path):
return ExtensionFileLoader(name, module_path).load_module()

Fixed Cython code:

if sys.version_info < (3, 5):
import imp
def load_dynamic(name, module_path):
return imp.load_dynamic(name, module_path)
else:
import importlib.util as _importlib_util
def load_dynamic(name, module_path):
spec = _importlib_util.spec_from_file_location(name, module_path)
module = _importlib_util.module_from_spec(spec)
# sys.modules[name] = module
spec.loader.exec_module(module)
return module

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 389007
nosy: brett.cannon, docs@python, vstinner
priority: normal
severity: normal
status: open
title: importlib: Document how to replace load_module() in What's New in Python 
3.10
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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-18 Thread Vedran Čačić

Vedran Čačić  added the comment:

Does strong typing mean you should write

if bool(condition): ...

or 

for element in iter(sequence): ...

or (more similar to this)

my_set.symmetric_difference_update(set(some_iterable))

?

As Eric has said, if there's only one possible thing you could have meant, 
"strong typing" is just bureaucracy.

--

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2021-03-18 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

"ERROR: test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous)" fails 
on the Windows x64 job of GitHub Actions when Python is built in debug mode:
https://github.com/python/cpython/pull/24914

--
nosy: +vstinner

___
Python tracker 

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



[issue43492] Upgrade to SQLite 3.35.2 in macOS and Windows

2021-03-18 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Bug-fix release 3.35.2 is out: https://www.sqlite.org/releaselog/3_35_2.html

Let's wait until end of March before updating the installers.

--
title: Upgrade to SQLite 3.35.1 in macOS and Windows -> Upgrade to SQLite 
3.35.2 in macOS and Windows

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2021-03-18 Thread Christian Heimes


Christian Heimes  added the comment:

I have discussed the problem with downstream engineers on the two issues

- https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1899878
- https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1917625

The gist of the issue is: Canonical has taken a different approach than Debian 
and other distros to set minimum TLS version.

Most distros use an openssl.cnf file to set "MinProtocol = TLSv1.2". The config 
file approach allows application to override the setting with 
SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION) and to detect the current 
minimum version with SSL_CTX_get_min_proto_version(ctx) == TLS1_VERSION.

Ubuntu doesn't set "MinProtocol = TLSv1.2". Instead the distro has patched 
OpenSSL source code and modified the meaning of security level "2". Security 
level is a new OpenSSL API to set various security related settings. On Ubuntu 
SECLEVEL=2 prevents TLS 1.0 and 1.1 connection. Further 
SSL_CTX_get_min_proto_version(ctx) returns 0 (dummy value for minimum supported 
version). SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION) does not fail 
although TLS 1.0 is prohibited.

https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_security_level.html
Level 2: SSL version 3 is also not allowed
Level 4: TLS versions below 1.2 are not permitted.

https://manpages.ubuntu.com/manpages/focal/man3/SSL_CTX_set_security_level.3ssl.html
Level 2: On Ubuntu, TLS versions below 1.2 are not permitted

The combination of "Ubuntu changed the meaning of security level policy" and 
"SSL_CTX_get_min_proto_version(ctx) does not report minimum version" breaks our 
tests.

OpenSSL doesn't provide an easy way to check if a SSL_CTX has a sane 
configuration. There is a way to check if a security policy allows a TLS 
version. I'm not sure if we should include the check in CPython and where to 
best put the check:

void *sec_ex = SSL_CTX_get0_security_ex_data(ctx);
sec_cb = SSL_CTX_get_security_callback(ctx);
int result = sec_cb(NULL, ctx, SSL_SECOP_VERSION, 0, TLS1_VERSION, NULL, 
sec_ex);
if (result && (SSL_CTX_get_min_proto_version(ctx) >=  TLS1_VERSION)) ...

--

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

Since it seems like you have already a ready patch to optimize the code, so go 
ahead and merge it.

--

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6af528b4ab342805534c0bfe61d84ed7bb519468 by Victor Stinner in 
branch 'master':
bpo-43244: Fix test_peg_generators on Windows (GH-24913)
https://github.com/python/cpython/commit/6af528b4ab342805534c0bfe61d84ed7bb519468


--

___
Python tracker 

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



[issue43537] interpreter crashes when handling long text in input()

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

It looks like a bug in libreadline. Python only calls 
rl_callback_handler_install (prompt, rlhandler); where prompt is a byte string 
of 60,000 bytes: len(repr([1,2]*1)).


$ gdb ./python
(gdb) run
Python 3.10.0a6+ (heads/pycore_symtable-dirty:27700e0c8b, Mar 18 2021, 
03:11:22) [GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
>>> input([1,2]*1)
realloc(): invalid next size

Program received signal SIGABRT, Aborted.
0x77c629d5 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install 
libxcrypt-4.4.18-1.fc33.x86_64 ncurses-libs-6.2-3.20200222.fc33.x86_64 
readline-8.0-5.fc33.x86_64

(gdb) where
#0  0x77c629d5 in raise () from /lib64/libc.so.6
#1  0x77c4b8a4 in abort () from /lib64/libc.so.6
#2  0x77ca5177 in __libc_message () from /lib64/libc.so.6
#3  0x77cace6c in malloc_printerr () from /lib64/libc.so.6
#4  0x77cb111c in _int_realloc () from /lib64/libc.so.6
#5  0x77cb22a6 in realloc () from /lib64/libc.so.6
#6  0x7fffea4c9dc2 in xrealloc () from /lib64/libreadline.so.8
#7  0x7fffea4bb7ab in rl_redisplay () from /lib64/libreadline.so.8
#8  0x7fffea4a5727 in readline_internal_setup () from 
/lib64/libreadline.so.8
#9  0x7fffea4c7489 in _rl_callback_newline () from /lib64/libreadline.so.8
#10 0x77fbdb68 in readline_until_enter_or_signal (
prompt=0xba9b40 "[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 
2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 
2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1"..., 
signal=0x7fffb7f4) at /home/vstinner/python/master/Modules/readline.c:1318
#11 0x77fbde06 in call_readline (sys_stdin=0x77de9800 
<_IO_2_1_stdin_>, sys_stdout=0x77dea520 <_IO_2_1_stdout_>, 
prompt=0xba9b40 "[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 
2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 
2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1"...) at 
/home/vstinner/python/master/Modules/readline.c:1396
#12 0x0071f7b3 in PyOS_Readline (sys_stdin=0x77de9800 
<_IO_2_1_stdin_>, sys_stdout=0x77dea520 <_IO_2_1_stdout_>, 
prompt=0xba9b40 "[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 
2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 
2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1"...) at 
Parser/myreadline.c:393
#13 0x0069d23c in builtin_input_impl (module=, 
prompt=[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1,
  2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, ...(truncated)) at 
Python/bltinmodule.c:2096
#14 0x00699156 in builtin_input (module=, args=0x7fffea62c7b8, nargs=1) at 
Python/clinic/bltinmodule.c.h:662
...


Valgrind also sees many memory errors:

$ PYTHONMALLOC=malloc_debug valgrind --log-file=valgrind.log ./python 
>>> input([1,2]*1)
[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, (...)
Erreur de segmentation (core dumped)

$ cat valgrind.log
==8025== 

[issue43382] github CI blocked by the Ubuntu CI with an SSL error

2021-03-18 Thread Christian Heimes


Christian Heimes  added the comment:

CI is passing again.

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



[issue43165] Support the same files with new param in shutil.copyfile

2021-03-18 Thread Milan Balazs


Milan Balazs  added the comment:

Could you somebody review the PR for this ticket, please?

--

___
Python tracker 

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



[issue43539] test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving() fails randomly

2021-03-18 Thread STINNER Victor


New submission from STINNER Victor :

Seen on the Windows x64 job of GitHub Actions:
https://github.com/python/cpython/pull/24913/checks?check_run_id=2137800313


==
FAIL: test_sendfile_close_peer_in_the_middle_of_receiving 
(test.test_asyncio.test_sendfile.ProactorEventLoopTests)
--
Traceback (most recent call last):
  File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 458, 
in test_sendfile_close_peer_in_the_middle_of_receiving
self.run_loop(
AssertionError: ConnectionError not raised

(...)
0:12:31 load avg: 0.39 Re-running test_asyncio in verbose mode
(...)

==
FAIL: test_sendfile_close_peer_in_the_middle_of_receiving 
(test.test_asyncio.test_sendfile.ProactorEventLoopTests)
--
Traceback (most recent call last):
  File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 458, 
in test_sendfile_close_peer_in_the_middle_of_receiving
self.run_loop(
AssertionError: ConnectionError not raised

--
components: Tests, asyncio
messages: 388997
nosy: asvetlov, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving() 
fails randomly
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



[issue39342] Expose X509_V_FLAG_ALLOW_PROXY_CERTS in ssl

2021-03-18 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks for the PR!

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



[issue39342] Expose X509_V_FLAG_ALLOW_PROXY_CERTS in ssl

2021-03-18 Thread miss-islington


miss-islington  added the comment:


New changeset e0b4aa0f5c3c2b2c60f5d8b20cf291442a8df8a5 by Chris Burr in branch 
'master':
bpo-39342: Expose X509_V_FLAG_ALLOW_PROXY_CERTS in ssl module (GH-18011)
https://github.com/python/cpython/commit/e0b4aa0f5c3c2b2c60f5d8b20cf291442a8df8a5


--
nosy: +miss-islington

___
Python tracker 

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



[issue43244] Move PyArena C API to the internal C API

2021-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23677
pull_request: https://github.com/python/cpython/pull/24914

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It was proposed by newbies several times before. It was rejected because it 
would make errors to hide unnoticed. Python is dynamically but strongly typed, 
and it is its advantage.

I am -1.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue8232] webbrowser.open incomplete on Windows

2021-03-18 Thread Eryk Sun


Eryk Sun  added the comment:

Windows Vista is no longer a concern, so find_windows_browsers() doesn't have 
to worry about the KEY_WOW64_* flags. IMO, it should get the browser's real 
name (the default value of the key) and the fully-qualified path of the 
executable, instead of depending solely on an "App Paths" entry being 
configured for the base executable name. For example:

def find_windows_browsers():
""" Read the installed browsers from the Windows registry."""
import winreg
browsers = []
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,
r"Software\Clients\StartMenuInternet") as hkey:
i = 0
while True:
try:
subkey = winreg.EnumKey(hkey, i)
i += 1
except OSError as e:
if e.winerror != 259: # ERROR_NO_MORE_ITEMS
raise
break
try:
name = winreg.QueryValue(hkey, subkey)
if not name or not isinstance(name, str):
name = subkey
except OSError:
name = subkey
try:
cmd = winreg.QueryValue(hkey, 
rf"{subkey}\shell\open\command")
cmd = cmd.strip('"')
os.stat(cmd)
except (OSError, AttributeError, TypeError, ValueError):
cmd = ""
browsers.append((name, cmd))
return browsers

The loop over the result would change to `for browser, cmd in 
find_windows_browsers()`. The string to match for Internet Explorer, using the 
real name instead of the registry key name, would be "internet explorer". A 
class for Microsoft Edge ("msedge") should be added.

The browser would get instantiated with the cmd value, which ideally is the 
fully-qualified path of the executable. The fallback behavior wouldn't change 
for the case where self.cmd is an empty string. For example:

class WindowsDefault(BaseBrowser):
cmd = newwindow = newtab = ""

def __init__(self, name="", cmd=""):
super().__init__(name)
if cmd:
self.cmd = cmd
...

--

___
Python tracker 

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



[issue43535] Make str.join auto-convert inputs to strings.

2021-03-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm +0.5. Every time this bites me, I apply the same solution, so you're 
probably right that str.join should just do the work itself. And it's no doubt 
more performant that way, anyway.

And I've probably got some code that's just waiting for the current behavior to 
raise an error on me if passed the wrong inputs, even if I'd prefer it to 
succeed.

I should be +1, but I have a nagging "refuse to guess" feeling. But it doesn't 
seem like much of a guess: there's no other logical thing I could mean by this 
code. I'm unlikely to want it to raise an exception, or do any other conversion 
to a str.

--
nosy: +eric.smith

___
Python tracker 

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



[issue8232] webbrowser.open incomplete on Windows

2021-03-18 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Windows
dependencies: +[Windows] support args and cwd in os.startfile()
nosy: +paul.moore, tim.golden, zach.ware
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue43538] [Windows] support args and cwd in os.startfile()

2021-03-18 Thread Eryk Sun


New submission from Eryk Sun :

bpo-8232 has a patch to add an `arguments` parameter to os.startfile(). This 
improvement is needlessly tied to that issue. It's useful in general as a safer 
way to execute applications and scripts compared to using subprocess.Popen() 
with shell=True. It also enables passing arguments to applications and scripts 
when using the "runas" operation (prompts with a UAC dialog) and "runasuser" 
operation (prompts with a credential dialog). The latter operations are 
supported by default for binary executables and batch scripts in Windows 10, 
and they can be implemented by the progid of any file type.

Setting the working directory with a cwd parameter is not as generally useful, 
but it's not entirely useless and simple to add at the same time when adding 
the `args` parameter.

--
components: Extension Modules, Windows
messages: 388991
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [Windows] support args and cwd in os.startfile()
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



[issue43537] interpreter crashes when handling long text in input()

2021-03-18 Thread Xinmeng Xia


Change by Xinmeng Xia :


--
title: nterpreter crashes when handling long text in input() -> interpreter 
crashes when handling long text in input()

___
Python tracker 

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



[issue43537] nterpreter crashes when handling long text in input()

2021-03-18 Thread Xinmeng Xia


New submission from Xinmeng Xia :

When the argument of input() is very long text, the interpreter crashes.  This 
bug can  be reproduced Python 3.9.2 and Python 2.7.18 on Ubuntu 3.9.2 with 
GCC7.5.0. I try to  reproduce this bug on other version of Python and Operating 
System, but it fails. This bug seems to have a connection with the version of 
GCC.


Python 3.9.2 (default, Mar 12 2021, 15:08:35)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> input([1,2]*1)
*** Error in `/home/xxm/Desktop/apifuzz/Python-3.9.2/python': realloc(): 
invalid next size: 0x0135fd40 ***
=== Backtrace: =
/lib/x86_64-linux-gnu/libc.so.6(+0x777f5)[0x7f714431b7f5]
/lib/x86_64-linux-gnu/libc.so.6(+0x834da)[0x7f71443274da]
/lib/x86_64-linux-gnu/libc.so.6(realloc+0x199)[0x7f71443288a9]
/lib/x86_64-linux-gnu/libreadline.so.6(xrealloc+0xe)[0x7f71446a1ffe]
/lib/x86_64-linux-gnu/libreadline.so.6(rl_redisplay+0x125f)[0x7f714469451f]
/lib/x86_64-linux-gnu/libreadline.so.6(readline_internal_setup+0xb0)[0x7f7144681340]
/lib/x86_64-linux-gnu/libreadline.so.6(+0x2a4ac)[0x7f71446984ac]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python[0x5d60b2]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python(PyOS_Readline+0x116)[0x5da536]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python[0x648495]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python[0x613f26]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python(_PyEval_EvalFrameDefault+0x54e2)[0x4267a2]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python[0x4fa3e9]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python(PyEval_EvalCode+0x36)[0x4fa746]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python[0x543adf]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python[0x546d82]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python(PyRun_InteractiveLoopFlags+0x8e)[0x54704e]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python(PyRun_AnyFileExFlags+0x3c)[0x5478fc]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python(Py_RunMain+0x8d7)[0x42b1e7]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python(Py_BytesMain+0x56)[0x42b586]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f71442c4840]
/home/xxm/Desktop/apifuzz/Python-3.9.2/python(_start+0x29)[0x42a289]
=== Memory map: 
0040-00762000 r-xp  08:07 7740578 
/home/xxm/Desktop/apifuzz/Python-3.9.2/python
00961000-00962000 r--p 00361000 08:07 7740578 
/home/xxm/Desktop/apifuzz/Python-3.9.2/python
00962000-0099a000 rw-p 00362000 08:07 7740578 
/home/xxm/Desktop/apifuzz/Python-3.9.2/python
0099a000-009be000 rw-p  00:00 0
012dc000-013ce000 rw-p  00:00 0 [heap]
7f713c00-7f713c021000 rw-p  00:00 0
7f713c021000-7f714000 ---p  00:00 0
7f71439b5000-7f71439cc000 r-xp  08:07 1966109 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f71439cc000-7f7143bcb000 ---p 00017000 08:07 1966109 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f7143bcb000-7f7143bcc000 r--p 00016000 08:07 1966109 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f7143bcc000-7f7143bcd000 rw-p 00017000 08:07 1966109 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f7143bf-7f714407b000 r--p  08:07 4326136 
/usr/lib/locale/locale-archive
7f714407b000-7f71440a r-xp  08:07 1970777 
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7f71440a-7f714429f000 ---p 00025000 08:07 1970777 
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7f714429f000-7f71442a3000 r--p 00024000 08:07 1970777 
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7f71442a3000-7f71442a4000 rw-p 00028000 08:07 1970777 
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7f71442a4000-7f7144464000 r-xp  08:07 1966308 
/lib/x86_64-linux-gnu/libc-2.23.so
7f7144464000-7f7144664000 ---p 001c 08:07 1966308 
/lib/x86_64-linux-gnu/libc-2.23.so
7f7144664000-7f7144668000 r--p 001c 08:07 1966308 
/lib/x86_64-linux-gnu/libc-2.23.so
7f7144668000-7f714466a000 rw-p 001c4000 08:07 1966308 
/lib/x86_64-linux-gnu/libc-2.23.so
7f714466a000-7f714466e000 rw-p  00:00 0
7f714466e000-7f71446ab000 r-xp  08:07 1970756 
/lib/x86_64-linux-gnu/libreadline.so.6.3
7f71446ab000-7f71448ab000 ---p 0003d000 08:07 1970756 
/lib/x86_64-linux-gnu/libreadline.so.6.3
7f71448ab000-7f71448ad000 r--p 0003d000 08:07 1970756 
/lib/x86_64-linux-gnu/libreadline.so.6.3
7f71448ad000-7f71448b3000 rw-p 0003f000 08:07 1970756 
/lib/x86_64-linux-gnu/libreadline.so.6.3
7f71448b3000-7f71448b4000 rw-p  00:00 0
7f71448b4000-7f71449bc000 r-xp  08:07 1966312 
/lib/x86_64-linux-gnu/libm-2.23.so
7f71449bc000-7f7144bbb000 ---p 00108000 08:07 1966312 
/lib/x86_64-linux-gnu/libm-2.23.so
7f7144bbb000-7f7144bbc000 r--p 00107000 08:07 1966312 
/lib/x86_64-linux-gnu/libm-2.23.so
7f7144bbc000-7f7144bbd000 rw-p 00108000 08:07 1966312 
/lib/x86_64-linux-gnu/libm-2.23.so
7f7144bbd000-7f7144bbf000 r-xp  08:07 1966307 
/lib/x86_64-linux-gnu/libutil-2.23.so
7f7144bbf000-7f7144dbe000 ---p 2000 08:07 1966307 
/lib/x86_64-linux-gnu/libutil-2.23.so
7f7144dbe000-7f7144dbf000 r--p 1000 08:07 1966307 
/lib/x86_64-linux-gnu/libutil-2.23.so