[issue42269] Add ability to set __slots__ in dataclasses

2020-11-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

It would figure it out automatically. See 
https://github.com/ericvsmith/dataclasses/blob/master/dataclass_tools.py for a 
decorator that already does this.

I'll have a PR ready soon, I hope.

--

___
Python tracker 

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



[issue15034] Document best practices for exceptions

2020-11-10 Thread Vedran Čačić

Vedran Čačić  added the comment:

Terry: of course, if a method is not overridden, there's no need to call 
super()'s method, since the only thing it would do is call the same thing that 
would be called without overriding.

But of course, if Exception's __init__ does anything, then super() should be 
called from the overrridden method.

--
nosy: +veky

___
Python tracker 

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



[issue40932] subprocess docs should warn of shlex use on Windows

2020-11-10 Thread miss-islington


miss-islington  added the comment:


New changeset f9a8386e44a695551a1e54e709969e90e9b96bc4 by Ammar Askar in branch 
'master':
bpo-40932: Note security caveat of shlex.quote on Windows (GH-21502)
https://github.com/python/cpython/commit/f9a8386e44a695551a1e54e709969e90e9b96bc4


--
nosy: +miss-islington

___
Python tracker 

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



[issue39411] pyclbr rewrite using AST

2020-11-10 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset fa476fe13255d0360f18528e864540d927560f66 by Batuhan Taskaya in 
branch 'master':
bpo-39411: pyclbr rewrite on AST (#18103)
https://github.com/python/cpython/commit/fa476fe13255d0360f18528e864540d927560f66


--

___
Python tracker 

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



[issue42301] Add function to exploit heapq structure to locate an index of element

2020-11-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Marking this as declined for the reasons listed in the PR comments.

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



[issue42294] [C API] Add new C functions with more regular reference counting like PyTuple_GetItemRef()

2020-11-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PyModule_AddObject() has unique weird design, it is easy to misuse, and most 
code misuse it, but fixing it would break the code which uses it correctly.

I did not see any problems with PyTuple_GetItem().

--

___
Python tracker 

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



[issue42269] Add ability to set __slots__ in dataclasses

2020-11-10 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Is the plan to allow an argument to auto-generate __slots__, or would this 
require repeating the names once in __slots__, and once for annotations and the 
like?

--

___
Python tracker 

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



[issue42269] Add ability to set __slots__ in dataclasses

2020-11-10 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
nosy: +josh.r

___
Python tracker 

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



[issue39931] Global variables are not accessible from child processes (multiprocessing.Pool)

2020-11-10 Thread Josh Rosenberg


Change by Josh Rosenberg :


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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-11-10 Thread hai shi


Change by hai shi :


--
pull_requests: +22132
pull_request: https://github.com/python/cpython/pull/23235

___
Python tracker 

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



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

2020-11-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 95ce7cd0a64e7f4739af2d1c158ef69b6980f12a by Victor Stinner in 
branch 'master':
bpo-1635741: Fix typo in PyModule_AddObjectRef() doc (GH-23234)
https://github.com/python/cpython/commit/95ce7cd0a64e7f4739af2d1c158ef69b6980f12a


--

___
Python tracker 

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



[issue1487481] Could BIND_FIRST be removed on HP-UX?

2020-11-10 Thread Irit Katriel


Irit Katriel  added the comment:

Should we close this as out of date or is there anything that can still be done 
on it?

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

___
Python tracker 

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



[issue3461] smtplib does not fully support IPv6 in EHLO

2020-11-10 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue1479255] Fix building with SWIG's -c++ option set in setup.py

2020-11-10 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -3rd party, Python 2.7, Python 
3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue42294] [C API] Add new C functions with more regular reference counting like PyTuple_GetItemRef()

2020-11-10 Thread STINNER Victor


STINNER Victor  added the comment:

> If you want to work only with non-borrowed references, (...)

This is not my goal here. My goal is to reduce the risk of memory leaks.

--

___
Python tracker 

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



[issue6103] Static library (libpythonX.Y.a) installed in incorrect location

2020-11-10 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue42294] [C API] Add new C functions with more regular reference counting like PyTuple_GetItemRef()

2020-11-10 Thread STINNER Victor


STINNER Victor  added the comment:

In bpo-1635741, I added PyModule_AddObjectRef() (commit 
8021875bbcf7385e651def51bc597472a569042c):
https://docs.python.org/dev/c-api/module.html#c.PyModule_AddObjectRef

"Similar to PyModule_AddObject() but don't steal a reference to the value on 
success."

I was tired of bugs caused by misusage of the surprising PyModule_AddObject() 
API.

PyModule_AddObject() *is* useful in some cases, but it is confusing in most 
cases...

--

___
Python tracker 

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



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

2020-11-10 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22131
pull_request: https://github.com/python/cpython/pull/23234

___
Python tracker 

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



[issue42294] [C API] Add new C functions with more regular reference counting like PyTuple_GetItemRef()

2020-11-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 78ba7c69ada2f7eefd4e3ea375337d78dc2ce721 by kj in branch 'master':
bpo-42294: Grammar fixes in doc glossary strong/weak refs (GH-23227)
https://github.com/python/cpython/commit/78ba7c69ada2f7eefd4e3ea375337d78dc2ce721


--

___
Python tracker 

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



[issue42294] [C API] Add new C functions with more regular reference counting like PyTuple_GetItemRef()

2020-11-10 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj
nosy_count: 5.0 -> 6.0
pull_requests: +22130
pull_request: https://github.com/python/cpython/pull/23227

___
Python tracker 

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



[issue42260] [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter

2020-11-10 Thread STINNER Victor


STINNER Victor  added the comment:

The main drawback of rewriting Modules/getpath.c as Lib/_getpath.py (and 
removing getpath.c) is that PyConfig_Read() could no longer compute the Python 
Path Configuration. It would return an "empty" path configuration.

--

___
Python tracker 

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



[issue42140] asyncio.wait function creates futures set two times

2020-11-10 Thread Yury Selivanov


Yury Selivanov  added the comment:

Thanks for the change and for the discussion to everybody involved. The PR 
makes sense and I've already merged it.

--

___
Python tracker 

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



[issue42140] asyncio.wait function creates futures set two times

2020-11-10 Thread miss-islington


miss-islington  added the comment:


New changeset 33922cb0aa0c81ebff91ab4e938a58dfec2acf19 by Miss Islington (bot) 
in branch '3.9':
bpo-42140: Improve asyncio.wait function (GH-22938)
https://github.com/python/cpython/commit/33922cb0aa0c81ebff91ab4e938a58dfec2acf19


--

___
Python tracker 

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



[issue42314] Incorrect documentation entry for venv

2020-11-10 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset f8bea0a44d718296a249bdb766b8dbc92f38e8df by Zackery Spytz in 
branch '3.9':
[3.9] bpo-4bpo-42314: Fix the documentation for venv --upgrade-deps (GH-22113) 
(GH-23232)
https://github.com/python/cpython/commit/f8bea0a44d718296a249bdb766b8dbc92f38e8df


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue42307] make install must not copy python.o into $prefix/lib/python3.10/config-3.10-x86_64-linux-gnu/

2020-11-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hummm, I think the gains of having the .o over the .a are very very small as 
you can almost recreate anything you want with the .o using the .a and a small 
initialization function unless I am missing something.

--

___
Python tracker 

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



[issue41073] [C API] PyType_GetSlot() should accept static types

2020-11-10 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-41073: PyType_GetSlot() can now accept static types. (GH-21931)

Nice! It will be simpler to use PyType_GetSlot() in an extension with the 
limited C API, without having to care if the type is a static type or a heap 
type.

--

___
Python tracker 

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



[issue42307] make install must not copy python.o into $prefix/lib/python3.10/config-3.10-x86_64-linux-gnu/

2020-11-10 Thread STINNER Victor


STINNER Victor  added the comment:

The Fedora package of Python doesn't build the static libpython for 10 years 
(patch added at 2010-01-18):
https://src.fedoraproject.org/rpms/python3.9/blob/master/f/00111-no-static-lib.patch

libpython3.10.a (static) is around 15 MB and libpython3.10.so (dynamic) is 
around 3 MB. Fedora only installs libpython3.10.so (dynamic).

--

___
Python tracker 

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



[issue42140] asyncio.wait function creates futures set two times

2020-11-10 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42140] asyncio.wait function creates futures set two times

2020-11-10 Thread miss-islington


miss-islington  added the comment:


New changeset 7e5ef0a5713f968f6e942566c78bf57ffbef01de by Diogo Dutra in branch 
'master':
bpo-42140: Improve asyncio.wait function (GH-22938)
https://github.com/python/cpython/commit/7e5ef0a5713f968f6e942566c78bf57ffbef01de


--
nosy: +miss-islington

___
Python tracker 

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



[issue42273] Using LazyLoader leads to AttributeError

2020-11-10 Thread Kevin Keating


Kevin Keating  added the comment:

One possible solution here would be to update the documentation at 
https://github.com/python/cpython/blob/master/Doc/library/importlib.rst#implementing-lazy-imports
 to either note the limitation or to modify the lazy_import function so that it 
adds the module to the package's namespace.  That's basically the workaround 
that we've been using.

--

___
Python tracker 

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



[issue42273] Using LazyLoader leads to AttributeError

2020-11-10 Thread Kevin Keating


Kevin Keating  added the comment:

Brett, what do you mean by "the way import works"?  Is the difference between 
using LazyLoader and using a normal import intentional?

--
status:  -> open

___
Python tracker 

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



[issue42273] Using LazyLoader leads to AttributeError

2020-11-10 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon
resolution: not a bug -> 
status: closed -> 

___
Python tracker 

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



[issue42273] Using LazyLoader leads to AttributeError

2020-11-10 Thread Brett Cannon


Brett Cannon  added the comment:

The way import works,

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



[issue42315] `python -m` semantics conflict with `__file__`'s being optional

2020-11-10 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue42232] mmap module add Darwin specific madvise options

2020-11-10 Thread Ronald Oussoren


New submission from Ronald Oussoren :

Thanks for the PR. The reason I haven't reviewed the PR yet is that I need to 
check the SDK headers to see if the patch is complete.

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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-10 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I've filed Issue42318 about the surrogate pairs error I mention in msg380552.

--

___
Python tracker 

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



[issue42318] [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a text widget

2020-11-10 Thread Ronald Oussoren

New submission from Ronald Oussoren :

As mentioned in msg380552: I get an SyntaxError with message "utf-8' codec 
can't encode characters in position 7-12: surrogates not allowed." when I paste 
a smiley emoji in an IDLE interactive shell and try to execute that line, for 
example using:

>>> print("")

The error is likely due to a surrogate pair being present in the UTF-8 
representation of a Tcl/Tk string.

It should be possible to work around this in 
_tkinter.c:unicodeFromTclStringAndSize by merging surrogate pairs. 

This is with:
- Python 3.10
- macOS 11 (arm64)
- Tk 8.6.10

With Tk 8.6.8 (as included in the macOS installers on python.org) printing 
won't work at all, as mentioned in bpo-42225.

--
components: Tkinter, macOS
messages: 380715
nosy: ned.deily, ronaldoussoren
priority: normal
severity: normal
stage: needs patch
status: open
title: [tkinter] surrogate pairs in Tcl/Tk string when pasting an emoji in a 
text widget
type: behavior

___
Python tracker 

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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The way sys.prefix is calculated on macOS ensures that the correct sys.prefix 
is calculated even if you copy the binary to a different location. That's 
functionality I don't want to drop.

--

___
Python tracker 

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



[issue15034] Document best practices for exceptions

2020-11-10 Thread Irit Katriel


Irit Katriel  added the comment:

There are examples in the tutorial where super().__init__ is not called, like 
here: 

https://docs.python.org/3/tutorial/errors.html#user-defined-exceptions

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

___
Python tracker 

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



[issue4655] during Python installation, setup.py should not use .pydistutils.cfg

2020-11-10 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3, Python 3.4

___
Python tracker 

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



[issue41073] [C API] PyType_GetSlot() should accept static types

2020-11-10 Thread Petr Viktorin


Change by Petr Viktorin :


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



[issue41073] [C API] PyType_GetSlot() should accept static types

2020-11-10 Thread miss-islington


miss-islington  added the comment:


New changeset a13b26cac1519dad7bbc8651de7b826df7389d75 by Hai Shi in branch 
'master':
bpo-41073: PyType_GetSlot() can now accept static types. (GH-21931)
https://github.com/python/cpython/commit/a13b26cac1519dad7bbc8651de7b826df7389d75


--
nosy: +miss-islington

___
Python tracker 

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



[issue16781] execfile/exec execution in other than global scope uses locals(), leading to undefined behavior

2020-11-10 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue42307] make install must not copy python.o into $prefix/lib/python3.10/config-3.10-x86_64-linux-gnu/

2020-11-10 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I think the comments are correct in that it is used to create a new statically 
linked interpreter that includes a user provided extension module.  We could 
include python.o inside the libpythonXX.a file but then I think it breaks if 
you are embedding (e.g. linking .a to your own .o that has a main function).

It seems probable that no one uses python.o anymore but my preference would be 
to not remove it unless we are going to completely remove support for 
statically linking.  Nothing is really hurt by having that .o file in the 
install and the feature still works as originally intended.

It would be good to add a comment in the makefile, describing the possible use 
for that file.

--

___
Python tracker 

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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Michael Ferguson


Michael Ferguson  added the comment:

> For example, when I run the test exec on my macOS system, it is clear that 
> the python3 being invoked is not the venv one but a different python3 
> altogether that shows up earlier on PATH.

In the test case I am interested in, PATH is not set to the venv at all. You're 
supposed to be able to run a script in a venv without activating. In my case, I 
am trying to write a wrapper script that behaves similarly to the symbolic link 
in test-venv/bin/python3 but that works if the path to the python3 interpreter 
changes in the future. (For example, one might install and then uninstall 
pyenv).

--

___
Python tracker 

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-10 Thread Petr Viktorin


Petr Viktorin  added the comment:

The PR entirely removed the note that a slot's value "May not be NULL".
In fact, only tp_doc may be NULL. AFAIK, the restriction is still there for 
other slots.
Can that note be added back?

--
status: closed -> open

___
Python tracker 

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



[issue42103] [security] DoS (MemError via CPU and RAM exhaustion) when processing malformed Apple Property List files in binary format

2020-11-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue42260] [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter

2020-11-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ace3f9a0ce7b9fe8ae757fdd614f1e7a171f92b0 by Victor Stinner in 
branch 'master':
bpo-42260: Fix _PyConfig_Read() if compute_path_config=0 (GH-23220)
https://github.com/python/cpython/commit/ace3f9a0ce7b9fe8ae757fdd614f1e7a171f92b0


--

___
Python tracker 

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



[issue42085] Add dedicated slot for sending values

2020-11-10 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 1e996c3a3b51e9c6f1f4cea8a6dbcf3bcb865060 by Vladimir Matveev in 
branch 'master':
bpo-42085: Introduce dedicated entry in PyAsyncMethods for sending values 
(#22780)
https://github.com/python/cpython/commit/1e996c3a3b51e9c6f1f4cea8a6dbcf3bcb865060


--

___
Python tracker 

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



[issue42085] Add dedicated slot for sending values

2020-11-10 Thread Yury Selivanov


Yury Selivanov  added the comment:

Vladimir, please do a follow up PR documenting Py_TPFLAGS_HAVE_AM_SEND.

--

___
Python tracker 

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



[issue1598083] Top-level exception handler writes to stdout unsafely

2020-11-10 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3, Python 3.4

___
Python tracker 

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



[issue35560] format(float(123), "00") causes segfault in debug builds

2020-11-10 Thread Ned Deily


Ned Deily  added the comment:


New changeset dae5d728bc3f1d4039b64e4ec3a9036fd5d19587 by Miss Islington (bot) 
in branch '3.6':
bpo-35560: Remove assertion from format(float, "n") (GH-11288) (GH-23231)
https://github.com/python/cpython/commit/dae5d728bc3f1d4039b64e4ec3a9036fd5d19587


--
nosy: +ned.deily

___
Python tracker 

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



[issue42103] [security] DoS (MemError via CPU and RAM exhaustion) when processing malformed Apple Property List files in binary format

2020-11-10 Thread Ned Deily


Ned Deily  added the comment:


New changeset a63234c49b2fbfb6f0aca32525e525ce3d43b2b4 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-42103: Improve validation of Plist files. (GH-22882) (GH-23118)
https://github.com/python/cpython/commit/a63234c49b2fbfb6f0aca32525e525ce3d43b2b4


--

___
Python tracker 

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



[issue42103] [security] DoS (MemError via CPU and RAM exhaustion) when processing malformed Apple Property List files in binary format

2020-11-10 Thread Ned Deily


Ned Deily  added the comment:


New changeset 225e3659556616ad70186e7efc02baeebfeb5ec4 by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-42103: Improve validation of Plist files. (GH-22882) (#23117)
https://github.com/python/cpython/commit/225e3659556616ad70186e7efc02baeebfeb5ec4


--

___
Python tracker 

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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Note that the same is true for python3 outside of a venv, it does not use 
argv[0] to locate says.prefix (for framework builds).  That’s intentional.

--

___
Python tracker 

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



[issue42297] [argparse] Bad error message formatting when using custom usage text

2020-11-10 Thread paul j3


paul j3  added the comment:

We could look into using a different more compact 'prog' for these error 
messages.

Currently the subparser 'prog' uses the main prog plus positionals plus the 
subparser name.  The goal is to construct a subparser usage that reflects 
required input.  

This is fine for the usage line, but could be too verbose for some errors.  In 
an error, the 'prog' just helps identify which argument has problems, and 
doesn't need the extra usage information.   Most of the time that isn't an 
issue, since we don't use positional much in the main parser (and when used 
can't have variable nargs).

But I don't have immediate ideas as to what can be conveniently (and safely) 
changed.

--

___
Python tracker 

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



[issue42302] [Turtle] Add clockwise and anticlockwise method as alias to right and left

2020-11-10 Thread Ravi Chityala


Ravi Chityala  added the comment:

Hello All

In math and physics we typically use terms clockwise and
anti-clockwise and not right and left for rotation. This change will
make it easy for kids to learn the terms that they will eventually use
in math and physics anyway.

The change I am proposing is to alias right rotation with two more
names: clockwise or cw and left rotation with two more names:
anticlockwise or acw.  Programmers who are currently using left or
right can continue to do so.

Based on the documentation supplied by Steven, I agree that everyone
programming is using right and left but it might be in the right
direction to program using clockwise and anticlockwise.

Thanks,
Ravi

On Tue, Nov 10, 2020 at 2:21 AM Steven D'Aprano  wrote:
>
>
> Steven D'Aprano  added the comment:
>
> On Tue, Nov 10, 2020 at 09:55:40AM +, Serhiy Storchaka wrote:
>
> > If clockwise is a new
> > standard for this command in modern Turtle implementation, we can add
> > yet one alias. Otherwise I agree with Raymond.
>
> I had a very quick look at some Logo implementations:
>
> https://resources.terrapinlogo.com/weblogo/commands/
>
> https://www.mit.edu/~hlb/MA562/commands.html
>
> https://reduce-algebra.sourceforge.io/manual/manualse170.html
>
> https://docs.racket-lang.org/logo/index.html
>
> and even 3D Logo:
>
> https://vrmath2.net/node/12
>
> and I can see no sign of any other Logos allowing clockwise and
> anticlockwise as aliases. So I think it is up to Ravi Chityala to
> demonstrate that this alias is already in use in some other Logo or
> turtle graphics implementations.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue42317] Docs of `typing.get_args`: Mention that due to caching of typing generics the order of arguments for Unions can be different from the one of the returned tuple

2020-11-10 Thread Dominik V.


New submission from Dominik V. :

Due to caching of `__getitem__` for generic types, the order of arguments as 
returned by `get_args` might be different for Union:

```python
>>> from typing import List, Union, get_args
>>> get_args(get_args(List[Union[int, str]])[0])
(, )
>>> get_args(get_args(List[Union[str, int]])[0])
(, )
```

This is because `List[Union[int, str]] is List[Union[str, int]]`.

I understand that caching is useful to reduce the memory footprint of type 
hints, so I suggest to update the documentation of `get_args`. At the moment it 
reads:

> For a typing object of the form X[Y, Z, ...] these functions return X and (Y, 
> Z, ...).

This seems to imply that the returned objects are identical to the ones in the 
form `X[Y, Z, ...]`. However that's not the case:

```python
>>> U1 = Union[int, str]
>>> U2 = Union[str, int]
>>> get_args(List[U1])[0] is U1
True
>>> get_args(List[U2])[0] is U2
False
```

I'm not so much concerned about the identity, but the fact that a subsequent 
call to `get_args` on the Union returns a different type seems to be relevant.

So I propose to add the following sentence to the `get_args` docs:

> [...], it gets normalized to the original class.
> If `X` is a `Union`, the order of `(Y, Z, ...)` can be different from the one 
> of the original arguments `[Y, Z, ...]`.

Or alternatively:

> [...], it gets normalized to the original class.
> If `X` is a `Union`, the order of `(Y, Z, ...)` is arbitrary.

The second version is shorter but it's not completely accurate (since the order 
is actually not arbitrary).

--
assignee: docs@python
components: Documentation
messages: 380699
nosy: Dominik V., docs@python
priority: normal
severity: normal
status: open
title: Docs of `typing.get_args`: Mention that due to caching of typing 
generics the order of arguments for Unions can be different from the one of the 
returned tuple
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



[issue42267] Python 3.9 broken installer

2020-11-10 Thread JackSkellington


JackSkellington  added the comment:

Thank you for everything.

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



[issue42314] Incorrect documentation entry for venv

2020-11-10 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 2.0 -> 3.0
pull_requests: +22128
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23232

___
Python tracker 

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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The difference in behaviour is because the executable does not look at argv[0] 
to find its location on macOS. Your trick therefore doesn't work.

I prefer the current behaviour.

What I don't understand is *why* you want to do this. If I read your report 
correctly you're trying to run an Python 3 executable outside of the virtual 
environment as if it is in the virtual environment. Why not just use the binary 
inside the virtual environment?

--

___
Python tracker 

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



[issue35560] format(float(123), "00") causes segfault in debug builds

2020-11-10 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

This bug was introduced into the Python 3.6.8 "bugfix" release.

https://github.com/python/cpython/pull/23231 will fix it if anyone needs that 
on modern 3.6.

--
nosy: +gregory.p.smith
versions: +Python 3.6

___
Python tracker 

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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Ned Deily


Ned Deily  added the comment:

Sorry, I didn't intend to criticize what you are trying to do, I just not sure 
I understand it so I could give a more helpful response. It seems to me that an 
explanation for the difference in behavior you are seeing between your Ubuntu 
and macOS setups is in exactly what the value of PATH is when the exec is 
performed on each and exactly which python3 is found first. For example, when I 
run the test exec on my macOS system, it is clear that the python3 being 
invoked is not the venv one but a different python3 altogether that shows up 
earlier on PATH. Could such differences explain what you are seeing?

--

___
Python tracker 

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



[issue42273] Using LazyLoader leads to AttributeError

2020-11-10 Thread E. Paine


E. Paine  added the comment:

In short, the module isn't being added to the package's namespace because we 
are directly modifying sys.modules (hence why the behaviour would be the same 
if we imported using `import foo.b` as `from foo import b`).

I personally prefer to use the metapath instead of modifying sys.modules but I 
agree that the given example should work when the lazy import is not in 
`__init__.py`. The other solution is to modify the `LazyLoader` class to 
explicitly add the lazy module to the package's namespace (opinions?).

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



[issue35560] format(float(123), "00") causes segfault in debug builds

2020-11-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22127
pull_request: https://github.com/python/cpython/pull/23231

___
Python tracker 

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



[issue6899] Base.replace breaks tree

2020-11-10 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3

___
Python tracker 

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



[issue16926] setup.py register does not always respect --repository

2020-11-10 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3, Python 3.4

___
Python tracker 

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



[issue11728] mbox parser incorrect behaviour

2020-11-10 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3, Python 3.4

___
Python tracker 

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



[issue42309] BUILD: AIX-64-bit segmentation fault

2020-11-10 Thread Michael Felt


Michael Felt  added the comment:

On a different server, different compiler (xlc-v13, mine is xlc-v11) it gets 
past this point.

So, perhaps it is a compiler issue.

As the second system is missing many 64-bit libraries - still cannot build 
64-bit Python-3.9.

Low priority - imho.

--

___
Python tracker 

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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Michael Ferguson


Michael Ferguson  added the comment:

> I'm not sure I understand exactly what you are trying to accomplish but one 
> potential issue strikes me: you may need to ensure you are execing the right 
> python binary by including a more complete path:

That does not help with the original problem I was trying to solve, because I 
was trying to create a wrapper script that used whichever `python3` is 
available according to the `PATH` variable (other than potentially the one for 
this venv).

Whether or not you think that is a reasonable thing to do, the examples I 
showed have a difference in behavior between Mac OS X and linux that is 
probably undesirable.

--

___
Python tracker 

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



[issue34365] datetime's documentation refers to "comparison [...] falling back to the default scheme of comparing object addresses"

2020-11-10 Thread Xtrem532


Change by Xtrem532 :


--
nosy: +Xtrem532

___
Python tracker 

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



[issue42158] http.server doesn't guess n-quads, n-triples, notation3 and TriG MIME types

2020-11-10 Thread Dylan Van Assche


Change by Dylan Van Assche :


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

___
Python tracker 

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



[issue42316] Walrus Operator in list index

2020-11-10 Thread Brandon


New submission from Brandon :

Reading the PEP 572 document I don't see anything stating that Walrus operator 
in list indexes must be enclosed in parenthesis. 

Minimal Example: 
'''
In [1]: a = list(range(10))

In [2]: idx = -1

In [3]: a[idx := idx +1]
  File "", line 1
a[idx := idx +1]
  ^
SyntaxError: invalid syntax

'''

If you enclose in parenthesis it works as expected: 
'''
In [4]: a[(idx := idx +1)]
Out[4]: 0

In [5]: a[(idx := idx +1)]
Out[5]: 1

In [6]: a[(idx := idx +1)]
Out[6]: 2
'''

Is this a bug or am I misreading the PEP 572 document somewhere? It's not a 
top-level assignment nor is it a list comprehension so I would expect it to 
work in the first example.

--
components: asyncio
messages: 380691
nosy: Brando753, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Walrus Operator in list index
versions: Python 3.8

___
Python tracker 

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



[issue42313] rstrip removes the trailing `e`s.

2020-11-10 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

For 3.9+, you could do exactly what you want with .removesuffix 
(/.removeprefix) methods;
>>> test = "external_e_object"
>>> test.removesuffix("_object")
'external_e'

--
nosy: +BTaskaya

___
Python tracker 

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



[issue42315] `python -m` semantics conflict with `__file__`'s being optional

2020-11-10 Thread William Schwartz

New submission from William Schwartz :

`python -m mod` sets `sys.argv[0]` to the `mod.__file__` according to 
https://docs.python.org/3.9/using/cmdline.html#cmdoption-m

> If ["-m"] is given, the first element of sys.argv will be the full path to 
> the module file (while the module file is being located, the first element 
> will be set to "-m").

But `__file__` may not exist according to 
https://docs.python.org/3.9/reference/import.html#__file__

> __file__ is optional. If set, this attribute’s value must be a string. The 
> import system may opt to leave __file__ unset if it has no semantic meaning 
> (e.g. a module loaded from a database).

More technically, `__spec__.origin` is the source of `__file__`, and the former 
may be `None`, according to 
https://docs.python.org/3.9/library/importlib.html#importlib.machinery.ModuleSpec.origin

> (__file__)
>
> Name of the place from which the module is loaded, e.g. “builtin” for 
> built-in modules and the filename for modules loaded from source. Normally 
> “origin” should be set, but it may be None (the default) which indicates it 
> is unspecified (e.g. for namespace packages).

`python -m mod` sets sys.argv[0] to `mod.__spec__.origin` at 
3.9/Lib/runpy.py:196

It seems clear to me that the code is doing the right thing relative to the 
documentation for `-m`. But as #26388 and 
https://github.com/indygreg/PyOxidizer/issues/307 show, embedded Python runs 
into the semantic conflict with the documented behavior of `__spec__.origin` 
and `__file__`.


My proposed resolution of this contradiction is to set `sys.argv[0] = 
sys.orig_argv[0]` or, even better, `sys.argv[0] = sys.executable` when 
`PyConfig.run_module` is set but the named module's `__spec__.origin` is `None`.

--
components: Interpreter Core, Library (Lib)
messages: 380689
nosy: William.Schwartz, brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
status: open
title: `python -m` semantics conflict with `__file__`'s being optional
type: behavior
versions: Python 3.10, 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



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2020-11-10 Thread hai shi


Change by hai shi :


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



[issue42311] It seems like ctypes code makes truncated pointer values in x64(access violations)

2020-11-10 Thread Eryk Sun


Eryk Sun  added the comment:

A function that returns a pointer needs an explicit `restype` set. A function 
parameter that's a pointer generally requires `argtypes` to be set. For example:

_testdll.GetPointer.restype = ctypes.c_void_p
_testdll.SetPointer.argtypes = (ctypes.c_void_p,)

Unfortunately the ctypes documentation starts with a tutorial that promotes bad 
practices and misuses WinAPI GetModuleHandle multiple times, which gives people 
the wrong idea about pointer return values. However, the tutorial does mention 
that Python integers are passed as C int values by default and that C int is 
the default return type. It also shows how to use the `argtypes` and `restype` 
attributes.

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



[issue42014] shutil.rmtree calls onerror with different function than failed

2020-11-10 Thread miss-islington


miss-islington  added the comment:


New changeset 14a343a9af27725faeab8b330a6d66ff573704d3 by Miss Islington (bot) 
in branch '3.9':
bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585)
https://github.com/python/cpython/commit/14a343a9af27725faeab8b330a6d66ff573704d3


--

___
Python tracker 

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



[issue42014] shutil.rmtree calls onerror with different function than failed

2020-11-10 Thread miss-islington


miss-islington  added the comment:


New changeset c745b36ee3786fabc9231a43c085218df27dcd47 by Miss Islington (bot) 
in branch '3.8':
bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585)
https://github.com/python/cpython/commit/c745b36ee3786fabc9231a43c085218df27dcd47


--

___
Python tracker 

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



[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2020-11-10 Thread William Schwartz


Change by William Schwartz :


--
nosy: +William.Schwartz

___
Python tracker 

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



[issue42014] shutil.rmtree calls onerror with different function than failed

2020-11-10 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
nosy:  -giampaolo.rodola

___
Python tracker 

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



[issue42307] make install must not copy python.o into $prefix/lib/python3.10/config-3.10-x86_64-linux-gnu/

2020-11-10 Thread Ned Deily


Ned Deily  added the comment:

> Embedding?

The example I cited from the docs was for extending Python by building a new 
interpreter using an installed Python, not embedding. Dunno how often that is 
done, though. Perhaps on Windows where it was more difficult to build an 
interpreter from source? Perhaps Nick might have some ideas since he was 
involved in that section of the docs.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue42014] shutil.rmtree calls onerror with different function than failed

2020-11-10 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42314] Incorrect documentation entry for venv

2020-11-10 Thread Adrien


New submission from Adrien :

Hello,

I am reading the venv official documentation available here:
https://docs.python.org/3/library/venv.html

If I pick English - 3.9.0, it's stated:
"Changed in version 3.8: Add --upgrade-deps option to upgrade pip + setuptools 
to the latest on PyPI"

When I run this my laptop:
$ python3 --version
Python 3.8.5

$ python3 -m venv venv-myproject --clear --upgrade-deps
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] 
[--upgrade] [--without-pip] [--prompt PROMPT] ENV_DIR [ENV_DIR ...]
venv: error: unrecognized arguments: --upgrade-deps

If I pick English - 3.8(.6), I (correctly) don't see the option in the 
documentation.

Please fix the documentation of 3.9 to indicates that this option was changed 
(added) in 3.9 and not 3.8

Thanks!
Adrien

--
assignee: docs@python
components: Documentation
messages: 380684
nosy: ari75, docs@python
priority: normal
severity: normal
status: open
title: Incorrect documentation entry for venv
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



[issue42014] shutil.rmtree calls onerror with different function than failed

2020-11-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22125
pull_request: https://github.com/python/cpython/pull/23229

___
Python tracker 

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



[issue42014] shutil.rmtree calls onerror with different function than failed

2020-11-10 Thread miss-islington

miss-islington  added the comment:


New changeset e59b2deffde61e5641cabd65034fa11b4db898ba by Michal Čihař in 
branch 'master':
bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585)
https://github.com/python/cpython/commit/e59b2deffde61e5641cabd65034fa11b4db898ba


--
nosy: +miss-islington

___
Python tracker 

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



[issue42307] make install must not copy python.o into $prefix/lib/python3.10/config-3.10-x86_64-linux-gnu/

2020-11-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> But... does any user really build Python manually after Python is installed? 
> The Python build system couldn't handle that as part of the regular build? 
> Maybe using a new configure --enable-static flag?

Embedding? But they should use the .a not any of the .o. Object files should 
not be packaged IMHO.

--

___
Python tracker 

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



[issue42313] rstrip removes the trailing `e`s.

2020-11-10 Thread Zachary Ware


Zachary Ware  added the comment:

See https://docs.python.org/3/library/stdtypes.html#str.rstrip

The `{l,r,}strip` methods remove all characters contained in the passed-in 
string; `"aabbccddeeffgg".rstrip("gfe") == "aabbccdd"`

--
nosy: +zach.ware
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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Ned Deily


Ned Deily  added the comment:

I'm not sure I understand exactly what you are trying to accomplish but one 
potential issue strikes me: you may need to ensure you are execing the right 
python binary by including a more complete path:

$ (exec -a test-venv/bin/python3 test-venv/bin/python3 -c 'import sys; 
print(sys.executable); print (sys.prefix);')
/private/tmp/test-venv/bin/python3
/private/tmp/test-venv

--

___
Python tracker 

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



[issue42111] Make the xxlimited module an example of best extension module practices

2020-11-10 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Michael Ferguson


Michael Ferguson  added the comment:

In the above I meant to include the `bin` path in the examples, but it does not 
matter for the behavior

(exec -a test-venv/bin/python3 python3 -c 'import sys; print(sys.executable); 
print (sys.prefix);')

--

___
Python tracker 

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



[issue42313] rstrip removes the trailing `e`s.

2020-11-10 Thread Athul R


New submission from Athul R :

rstrip removes the trailing `e`s. 

i = "external_e_object"
i = i.rstrip('_object')
print(i) 
"""
It should have printed `external_e` but it prints only `external_`. 
"""

It happens only when I user rstrip("_object") not for other strings. 

# ===
# it works fine in the below case. 


i = "external_e_trail"
i = i.rstrip('_trail')
print(i) 
"""
It should have prints `external_e`
"""

--
components: Library (Lib)
files: python-bug.py
messages: 380678
nosy: Athul-R
priority: normal
severity: normal
status: open
title: rstrip removes the trailing `e`s.
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49590/python-bug.py

___
Python tracker 

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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-10 Thread Michael Ferguson


New submission from Michael Ferguson :

I have been trying to create a wrapper script for `python3` in a venv that 
behaves similarly to a symbolic link. I am able to use `exec -a` in bash to run 
`python3` with `argv[0]` set to the wrapper script. This allows it to function 
similarly to the symbolic link in a venv. However, this approach does not work 
on Mac OS X with a homebrew installation. I think this is a bug.


Here are the simple steps to reproduce (assuming bash shell):

```
cd /tmp
python3 -m venv test-venv
(exec -a test-venv/python3 python3 -c 'import sys; print(sys.executable); print 
(sys.prefix);')
```

### Good output (Ubuntu 20.04)
/tmp/test-venv/python-wrapper
/tmp

### Bad output (Homebrew on Mac OS X)
/usr/local/opt/python@3.9/bin/python3.9
/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9


Here are some things that might be related:
 * the Mac OS X framework launcher and how it uses `realpath` (and issue22490)
 * `site.py` code in `def venv` and the conditional on `__PYVENV_LAUNCHER__`. 
The `if` branch is not being run in this configuration.
 * setting the environment variable `PYTHONEXECUTABLE` (e.g. `export 
PYTHONEXECUTABLE=test-venv/python3` before the other commands) causes the `if` 
branch in the conditional on `__PYVENV_LAUNCHER__` in `site.py` `def venv` to 
be run. This allows `sys.executable` to be set as expected but `sys.prefix` is 
still wrong.



If you are interested in something closer to the use case, the below explains 
how to get a more user-facing reproducer:

$ python3 -m venv test-venv

-- put this into test-venv/python-wrapper --
#!/usr/bin/env bash

# remove path component to prevent infinite loop
export PATH=${PATH//test-venv/missing}

# Now run the real python3 interpreter but tell it that it
# is being launched at the current path, so it can
# correctly find dependencies in the venv
exec -a "$0" python3 "$@"

$ chmod a+x test-venv/python-wrapper

$ ./test-venv/python-wrapper -c 'import sys; print(sys.executable); print 
(sys.prefix);'

(and with this script the problematic behavior is exactly the same as the exec 
commands above)

--
components: macOS
messages: 380677
nosy: mppf, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: sys.prefix is set incorrectly on Mac OS X
type: behavior
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



[issue42311] It seems like ctypes code makes truncated pointer values in x64(access violations)

2020-11-10 Thread Taekab Park


New submission from Taekab Park :

It seems like ctypes code makes truncated pointer values in x64(access 
violations)

windows10 x64
options : __cdecl(/Gd)
tested : python(x64) 3.2, 3.4, 3.6, 3.9 
dll build with vc++2015 


The test code is simple.
Simply loaded TestDll and called function and checked return void* value.

result
actual void* : 0x7FFDA4322018  <-> python void* : 0xA4322018

== C code ==
void* GetPointer();
SetPointer(void* value);
INT64 GetPointer1();
void SetPointer1(INT64 obj);

== python == 
import ctypes

print(ctypes.sizeof(ctypes.c_void_p))
_testdll = ctypes.CDLL(r"TestDll.dll")

def tohex(val, nbits):
return hex((val + (1 << nbits)) % (1 << nbits))

result = _testdll.GetPointer()
print(tohex(result, 64))
_testdll.SetPointer(result)

result = _testdll.GetPointer1()
print(tohex(result, 64))
_testdll.SetPointer1(result)

--
components: ctypes
files: example.zip
messages: 380676
nosy: sh4dow
priority: normal
severity: normal
status: open
title: It seems like ctypes code makes truncated pointer values in x64(access 
violations)
type: crash
versions: Python 3.6, Python 3.9
Added file: https://bugs.python.org/file49589/example.zip

___
Python tracker 

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



[issue42171] Add PEP 573 to the stable ABI

2020-11-10 Thread Petr Viktorin


Petr Viktorin  added the comment:

Added.

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



[issue42183] Stack overflow error with asyncio.all_tasks and wait_for

2020-11-10 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.7

___
Python tracker 

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



[issue42307] make install must not copy python.o into $prefix/lib/python3.10/config-3.10-x86_64-linux-gnu/

2020-11-10 Thread STINNER Victor


STINNER Victor  added the comment:

Oh! I managed to build a static Python with the following commands:

cd /opt/pymaster/lib/python3.10/config-3.10-x86_64-linux-gnu
gcc -static -o ~/python-static python.o -L. $(./python-config.py --libs --embed)

I get a static binary:

$ ldd ~/python-static 
not a dynamic executable

And it works as expected:

$ ~/python-static 
Python 3.10.0a2+ (heads/master:1f73c320e2, Nov 10 2020, 11:47:55) 
[GCC 10.2.1 20201016 (Red Hat 10.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 


But... does any user really build Python manually after Python is installed? 
The Python build system couldn't handle that as part of the regular build? 
Maybe using a new configure --enable-static flag?


I'm not a fan of static binaries. For example, the linker emits many warnings 
about static linking:

/usr/bin/ld: ./libpython3.10.a(dynload_shlib.o): in function 
`_PyImport_FindSharedFuncptr':
/home/vstinner/python/master/./Python/dynload_shlib.c:100: warning: Using 
'dlopen' in statically linked applications requires at runtime the shared 
libraries from the glibc version used for linking
/usr/bin/ld: ./libpython3.10.a(posixmodule.o): in function 
`os_getgrouplist_impl':
/home/vstinner/python/master/./Modules/posixmodule.c:7411: warning: Using 
'getgrouplist' in statically linked applications requires at runtime the shared 
libraries from the glibc version used for linking
/usr/bin/ld: ./libpython3.10.a(posixmodule.o): in function `os_initgroups_impl':
/home/vstinner/python/master/./Modules/posixmodule.c:7610: warning: Using 
'initgroups' in statically linked applications requires at runtime the shared 
libraries from the glibc version used for linking
/usr/bin/ld: ./libpython3.10.a(pwdmodule.o): in function `pwd_getpwall_impl':
/home/vstinner/python/master/./Modules/pwdmodule.c:302: warning: Using 
'getpwent' in statically linked applications requires at runtime the shared 
libraries from the glibc version used for linking
/usr/bin/ld: /home/vstinner/python/master/./Modules/pwdmodule.c:301: warning: 
Using 'setpwent' in statically linked applications requires at runtime the 
shared libraries from the glibc version used for linking
/usr/bin/ld: /home/vstinner/python/master/./Modules/pwdmodule.c:307: warning: 
Using 'endpwent' in statically linked applications requires at runtime the 
shared libraries from the glibc version used for linking
/usr/bin/ld: ./libpython3.10.a(pwdmodule.o): in function `pwd_getpwnam_impl':
/home/vstinner/python/master/./Modules/pwdmodule.c:249: warning: Using 
'getpwnam_r' in statically linked applications requires at runtime the shared 
libraries from the glibc version used for linking
/usr/bin/ld: ./libpython3.10.a(pwdmodule.o): in function `pwd_getpwuid':
/home/vstinner/python/master/./Modules/pwdmodule.c:166: warning: Using 
'getpwuid_r' in statically linked applications requires at runtime the shared 
libraries from the glibc version used for linking

--

___
Python tracker 

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



[issue42183] Stack overflow error with asyncio.all_tasks and wait_for

2020-11-10 Thread miss-islington


miss-islington  added the comment:


New changeset 109c17315af124b25853c248f4a9bf00f03036f6 by Miss Islington (bot) 
in branch '3.8':
bpo-42183: Fix a stack overflow error for asyncio Task or Future repr() 
(GH-23020)
https://github.com/python/cpython/commit/109c17315af124b25853c248f4a9bf00f03036f6


--

___
Python tracker 

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



[issue42183] Stack overflow error with asyncio.all_tasks and wait_for

2020-11-10 Thread miss-islington


miss-islington  added the comment:


New changeset 90115a2cf7033c990a54d1ecb90ebd850b5f13cf by Miss Islington (bot) 
in branch '3.9':
bpo-42183: Fix a stack overflow error for asyncio Task or Future repr() 
(GH-23020)
https://github.com/python/cpython/commit/90115a2cf7033c990a54d1ecb90ebd850b5f13cf


--

___
Python tracker 

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



[issue42307] make install must not copy python.o into $prefix/lib/python3.10/config-3.10-x86_64-linux-gnu/

2020-11-10 Thread Ned Deily


Ned Deily  added the comment:

I don't know for sure why python.o is included but perhaps the intent was to 
allow a user to rebuild a static interpreter with an user-supplied extension as 
is hinted at in 
https://docs.python.org/dev/extending/extending.html#compilation-and-linkage

--

___
Python tracker 

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



  1   2   >