[issue46886] ARM64 Windows Non-Debug 3.x: random build error: failure during conversion to COFF: file invalid or corrupt

2022-03-02 Thread Niyas Sait


Niyas Sait  added the comment:

After the OS and toolchain update, I don't see the failures anymore.

https://buildbot.python.org/all/#/workers/45

I guess we can close the ticket and can reopen if it happens again.

--

___
Python tracker 

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



[issue46905] winsound.PlaySound should accept pathlib.Path instances

2022-03-02 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Windows
keywords: +easy (C)
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue46905] winsound.PlaySound should accept pathlib.Path instances

2022-03-02 Thread Eryk Sun


Eryk Sun  added the comment:

PlaySound() is implemented by the C function winsound_PlaySound_impl() in 
"PC/winsound.c". To support pathlike objects, it could use `soundname = 
PyOS_FSPath(sound)`, and require soundname to be a Unicode string via 
PyUnicode_Check(soundname). Or it could more generically support any buffer or 
pathlike object via PyUnicode_FSDecoder(sound, ). This call decodes 
byte strings using the filesystem encoding, which is UTF-8 unless legacy ANSI 
mode is enabled.

--
nosy: +eryksun
stage:  -> needs patch
versions: +Python 3.11

___
Python tracker 

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



[issue46831] Outdated comment for __build_class__ in compile.c

2022-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset fa8c5ed9c80507670c756aa83ea872b8a92bcd1c by Miss Islington (bot) 
in branch '3.10':
bpo-46831: Update __build_class__ comment (GH-31522)
https://github.com/python/cpython/commit/fa8c5ed9c80507670c756aa83ea872b8a92bcd1c


--

___
Python tracker 

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



[issue46831] Outdated comment for __build_class__ in compile.c

2022-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 1d428bb8c93120d449212e2a815988f28e33b868 by Miss Islington (bot) 
in branch '3.9':
bpo-46831: Update __build_class__ comment (GH-31522)
https://github.com/python/cpython/commit/1d428bb8c93120d449212e2a815988f28e33b868


--

___
Python tracker 

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



[issue46823] Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode

2022-03-02 Thread Dennis Sweeney


Change by Dennis Sweeney :


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



[issue46831] Outdated comment for __build_class__ in compile.c

2022-03-02 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue46831] Outdated comment for __build_class__ in compile.c

2022-03-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +29771
pull_request: https://github.com/python/cpython/pull/31652

___
Python tracker 

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



[issue46831] Outdated comment for __build_class__ in compile.c

2022-03-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29772
pull_request: https://github.com/python/cpython/pull/31653

___
Python tracker 

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



[issue46831] Outdated comment for __build_class__ in compile.c

2022-03-02 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 81d968b7c30d5b41f3f28b297b7ee5345d569509 by Shantanu in branch 
'main':
bpo-46831: Update __build_class__ comment (#31522)
https://github.com/python/cpython/commit/81d968b7c30d5b41f3f28b297b7ee5345d569509


--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-03-02 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 59e1ce95f1e6ea8a556212b8b10cbc122f1a1711 by Jelle Zijlstra in 
branch 'main':
bpo-46643: fix NEWS entry (GH-31651)
https://github.com/python/cpython/commit/59e1ce95f1e6ea8a556212b8b10cbc122f1a1711


--

___
Python tracker 

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



[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-03-02 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
pull_requests: +29770
pull_request: https://github.com/python/cpython/pull/31651

___
Python tracker 

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



[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2022-03-02 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 4f74052b455a54ac736f38973693aeea2ec14116 by Inada Naoki in branch 
'main':
bpo-40116: dict: Add regression test for iteration order. (GH-31550)
https://github.com/python/cpython/commit/4f74052b455a54ac736f38973693aeea2ec14116


--

___
Python tracker 

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



[issue46906] Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal.

2022-03-02 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue46863] Python 3.10 OpenSSL Configuration Issues

2022-03-02 Thread Adam


Adam  added the comment:

Many thanks Christian, that resolved the issue! I really appreciate your 
efforts here.

--

___
Python tracker 

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



[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-02 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +methane

___
Python tracker 

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



[issue46906] Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal.

2022-03-02 Thread Inada Naoki


New submission from Inada Naoki :

Original issue. https://github.com/msgpack/msgpack-python/issues/497

_PyFloat_(Pack|Unpack)(4|8) is very nice API for serializers like msgpack.
Converting double and float into char[] is not trivial and these APIs do it in 
very efficient way.

And these APIs don't reveal CPython internal strucutre. It just convert double 
and float into char[].

So please keep these APIs public for libraries like msgpack.

--
components: C API
messages: 414401
nosy: methane, vstinner
priority: normal
severity: normal
status: open
title: Make _PyFloat_(Pack|Unpack)(4|8) cpython API, not internal.
versions: Python 3.11

___
Python tracker 

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



[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-02 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

a8b9350964f43cb648c98c179c8037fbf3ff8a7d is the first bad commit
commit a8b9350964f43cb648c98c179c8037fbf3ff8a7d
Author: Mark Shannon 
Date:   Wed Oct 13 14:19:34 2021 +0100

bpo-45340: Don't create object dictionaries unless actually needed 
(GH-28802)

* Never change types' cached keys. It could invalidate inline attribute 
objects.

* Lazily create object dictionaries.

* Update specialization of LOAD/STORE_ATTR.

* Don't update shared keys version for deletion of value.

* Update gdb support to handle instance values.

* Rename SPLIT_KEYS opcodes to INSTANCE_VALUE.

--
nosy: +Dennis Sweeney, Mark.Shannon

___
Python tracker 

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



[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 257f5be7f7fad37d0db6c145e534e5b7289d8804 by Miss Islington (bot) 
in branch '3.10':
bpo-46643: Fix stringized P.args/P.kwargs with get_type_hints (GH-31238)
https://github.com/python/cpython/commit/257f5be7f7fad37d0db6c145e534e5b7289d8804


--

___
Python tracker 

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



[issue46902] Typo hint message for from-imports?

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I evaluated this, but is considerably more complex than the regular import, 
because one triggers an attribute error where we have the full module but in 
the second case we don't have the full module ready, so it requires 
considerable modifications.

I will investigate again if there is a way that doesn't require lots of 
changes, but is likely that we unfortunately need to reject this improvement :(

--

___
Python tracker 

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



[issue21910] [doc] File protocol should document if writelines must handle generators sensibly

2022-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset cf8aff6319794807aa578215710e6caa4479516f by Miss Islington (bot) 
in branch '3.9':
bpo-21910: Clarify docs for codecs writelines method (GH-31245)
https://github.com/python/cpython/commit/cf8aff6319794807aa578215710e6caa4479516f


--

___
Python tracker 

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



[issue21910] [doc] File protocol should document if writelines must handle generators sensibly

2022-03-02 Thread miss-islington


miss-islington  added the comment:


New changeset 60b561c246da2073672a016340457e4534dfdf5b by Miss Islington (bot) 
in branch '3.10':
bpo-21910: Clarify docs for codecs writelines method (GH-31245)
https://github.com/python/cpython/commit/60b561c246da2073672a016340457e4534dfdf5b


--

___
Python tracker 

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



[issue21910] [doc] File protocol should document if writelines must handle generators sensibly

2022-03-02 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue21910] [doc] File protocol should document if writelines must handle generators sensibly

2022-03-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 13.0 -> 14.0
pull_requests: +29767
pull_request: https://github.com/python/cpython/pull/31647

___
Python tracker 

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



[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-03-02 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue21910] [doc] File protocol should document if writelines must handle generators sensibly

2022-03-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29768
pull_request: https://github.com/python/cpython/pull/31648

___
Python tracker 

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



[issue21910] [doc] File protocol should document if writelines must handle generators sensibly

2022-03-02 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset a8c87a239ee1414d6dd0b062fe9ec3e5b0c50cb8 by slateny in branch 
'main':
bpo-21910: Clarify docs for codecs writelines method (GH-31245)
https://github.com/python/cpython/commit/a8c87a239ee1414d6dd0b062fe9ec3e5b0c50cb8


--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-03-02 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 75d2d945b4e28ca34506b2d4902367b61a8dff82 by Gregory Beauregard in 
branch 'main':
bpo-46643: Fix stringized P.args/P.kwargs with get_type_hints (GH-31238)
https://github.com/python/cpython/commit/75d2d945b4e28ca34506b2d4902367b61a8dff82


--

___
Python tracker 

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



[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-03-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +29766
pull_request: https://github.com/python/cpython/pull/31646

___
Python tracker 

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



[issue46902] Typo hint message for from-imports?

2022-03-02 Thread Andre Roberge


Change by Andre Roberge :


--
nosy: +aroberge

___
Python tracker 

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



[issue46864] Deprecate ob_shash in BytesObject

2022-03-02 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue46904] Python Decimal supports '#' format, C Decimal does not.

2022-03-02 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue46905] winsound.PlaySound should accept pathlib.Path instances

2022-03-02 Thread Julian


New submission from Julian :

The library function winsound.PlaySound takes a sound parameter. One of the 
valid arguments is a path to a WAV filename.

Since Python 3.4, paths can be cleanly represented with PathLib.Path instances.

However, if you pass a Path instance to PlaySound, it responds with:

   TypeError: 'sound' must be str or None, not 'WindowsPath'

This can be quickly fixed in the caller by passing str(the_path_instance) 
instead, but it would be cleaner if PlaySound accepted Python's preferred 
method of representing paths.

--
components: Library (Lib)
messages: 414393
nosy: Julian-O
priority: normal
severity: normal
status: open
title: winsound.PlaySound should accept pathlib.Path instances
type: enhancement

___
Python tracker 

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



[issue46904] Python Decimal supports '#' format, C Decimal does not.

2022-03-02 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue26208] decimal C module's exceptions don't match the Python version

2022-03-02 Thread Constantine Evans


Constantine Evans  added the comment:

Some other non-matching exceptions are unfriendly, but do not come from 
libmpdec and could be made to match without, I think, causing problems.  For 
example:

>>> format(_decimal.Decimal(1), "invalid")
...
ValueError: invalid format string
>>> format(_pydecimal.Decimal(1), "invalid")
...
ValueError: Invalid format specifier: invalid

Would it make sense to make a patch to make these match?

--
nosy: +const

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread Brandt Bucher


Brandt Bucher  added the comment:

> What I *think* is happening is that the inline cache takes the size of the 
> function (in code units) from about 4800 to about 5200, crossing our 
> threshold for quickening (currently set to 5000).

Yep, nailed it:

>>> len(list(dis.get_instructions(do_unpacking)))
4827
>>> len(list(dis.get_instructions(do_unpacking, show_caches=True)))
5251
>>> do_unpacking(1_000, range(10))
0.06478393300494645
>>> do_unpacking.__code__._co_quickened is None
True

--

___
Python tracker 

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



[issue46904] Python Decimal supports '#' format, C Decimal does not.

2022-03-02 Thread Constantine Evans


New submission from Constantine Evans :

Decimal as implemented in _pydecimal supports the '#' alternate form in format 
strings, though this does not appear to be documented: as with floats, it 
causes a decimal point to be included regardless of value.  Decimal as 
implemented in cdecimal, as it uses libmpdec, does not.

This is a rather minor discrepancy; I hadn't actually intended to have # in my 
format string at all, but it had ended up there and was causing errors for half 
of the users of my library.  # also could be useful for decimals, as it can be 
for floats.

Like #45739, it's unclear to me whether this is a discrepancy that should be 
corrected by implementing # for cdecimal, removing # support for _pydecimal, or 
just documenting the inconsistency.

--
components: Library (Lib)
messages: 414390
nosy: const
priority: normal
severity: normal
status: open
title: Python Decimal supports '#' format, C Decimal does not.
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue46860] `--with-suffix` not respected on case-insensitive file systems

2022-03-02 Thread Brett Cannon


Change by Brett Cannon :


--
versions: +Python 3.11

___
Python tracker 

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



[issue46860] `--with-suffix` not respected on case-insensitive file systems

2022-03-02 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset 50ec3453c50c490eca7e990103c79671bd08ab2e by Brett Cannon in 
branch 'main':
bpo-46860: Respect `--with-suffix` on case-insensitive file systems (GH-31593)
https://github.com/python/cpython/commit/50ec3453c50c490eca7e990103c79671bd08ab2e


--

___
Python tracker 

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



[issue46894] make install DESTDIR= uses /lib/python3.10/lib-dynload out of DESTDIR

2022-03-02 Thread Ned Deily


Ned Deily  added the comment:

Why are you using --prefix=/ ? Or better yet, please explain you are trying to 
accomplish. A normal case would be --prefix=/some/path other than / and not use 
DESTDIR. You won't be able to install into / on a current macOS system anyway.

--
nosy: +ned.deily

___
Python tracker 

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



[issue46902] Typo hint message for from-imports?

2022-03-02 Thread Alex Waygood


Change by Alex Waygood :


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



[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-02 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

A hard crash seems wrong to me, and I'm not convinced yet that checking that 
the type of the attribute name is exactly string is correct.

Found while debugging a crash in PyObjC's testsuite, PyObjC uses a subclass of 
str to represent Objective-C strings.  Using such instances works fine in 
practice, but causes a crash in a --with-pydebug build due to this assertion.

--

___
Python tracker 

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



[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-02 Thread Ronald Oussoren


New submission from Ronald Oussoren :

The script below fails with an assertion error with python 3.11a5+ (current 
trunk) when build with --with-pydebug:

# BEGIN OF FILE
class String(str):
__slots__ = ()

name = String("hello")

class Bag:
pass

o = Bag()
setattr(o, name, 42)

# END OF FILE

Error output:

% /tmp/py311/bin/python3 -Xdev str.py   
  
(master)pyobjc-8
Assertion failed: (PyUnicode_CheckExact(name)), function 
_PyObject_StoreInstanceAttribute, file dictobject.c, line 5426.
Fatal Python error: Aborted

Current thread 0x000100a98580 (most recent call first):
  File "/Users/ronald/Projects/pyobjc-8/pyobjc-core/str.py", line 10 in 
zsh: abort  /tmp/py311/bin/python3 -Xdev str.py

--
components: Interpreter Core
messages: 414386
nosy: ronaldoussoren
priority: normal
severity: normal
status: open
title: Crash when setting attribute with string subclass as the name 
(--with-pydebug)
type: crash
versions: Python 3.11

___
Python tracker 

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



[issue46902] Typo hint message for from-imports?

2022-03-02 Thread Jean Abou Samra


New submission from Jean Abou Samra :

See for example:

>>> from pygments.regexopt import regexopt
Traceback (most recent call last):
  File "", line 1, in 
ImportError: cannot import name 'regexopt' from 'pygments.regexopt' 
(/home/jean/repos/pygments/pygments/regexopt.py)
>>> from pygments.regexopt import regex_opt
>>> regexopt
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'regexopt' is not defined. Did you mean: 'regex_opt'?

In Python 3.10, there is a nice helpful error message suggesting
how to correct the typo for NameError and AttributeError. Would
it be possible to have the same for ImportError with 'from import'?

--
components: Interpreter Core
messages: 414385
nosy: Jean_Abou_Samra
priority: normal
severity: normal
status: open
title: Typo hint message for from-imports?
type: enhancement
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue46823] Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode

2022-03-02 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
title: Add LOAD_FAST__LOAD_ATTR_INSTACE_VALUE combined opcode -> Add 
LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode

___
Python tracker 

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



[issue45492] stdlib inspect documentation on code.co_names is incorrect

2022-03-02 Thread Irit Katriel


Change by Irit Katriel :


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



[issue45492] stdlib inspect documentation on code.co_names is incorrect

2022-03-02 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset eb65e46b9b28103767c115ccf71a97a9f4237d4c by Irit Katriel in 
branch '3.10':
[3.10] bpo-45492: Corrected documentation for co_names in inspect library doc 
(GH-31456). (GH-31645)
https://github.com/python/cpython/commit/eb65e46b9b28103767c115ccf71a97a9f4237d4c


--

___
Python tracker 

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



[issue45492] stdlib inspect documentation on code.co_names is incorrect

2022-03-02 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +29765
pull_request: https://github.com/python/cpython/pull/31645

___
Python tracker 

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



[issue45492] stdlib inspect documentation on code.co_names is incorrect

2022-03-02 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 3257d49d236e5f3453fe9d2fd8338bcdfe9756b7 by slateny in branch 
'main':
bpo-45492: Corrected documentation for co_names in inspect library doc 
(GH-31456)
https://github.com/python/cpython/commit/3257d49d236e5f3453fe9d2fd8338bcdfe9756b7


--
nosy: +iritkatriel

___
Python tracker 

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



[issue46901] Deprecate and eventually remove macOS-only PYTHONEXECUTABLE environ variable

2022-03-02 Thread Ned Deily


New submission from Ned Deily :

The PYTHONEXECUTABLE is a holdover from old Python 2 days; AFAIK, it was 
specifically to support the Build Applet tool which could be used to build 
macOS app bundles in Python 2. The only place in current Py3 releases where it 
is used is in the standard library is in the launch of IDLE.app, a usage that 
should be able to be eliminated. Otherwise, there shouldn't be any need for it 
by third-parties.  For 3.11, we could eliminate its use by IDLE.app and add a 
deprecation warning to the docs; not sure about an execution time warning?

https://docs.python.org/3/using/cmdline.html#envvar-PYTHONEXECUTABLE

--
assignee: docs@python
components: Documentation, macOS
messages: 414382
nosy: docs@python, ned.deily, ronaldoussoren, steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: Deprecate and eventually remove macOS-only PYTHONEXECUTABLE environ 
variable
versions: Python 3.11

___
Python tracker 

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



[issue46889] enable sqlite math functions on macos

2022-03-02 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the suggested PR. And thanks for noticing, Erlend! I should have 
checked with you first!

To reiterate what I noted on the PR, this (reduntant) change would only have 
affected the Pythons provided by the python.org macOS installers; this behavior 
doesn't necessarily apply to all macOS Pythons. In particular, it appears that 
the Apple-provided system libsqlite3 does not have this option enabled so if 
you are building Python on macOS you'd need to supply another version of 
libsqlite3, like from a third-party distributor (say MacPorts or Homebrew) or 
build it yourself.

--
resolution: not a bug -> works for me
stage: patch review -> resolved
status: pending -> closed

___
Python tracker 

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



[issue46633] AddressSanitizer: Skip tests directly in Python, not with external config

2022-03-02 Thread STINNER Victor


STINNER Victor  added the comment:

> https://github.com/python/buildmaster-config/pull/314

I merged this PR as well. The new buildbot configuration will be deployed soon.

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



[issue46633] AddressSanitizer: Skip tests directly in Python, not with external config

2022-03-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 359bc392ba2b8f2acca223426c8210bb74f724c6 by Victor Stinner in 
branch '3.9':
[3.10] bpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632) (GH-31634) 
(GH-31644)
https://github.com/python/cpython/commit/359bc392ba2b8f2acca223426c8210bb74f724c6


--

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> OOI, does it become a "blocker" again once you've done the alpha release, or 
> what stops it being deferred past the beta or even the final release?

Check out the devguide:

https://devguide.python.org/triaging/#priority

> The issue will not hold up the next release, n. It will be promoted to a 
> release blocker for the following release, n+1.

But in any case, I normally promote them to release blockers by hand and all of 
them become full blockers in the beta.

--

___
Python tracker 

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



[issue46885] Ensure PEP 663 changes are reverted from 3.11

2022-03-02 Thread Ethan Furman


Change by Ethan Furman :


--
priority: release blocker -> high

___
Python tracker 

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



[issue46889] enable sqlite math functions on macos

2022-03-02 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FTR, here's 3.10 and 3.11 on my Mac, using the official Python.org installers:

$ python3.10
Python 3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 
(clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> cx = sqlite3.connect(":memory:")
>>> cx.execute("select sin('1')").fetchone()
(0.8414709848078965,)

$ python3.11
Python 3.11.0a5 (v3.11.0a5:c4e4b91557, Feb  3 2022, 14:54:01) [Clang 13.0.0 
(clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> cx = sqlite3.connect(":memory:")
>>> cx.execute("select sin('1')").fetchone()
(0.8414709848078965,)

--
status: open -> pending

___
Python tracker 

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



[issue46889] enable sqlite math functions on macos

2022-03-02 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Duplicate of bpo-42686.

--
status: pending -> open

___
Python tracker 

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



[issue46889] enable sqlite math functions on macos

2022-03-02 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Suggesting to close as "not a bug".

--
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue46889] enable sqlite math functions on macos

2022-03-02 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

This is not needed. Quoting 
https://sqlite.org/compile.html#enable_math_functions:

This option is automatically added to the Makefile by the configure script 
on unix platforms, unless the --disable-math option is used.

--
nosy: +erlendaasland

___
Python tracker 

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



[issue46890] venv does not create "python" link in python 3.11

2022-03-02 Thread Steve Dower


Steve Dower  added the comment:

> I've pasted the diff below because I'm not yet convinced that it is correct 
> (in particular the value for "argv0".)
argv0 is literally what C sees in argv[0], which in the framework case I 
believe is calculated by a launcher?

The getpath.py change is probably adding an OS check for this line: 
https://github.com/python/cpython/blob/main/Modules/getpath.py#L304

if ENV_PYTHONEXECUTABLE or ENV___PYVENV_LAUNCHER__:
 # If set, these variables imply that we should be using them as
 # sys.executable and when searching for venvs. However, we should
 # use the argv0 path for prefix calculation
 if os_name != 'darwin':
 base_executable = executable
 if not real_executable:
 real_executable = executable
 executable = ENV_PYTHONEXECUTABLE or ENV___PYVENV_LAUNCHER__
 executable_dir = dirname(executable)

I think the comment "we should use the argv0 path for prefix 
calculation" isn't correct (anymore?) either, since updating 
executable_dir is going to do the opposite of that. But I guess there 
were tests proving otherwise. It won't affect this case, since both 
argv0 and ENV___PYVENV_LAUNCHER__ appear to be under the same prefix (at 
least in Ronald's example).

--

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

It's not an UNPACK_SEQUENCE slowdown, it's a silly benchmark ;)

https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_unpack_sequence/run_benchmark.py#L6

What I *think* is happening is that the inline cache takes the size of the 
function (in code units) from about 4800 to about 5200, crossing our threshold 
for quickening (currently set to 5000).

When we quicken in-place, there will be no need for a threshold and this issue 
will disappear. We should probably up the threshold for now, just to keep the 
charts looking good.

--

___
Python tracker 

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



[issue46633] AddressSanitizer: Skip tests directly in Python, not with external config

2022-03-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29764
pull_request: https://github.com/python/cpython/pull/31644

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

Good to know, although "deferred blocker" is somewhat vague about when it is 
deferred until.

OOI, does it become a "blocker" again once you've done the alpha release, or 
what stops it being deferred past the beta or even the final release?

--

___
Python tracker 

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



[issue46633] AddressSanitizer: Skip tests directly in Python, not with external config

2022-03-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 93264452d952d9ba604bacf2947c2df5dd477931 by Victor Stinner in 
branch '3.10':
[3.10] bpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632) (GH-31634)
https://github.com/python/cpython/commit/93264452d952d9ba604bacf2947c2df5dd477931


--

___
Python tracker 

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



[issue46900] marshal.dumps represents the same list object differently

2022-03-02 Thread William Dreese


Change by William Dreese :


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



[issue46900] marshal.dumps represents the same list object differently

2022-03-02 Thread William Dreese


William Dreese  added the comment:

You two are both correct, this is not a bug and is the intended functionality.

> The difference between 41 and 169 is 128:

This realization helps a ton. Thanks.

--

___
Python tracker 

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



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-02 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I don't feel qualified to review the PR, but can confirm that this PR fixes 
this issue as well as the crash in PyObjC that I extracted my reproducer from.

--

___
Python tracker 

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



[issue46900] marshal.dumps represents the same list object differently

2022-03-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

>From https://github.com/python/cpython/blob/main/Python/marshal.c:

41 is:

#define TYPE_SMALL_TUPLE')'

The difference between 41 and 169 is 128:

#define FLAG_REF'\x80' /* with a type, add obj to index */

So the difference is the FLAG_REF bit being set. I'm not sure if that helps you 
or not.

In any event, this doesn't look like a bug. You might want to ask on 
python-list or Stack Overflow for more help.

--
nosy: +eric.smith

___
Python tracker 

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



[issue46900] marshal.dumps represents the same list object differently

2022-03-02 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The difference is the FLAG_REF which is set to 128 (0x80). 

>>> import marshal
>>> var_example = [(1,2,3),(4,5,6)]
>>> vm = marshal.dumps(var_example)
>>> rm = marshal.dumps([(1,2,3),(4,5,6)])
>>> [v ^ r for v, r in zip(vm, rm)]
[128, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

Whether a flag for possible reuse is generated depends on the reference count 
of a object.

When passing in the list as variable, the reference count is higher than 
passing it as a literal.


 That flag tells marshal whether to generate an index entry.  Whether that 
occurs re

--
nosy: +rhettinger

___
Python tracker 

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



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-02 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Is there some way to mark something as not blocking an alpha release, but 
> blocking a beta release?

"Deferred blocker"

--

___
Python tracker 

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



[issue46890] venv does not create "python" link in python 3.11

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Ok, marking is at "deferred blocker"

--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue46900] marshal.dumps represents the same list object differently

2022-03-02 Thread William Dreese


William Dreese  added the comment:

I've made a very bad copy & paste error with the terminal output below, I 
apologize. The corrected output is

>>> pp(var_marshaled)
91
2
0
0
0
41
3
233
1
0
0
0
233
2
0
0
0
233
3
0
0
0
41
3
233
4
0
0
0
233
5
0
0
0
233
6
0
0
0

>>> pp(raw_marshaled)
91
2
0
0
0
169
3
233
1
0
0
0
233
2
0
0
0
233
3
0
0
0
169
3
233
4
0
0
0
233
5
0
0
0
233
6
0
0
0

--

___
Python tracker 

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



[issue46900] marshal.dumps represents the same list object differently

2022-03-02 Thread William Dreese


New submission from William Dreese :

Hello,

I've been working with the marshal package and came across this issue (I think) 
-

Python 3.9.10 Interpreter
(Same output in 3.11.0a5+ (heads/master:b6b711a1aa) on darwin)
>>> import marshal
>>> var_example = [(1,2,3),(4,5,6)]
>>> var_marshaled = marshal.dumps(var_example)
>>> raw_marshaled = marshal.dumps([(1,2,3),(4,5,6)])
>>> def pp(to_print):
>>> [print(byt) for byt in to_print]
>>> pp(var_marshaled)
219
2
0
0
0
41
3
233
1
0
0
0
233
2
0
0
0
233
3
0
0
0
169
3
233
4
0
0
0
233
5
0
0
0
233
6
0
0
0
91
2
0
0
0
41
3
233
1
0
0
0
233
2
0
0
0
233
3
0
0
0
169
3
233
4
0
0
0
233
5
0
0
0
233
6
0
0
0
>>> pp(raw_marshaled)
219
2
0
0
0
169
3
233
1
0
0
0
233
2
0
0
0
233
3
0
0
0
169
3
233
4
0
0
0
233
5
0
0
0
233
6
0
0
0
91
2
0
0
0
169
3
233
1
0
0
0
233
2
0
0
0
233
3
0
0
0
169
3
233
4
0
0
0
233
5
0
0
0
233
6
0
0
0

The difference above lies in the byte representation of the tuple type (41 in 
the variable version and 169 in the raw version). Is this intended behavior?

--
components: C API
messages: 414362
nosy: Dreeseaw
priority: normal
severity: normal
status: open
title: marshal.dumps represents the same list object differently
type: behavior
versions: Python 3.11

___
Python tracker 

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



[issue46267] gzip.compress incorrectly ignores level parameter

2022-03-02 Thread Ruben Vorderman


Ruben Vorderman  added the comment:

ping

--

___
Python tracker 

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



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

Dennis, thanks for bisecting this.

--

___
Python tracker 

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



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-02 Thread Mark Shannon


Change by Mark Shannon :


--
assignee:  -> Mark.Shannon

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

We should be done with this by early next week, if you can wait.

--

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

Is there some way to mark something as not blocking an alpha release, but 
blocking a beta release?

Everything is working at the moment, but not so efficiently.

--

___
Python tracker 

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



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Marking this as release blocker.

--
priority: normal -> release blocker

___
Python tracker 

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



[issue46891] Crash in ModuleType subclass with __slots__

2022-03-02 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@Pablo: this is a possible release blocker, hard crash for code that works in 
earlier releases. 

That said, I have a workaround on my end and IMHO a fix could wait for the next 
alpha.

--
nosy: +pablogsal

___
Python tracker 

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



[issue46890] venv does not create "python" link in python 3.11

2022-03-02 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

> This is marked as a release blocker so I am holding the alpha release on 
> this. Is there anything we can do to unblock this issue?

I marked the issue as a release blocker because it must not end up in a beta 
release, its probably not worth it to hold up an alpha release for this.

--

___
Python tracker 

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



[issue46890] venv does not create "python" link in python 3.11

2022-03-02 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Again without diving deep I've constructed a test case that is probably 
relevant.  I've pasted the diff below because I'm not yet convinced that it is 
correct (in particular the value for "argv0". This would also require a second 
test case that does something similar for a venv when using a framework build 
(the test_venv_macos case seems to be for a regular install and not a framework 
install)

With this tests case I get a test failure that matches my observations:

test test_getpath failed -- Traceback (most recent call last):
  File "/Users/ronald/Projects/Forks/cpython/Lib/test/test_getpath.py", line 
444, in test_framework_python
self.assertEqual(expected, actual)
^^
AssertionError: {'exe[273 chars]/9.8/bin/python9.8', 'base_prefix': 
'/Library/[381 chars]ad']} != {'exe[273 
chars]/9.8/Resources/Python.app/Contents/MacOS/Pytho[410 chars]ad']}
  {'base_exec_prefix': '/Library/Frameworks/Python.framework/Versions/9.8',
-  'base_executable': 
'/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8',
?^^^ ^  
   - ^

+  'base_executable': 
'/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python',
?
^ ^  ^

   'base_prefix': '/Library/Frameworks/Python.framework/Versions/9.8',
   'exec_prefix': '/Library/Frameworks/Python.framework/Versions/9.8',
   'executable': 
'/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8',
   'module_search_paths': 
['/Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zip',
   
'/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8',
   
'/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload'],
   'module_search_paths_set': 1,
   'prefix': '/Library/Frameworks/Python.framework/Versions/9.8'}

test_getpath failed (1 failure)





The inline diff (and as mentioned before, I'm not sure if the value for "argv0" 
is correct):

%  git diff ../Lib/test/test_getpath.py 

(main)cpython
diff --git a/Lib/test/test_getpath.py b/Lib/test/test_getpath.py
index 3fb1b28003..69b469f179 100644
--- a/Lib/test/test_getpath.py
+++ b/Lib/test/test_getpath.py
@@ -414,6 +414,36 @@ def test_custom_platlibdir_posix(self):
 actual = getpath(ns, expected)
 self.assertEqual(expected, actual)
 
+def test_framework_python(self):
+""" Test framework layout on macOS """
+ns = MockPosixNamespace(
+os_name="darwin",
+
argv0="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python",
+PREFIX="/Library/Frameworks/Python.framework/Versions/9.8",
+
ENV___PYVENV_LAUNCHER__="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8",
+
real_executable="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python",
+)
+
ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python")
+
ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8")
+
ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload")
+expected = dict(
+
executable="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8",
+prefix="/Library/Frameworks/Python.framework/Versions/9.8",
+exec_prefix="/Library/Frameworks/Python.framework/Versions/9.8",
+
base_executable="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8",
+base_prefix="/Library/Frameworks/Python.framework/Versions/9.8",
+
base_exec_prefix="/Library/Frameworks/Python.framework/Versions/9.8",
+module_search_paths_set=1,
+module_search_paths=[
+
"/Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zip",
+
"/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8",
+
"/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload",
+],
+)
+actual = getpath(ns, expected)
+self.assertEqual(expected, actual)
+
+


I may work on a PR later this week, but can't promise anything. My energy level 
is fairly low at the moment (for various reasons).

BTW. The code in getpath.py, and tests, also don't seem to handle different 
values for PYTHONFRAMEWORK, I sometimes use that to have a debug framework 
install next to a regular install.  I'll file a separate bug for that when I 
get around to testing this.

--


[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This was fixed in 3.10.0 if I am not mistaken. Could you provide a reproducer, 
please?

--

___
Python tracker 

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



[issue46756] Incorrect authorization check in urllib.request

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I'm closing this, please reopen if something is missing.

--
priority: release blocker -> 
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



[issue46756] Incorrect authorization check in urllib.request

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 1c9701a3de0566c085e03dddc14a8508aaae349e by Miss Islington (bot) 
in branch '3.8':
bpo-46756: Fix authorization check in urllib.request (GH-31353) (GH-31572)
https://github.com/python/cpython/commit/1c9701a3de0566c085e03dddc14a8508aaae349e


--

___
Python tracker 

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



[issue46756] Incorrect authorization check in urllib.request

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Is something left here, it seems that most PRs are landed

--

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is marked as a release blocker so I am holding the alpha release on this. 
Is there anything we can do to unblock this issue?

--
nosy: +pablogsal

___
Python tracker 

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



[issue46890] venv does not create "python" link in python 3.11

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is marked as a release blocker so I am holding the alpha release on this. 
Is there anything we can do to unblock this issue?

--
nosy: +pablogsal

___
Python tracker 

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



[issue46756] Incorrect authorization check in urllib.request

2022-03-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is marked as a release blocker so I am holding the alpha release on this. 
Is there anything we can do to unblock this issue?

--

___
Python tracker 

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



[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2022-03-02 Thread Peter Roelants


Peter Roelants  added the comment:

If I understand correctly this should be fixed? In which 3.10.* version should 
this be fixed?

The reason why I'm asking is that I ran into this issue when using Dask 
(2022.02.0) with multithreading on Python 3.10.2:

Exception in thread Profile:
Traceback (most recent call last):
  File "./lib/python3.10/site-packages/distributed/profile.py", line 115, in 
process
d = state["children"][ident]
KeyError: '_all_objs;./lib/python3.10/site-packages/bokeh/embed/bundle.py;357'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./lib/python3.10/threading.py", line 1009, in _bootstrap_inner
self.run()
  File "./lib/python3.10/threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
  File "./lib/python3.10/site-packages/distributed/profile.py", line 274, in 
_watch
process(frame, None, recent, omit=omit)
  File "./lib/python3.10/site-packages/distributed/profile.py", line 119, in 
process
"description": info_frame(frame),
  File "./lib/python3.10/site-packages/distributed/profile.py", line 72, in 
info_frame
line = linecache.getline(co.co_filename, frame.f_lineno, 
frame.f_globals).lstrip()
  File "./lib/python3.10/linecache.py", line 31, in getline
if 1 <= lineno <= len(lines):
TypeError: '<=' not supported between instances of 'int' and 'NoneType'

--
nosy: +peter.roelants
versions: +Python 3.10 -Python 3.11

___
Python tracker 

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



[issue46870] Improper Input Validation in urlparse

2022-03-02 Thread Pocas


Pocas  added the comment:

Nice Check. So what do you think about this issue? I want to hear your opinions.

--

___
Python tracker 

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



[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-03-02 Thread Mark Shannon


Mark Shannon  added the comment:

I've outlined the requirements for a frame stack API at 
https://github.com/faster-cpython/ideas/issues/309.

The problem with adding an API for PyFrameObject (beyond simple getters) is 
that it makes assumptions about the frame stack that aren't valid.

A stack of frames is not just a linked list of frames. It never was, and it 
certainly isn't now.

--

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-02 Thread neonene


neonene  added the comment:

UNPACK_SEQUENCE's slowdown is already filed?

https://speed.python.org/timeline/#/?exe=12=unpack_sequence=4=50=off=on=on

I hit the gap at 424ecab on Windows.

--
nosy: +neonene

___
Python tracker 

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



[issue46848] Use optimized string search function in mmap.find()

2022-03-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b6b711a1aa233001c1874af1d920e459b6bf962c by Victor Stinner in 
branch 'main':
bpo-46848: Move _PyBytes_Find() to internal C API (GH-31642)
https://github.com/python/cpython/commit/b6b711a1aa233001c1874af1d920e459b6bf962c


--

___
Python tracker 

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



[issue46890] venv does not create "python" link in python 3.11

2022-03-02 Thread Ned Deily


Ned Deily  added the comment:

To reiterate, the example I gave had nothing to do with using a venv. The value 
of sys._base_executable is now always wrong whether or not using a venv. The 
consequences are more obvious when using a venv.

--

___
Python tracker 

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



[issue46863] Python 3.10 OpenSSL Configuration Issues

2022-03-02 Thread Christian Heimes


Christian Heimes  added the comment:

pyenv uses default value for ./configure --with-ssl-default-suites. You have to 
use --with-ssl-default-suites=openssl so your build uses the system's crypto 
policy correctly.

--

___
Python tracker 

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



[issue46888] SharedMemory.close() destroys memory

2022-03-02 Thread Eryk Sun


Eryk Sun  added the comment:

Putting words into action, here's an example of what a privileged process (e.g. 
running as SYSTEM) can do if a script or application is written to call the 
undocumented NT API function NtMakePermanentObject(). A use case would be a 
script running as a system service that needs a shared-memory section object to 
persist after the service is stopped or terminated, e.g. such that the section 
is still accessible if the service is resumed. Anyway, this is just an example 
of what's possible, from a technical perspective. Also, note that I granted 
SeCreatePermanentPrivilege to my current user for this example, so it's 
certainly not required to use the SYSTEM account. An administrator can grant 
this privilege to any account.

By default, named kernel objects are temporary:

>>> import os, _winapi, ctypes
>>> from multiprocessing.shared_memory import SharedMemory
>>> name = f'spam_{os.getpid()}'
>>> m = SharedMemory(name, True, 8192)
>>> m.close()
>>> try: SharedMemory(name)
... except OSError as e: print(e)
...
[WinError 2] The system cannot find the file specified: 'spam_6592'

Global permanent example:

Enable privileges for the current thread:

>>> import win32api; from win32security import *
>>> ImpersonateSelf(SecurityImpersonation)
>>> da = TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES
>>> ht = OpenThreadToken(win32api.GetCurrentThread(), da, False)
>>> ps = [[0, SE_PRIVILEGE_ENABLED], [0, SE_PRIVILEGE_ENABLED]]
>>> ps[0][0] = LookupPrivilegeValue(None, 'SeCreatePermanentPrivilege')
>>> ps[1][0] = LookupPrivilegeValue(None, 'SeCreateGlobalPrivilege')
>>> AdjustTokenPrivileges(ht, False, ps)
((16, 0),)

Create a global section object, and make it permanent:

>>> name = rf'Global\spam_{os.getpid()}'
>>> m = SharedMemory(name, True, 8192)
>>> from win32con import DELETE
>>> h = _winapi.OpenFileMapping(DELETE, False, name)
>>> ntdll = ctypes.WinDLL('ntdll')
>>> ntdll.NtMakePermanentObject(h)
0
>>> _winapi.CloseHandle(h)

A permanent object persists after the last handle is closed:

>>> m.close()
>>> m = SharedMemory(name) # This works now.

Make the section object temporary again:

>>> h = _winapi.OpenFileMapping(DELETE, False, name)
>>> ntdll.NtMakeTemporaryObject(h)
0
>>> _winapi.CloseHandle(h)
>>> m.close()
>>> try: SharedMemory(name)
... except OSError as e: print(e)
...
[WinError 2] The system cannot find the file specified: 'Global\\spam_6592'

--

___
Python tracker 

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



[issue46888] SharedMemory.close() destroys memory

2022-03-02 Thread Steve Dower


Steve Dower  added the comment:

Eryk's post is useful background information, but not helpful for this 
particular case ;)

>From Windows's POV, there is no "creating" process of the shared memory. If 
>it's going away, it's because none of the other processes are not keeping it 
>open - simple refcounting. That may be knowledge you can use to work around it.

Alternatively, the workaround I suggested in my first post could also help. If 
the multiprocessing SharedMemory object is critical, you need the extra steps, 
but if all the processes can receive a filesystem path instead of however 
they're getting the reference today, you can use a real file with mmap to 
achieve exactly the same thing. (All that's missing is that SharedMemory won't 
take an open file object or a path, which is reasonable, but not helpful right 
here.)

Switching this to a documentation bug: we should clarify that unlink() has no 
effect on Windows and shared memory blocks go away when the last SharedMemory 
object is close()d.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.11, Python 3.9

___
Python tracker 

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



  1   2   >