[issue46012] unittest AsyncConnection not described

2021-12-07 Thread David Shiko


New submission from David Shiko :

AsyncConnection mentioned only one at this docs but not imported or presented 
somehow else.
https://docs.python.org/3/library/unittest.html.

--
components: Tests
messages: 408000
nosy: dsb321mp
priority: normal
severity: normal
status: open
title: unittest AsyncConnection not described
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



[issue46002] py Launcher for Windows with MSYS2

2021-12-07 Thread Eryk Sun


Eryk Sun  added the comment:

You can use "#!python", or "#!/usr/bin/python", or "#!/usr/local/bin/python". 
They're all equivalent, and they do not search PATH. Since no wanted version is 
specified, the launcher will look for a version to run in the following order: 
an active virtual environment, a configured PY_PYTHON version, the highest 
registered version of 2.x, and the highest registered version of 3.x.

--

___
Python tracker 

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



[issue46002] py Launcher for Windows with MSYS2

2021-12-07 Thread Zernoxi


Zernoxi  added the comment:

Is there a way to not parse certain paths in the PATH environment variable for 
the shebang: "#!/usr/bin/env python". I get that it is trying to mimic Unix 
"env" function but is it not conflicting if there is a python install but it is 
not registered in registry?

--

___
Python tracker 

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



[issue46011] Python 3.10 email returns invalid Date: header unchanged.

2021-12-07 Thread Mark Sapiro


New submission from Mark Sapiro :

Here is an interactive Python session
```
Python 3.10.1 (main, Dec  7 2021, 15:44:39) [GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from email import message_from_bytes, policy
>>> msg_raw = b"""Return-Path: 
... Delivered-To: mailman-us...@dinsdale.python.org
... From: u...@example.com
... Message-Id: 
... Date: Tue, 30 Nov 1999 23:56:33 -3000 (CST)
... To: mailman-us...@python.org
... 
... msg1
... """
>>> message = message_from_bytes(msg_raw, policy=policy.default)
>>> message.get('date')
'Tue, 30 Nov 1999 23:56:33 -3000 (CST)'
>>> message.defects
[]
>>> 
```
The same session in Python 3.9 throws ValueError: offset must be a timedelta 
strictly between -timedelta(hours=24) and timedelta(hours=24), not 
datetime.timedelta(days=-2, seconds=64800).

At first I thought this was related to https://bugs.python.org/issue30681 but 
that seems to not be the case as utils.parsedate_to_datetime('Tue, 30 Nov 1999 
23:56:33 -3000 (CST)') throws the same exception In Python 3.10.1.

I think getting the Date: header which has an invalid timezone should either 
throw the exception as before or return None, but not return the invalid date 
header.

--
components: email
keywords: 3.10regression
messages: 407997
nosy: barry, msapiro, r.david.murray
priority: normal
severity: normal
status: open
title: Python 3.10 email returns invalid Date: header unchanged.
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



[issue31184] Fix data descriptor detection in inspect.getattr_static

2021-12-07 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I guess here ``obj`` was supposed to be ``a``.

Okay, I updated the variable name to match the rest of the example.

> But is the description correct when it comes to what class is used where?

It looks fine to me.  It is harmonious with the other three entries in the 
section and every part of the wording is verified in the test code.

> It should be:

Sorry, I disagree with the wordsmithing.  IMO, the additional proposed wording 
mostly makes it harder to read.  Also, this section is already a bit long. The 
details on super() are in the main docs for super().  Here we just want to show 
that super() is one of the four ways to invoke a descriptor.

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



[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 4b1cfc1f30327e76a2d845cc274be56b34b1 by Raymond Hettinger in 
branch 'main':
bpo-20751: Match variable name to the example. (GH-29980)
https://github.com/python/cpython/commit/4b1cfc1f30327e76a2d845cc274be56b34b1


--

___
Python tracker 

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



[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-07 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-12-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset b0b30862796e97b3f0ee358bcc61d21f0cc98441 by Steve Dower in branch 
'main':
bpo-45582: Write empty pybuilddir.txt on Windows to allow relocatable build 
directories (GH-29979)
https://github.com/python/cpython/commit/b0b30862796e97b3f0ee358bcc61d21f0cc98441


--

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Eric Snow  added the comment:

At this point all the changes I was considering have been made, except for 
splitting type/object init into logical phases.  That may or may not happen.  
Regardless, it can be done in a new issue.

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Eric Snow  added the comment:


New changeset 32a67246b0d1e08cd50fc3bfa58052cfeb515b2e by Eric Snow in branch 
'main':
bpo-46008: Move Py*State init into distinct functions. (gh-29977)
https://github.com/python/cpython/commit/32a67246b0d1e08cd50fc3bfa58052cfeb515b2e


--

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Eric Snow  added the comment:


New changeset 758b74e71eb22e1e83a9eb937d1c015e461745a1 by Eric Snow in branch 
'main':
bpo-46008: Add _PyInterpreterState_Main(). (gh-29978)
https://github.com/python/cpython/commit/758b74e71eb22e1e83a9eb937d1c015e461745a1


--

___
Python tracker 

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



[issue45995] string formatting: normalize negative zero

2021-12-07 Thread John Belmonte


John Belmonte  added the comment:

I'll share a draft PR soon (excluding Decimal), so far it's still looking 
straightforward.

> Maybe old versions would correctly ignore the new bit being set.

That's one of the benefits of using bit flags in an ABI: backward-compatible 
extensibility.  (An implementation can defeat it by intentionally failing if 
unknown bits are encountered, but the code in question doesn't appear to be 
doing this.)

> You can round explicitly before formatting
>
>>>> '%5.1f' % (round(-.1, 1) + 0.0)

Yes, I have experience with it.

  1. even as a one-off, it's questionable.  If someone accidentally changes the 
precision in only one of the spec string or round call, that's a bug.
  2. since applications and libraries may pass around format specs, and because 
of (1), you'll try to make a programmatic solution.  Now you're parsing format 
spec strings.
  3. while a programmatic solution can be done for a function API like format() 
that takes a separate spec and value, there is no sane way to wrap f-strings

--

___
Python tracker 

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



[issue21762] update the import machinery to only use __spec__

2021-12-07 Thread Brett Cannon


Change by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-12-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +28205
pull_request: https://github.com/python/cpython/pull/29979

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +28204
pull_request: https://github.com/python/cpython/pull/29978

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +28203
pull_request: https://github.com/python/cpython/pull/29977

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Eric Snow  added the comment:


New changeset 1f384e318481532323bb9076f4447bc02da07209 by Eric Snow in branch 
'main':
bpo-46008: Stop calling _PyThreadState_Init() in new_threadstate(). (gh-29973)
https://github.com/python/cpython/commit/1f384e318481532323bb9076f4447bc02da07209


--

___
Python tracker 

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



[issue42114] Documentation of ctypes.CDLL does not correspond to code

2021-12-07 Thread Louis Sautier


Change by Louis Sautier :


--
keywords: +patch
nosy: +sbraz
nosy_count: 1.0 -> 2.0
pull_requests: +28202
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29976

___
Python tracker 

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



[issue34434] Removal of kwargs for built-in types not covered with "changed in Python" note in documentation

2021-12-07 Thread Louis Sautier


Change by Louis Sautier :


--
nosy: +sbraz
nosy_count: 7.0 -> 8.0
pull_requests: +28201
pull_request: https://github.com/python/cpython/pull/29976

___
Python tracker 

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



[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Unfortunately, this has not been fixed into 3.10.1 and 3.11.0a3 as this hasn't 
version information and therefore has missed our automatic checks for blockers.

I have marked https://bugs.python.org/issue46009? as release blocker, as well 
as this issue and I have marked the versions.

Please, ensure this is fixed ASAP so it doesn't go into the next bugfix release 
or alpha release.

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



[issue46009] sending non-None values makes generator raise StopIteration on next access

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue46009] sending non-None values makes generator raise StopIteration on next access

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-12-07 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

bpo-46009 about the same behavior change

--

___
Python tracker 

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



[issue45415] Assert oparg < INSTR_OFFSET()

2021-12-07 Thread Steve Dower


Steve Dower  added the comment:

Yes, it's been fixed.

The debate about whether to test in CI with C assertions enabled or not can 
continue somewhere else.

--
resolution:  -> fixed
stage: test needed -> 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



[issue31184] Fix data descriptor detection in inspect.getattr_static

2021-12-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Can you give an example of where getattr_static() is not doing what you expect?

--
assignee:  -> rhettinger
components: +Library (Lib)
nosy: +rhettinger
type:  -> behavior
versions:  -Python 3.10, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 
3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue45415] Assert oparg < INSTR_OFFSET()

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Ping. This issue is marked as release blocker, is something left here?

--

___
Python tracker 

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



[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Mark, is something left in 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



[issue43137] webbrowser to support "gio open "

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Christian, this is going into 3.11.0a3 unfortunately. I will make this a 
blocker for future alphas, so please, take any action that you think is 
required.

--

___
Python tracker 

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



[issue45618] Documentation builds fail with Sphinx 3.2.1

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
status: open -> closed

___
Python tracker 

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



[issue45963] Embed interpreter frame in generator.

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue45963] Embed interpreter frame in generator.

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: release blocker -> 

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: release blocker -> 

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-07 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Quoting msg407949:
> [...] We should do something like
>
>   ZLIB_CFLAGS=${ZLIB_CFLAGS:-""}
>   ZLIB_LIBS=${ZLIB_LIBS:-"-lz"}
>
> for all env vars.

I think we should use ${VAR-default} instead of ${VAR:-default}; we only want 
to override if the variable is _not_ set:

$ TEST=
$ echo ${TEST-default}

$ echo ${TEST:-default}
default
$ unset TEST
$ echo ${TEST-default} 
default
$ echo ${TEST:-default}
default


> I prefer the syntax over ${ZLIB_CFLAGS:=""} because it is more obvious what
> is happening.

I agree. I also prefer `TEST=${TEST-""}` to `TEST=${TEST-}` for empty strings.

--

___
Python tracker 

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



[issue29944] Argumentless super() fails in classes constructed with type()

2021-12-07 Thread Caleb Donovick


Change by Caleb Donovick :


--
nosy: +donovick

___
Python tracker 

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



[issue46010] Cookie cutter templates to allow variable fields and data transfer proposal before system merge

2021-12-07 Thread Francisco Orozco


New submission from Francisco Orozco :

Not featuring templates to allow variable fields and data record creation when 
converting projects to new platform projects for purpose to confirm, verify 
record creation, might be helpful, in addition of only viewing/editing project 
development and structure.

For purpose of data analysis, future data merging, data financial reservations 
or data eligibility or feasibility or recalls.

--
components: Build
messages: 407980
nosy: Francisco
priority: normal
severity: normal
status: open
title: Cookie cutter templates to allow variable fields and data transfer 
proposal before system merge
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue1653457] Python misbehaves when installed in / (patch attached)

2021-12-07 Thread Chris Webb


Chris Webb  added the comment:

Irit Katriel  added the comment:

> getpath.c has been rewritten (see Issue45582).  reduce is no longer there.

Gosh, this is one I originally reported back in the late 1990s and then  
again mid-2000s! I've carried a patch in my distribution to make python  
work in /bin and /lib/python for over 25 years - it'll feel like end of an  
era to finally be able to drop that local patch. Thanks!

(Presumably this will land in Python 11 rather than get backported?)

Best wishes,
Chris.

--

___
Python tracker 

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



[issue33411] All console message are in the error output in bash interpretor

2021-12-07 Thread Eryk Sun


Eryk Sun  added the comment:

PyOS_Readline() calls PyOS_StdioReadline() if sys_stdin or sys_stdout isn't a 
tty file. This function always writes the prompt to stderr, as follows:

if (prompt) {
fprintf(stderr, "%s", prompt);
}
fflush(stderr);

Maybe this matched the behavior of the readline module and/or GNU Readline in 
the past. It's definitely *not* the case in Linux with Python 2.x or 3.x with 
readline linked to "libreadline.so.8". In this case, the prompt gets written to 
stdout. For example:

$ python -q 2>err.txt
>>> import a
>>> $ 
$ cat err.txt
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'a'

In Windows, OTOH, the readline module isn't available in the standard library, 
in which case PyOS_StdioReadline() is called. For the io._WindowsConsoleIO 
update in 3.6, this function was modified to use ReadConsoleW() and 
WriteConsoleW() instead of my_fgets(). But I think modifying 
PyOS_StdioReadline() was a mistake. The changes should have been implemented as 
a new hook for PyOS_ReadlineFunctionPointer. This should have used stdout for 
the prompt instead of stderr, normalizing the behavior with interactive 
readline on other platforms. Whether or not stderr is redirected to a file or 
pipe should make no difference on the behavior.

--
nosy: +eryksun
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue1653457] Python misbehaves when installed in / (patch attached)

2021-12-07 Thread Irit Katriel


Irit Katriel  added the comment:

getpath.c has been rewritten (see Issue45582).  reduce is no longer there.

--
nosy: +iritkatriel
resolution:  -> out of date
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



[issue31184] Fix data descriptor detection in inspect.getattr_static

2021-12-07 Thread David Halter


David Halter  added the comment:

This is not a duplicate. It is related to https://bugs.python.org/issue26103, 
because __get__ is not required anymore for an object to be a data descriptor. 
The current code on master (of inspect.getattr_static) still thinks a 
descriptor has both __get__ and __set__ set.

Since issue #26103 has been fixed, it's now clear that my patch is slightly 
wrong, but I'm happy to fix that if someone is actually going to review it.

--
resolution: duplicate -> 
status: closed -> open
versions: +Python 3.10, Python 3.11, 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



[issue46009] sending non-None values makes generator raise StopIteration on next access

2021-12-07 Thread Stanislav Syekirin


New submission from Stanislav Syekirin :

Tested with Python 3.10.1 on Linux and Python 3.10.0 on Windows.

The following code prints None in 3.9 and raises StopIteration without any 
additional information in 3.10:

def f():
yield

x = f()

try:
x.send(0)
except TypeError as e:
print(e) # can't send non-None value to a just-started generator

print(next(x))

--
messages: 407975
nosy: Zabolekar
priority: normal
severity: normal
status: open
title: sending non-None values makes generator raise StopIteration on next 
access
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue46003] os.replace is not cross-platform: at least improve documentation

2021-12-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

As they say, there's no such thing as "portable software", only "software that 
has been ported". Especially in an area like file I/O: once you move beyond 
simple "one process opens, writes, and closes; and another process then opens, 
reads, and closes", there are a lot of platform-specific issues. Python does 
not try to abstract away all possible file I/O issues.

--

___
Python tracker 

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



[issue40222] "Zero cost" exception handling

2021-12-07 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +iritkatriel
nosy_count: 16.0 -> 17.0
pull_requests: +28199
pull_request: https://github.com/python/cpython/pull/29975

___
Python tracker 

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



[issue40222] "Zero cost" exception handling

2021-12-07 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +iritkatriel, iritkatriel
nosy_count: 16.0 -> 17.0
pull_requests: +28199, 28200
pull_request: https://github.com/python/cpython/pull/29975

___
Python tracker 

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



[issue45995] string formatting: normalize negative zero

2021-12-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

PyOS_double_to_string is part of the stable ABI. I don't recall if we're 
allowed to add new bitfield flags to a stable ABI function. We'd use a new 
Py_DTSF_NORMALIZE_NEGATIVE_0 flag for this feature.

I suspect we can't add a flag, due to comparability reasons (new code setting 
the flag being used in old versions of python without it), but we'd need to 
research. I saw a similar discussion within the last few years, but of course 
now I can't find it. Maybe old versions would correctly ignore the new bit 
being set.

This proposal becomes less interesting if we'd need to add a new function to 
support it. Although I guess we could do something that's internal-only.

--

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-12-07 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread miss-islington


miss-islington  added the comment:


New changeset 9b577cd01f66512b503115c0fdbf0734edfd5f8a by Eric Snow in branch 
'main':
bpo-46008: Use PyMem_RawCalloc() to allocate PyThreadState. (GH-29972)
https://github.com/python/cpython/commit/9b577cd01f66512b503115c0fdbf0734edfd5f8a


--
nosy: +miss-islington

___
Python tracker 

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



[issue43098] tarfile list() method does not show file type

2021-12-07 Thread Val Shkolnikov


Val Shkolnikov  added the comment:

> contributions are only now accepted in form of github PRs
Done

--

___
Python tracker 

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



[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-07 Thread Jan Kaliszewski


Jan Kaliszewski  added the comment:

I am very sorry, I just noticed another mistake.

It should be:

   A dotted lookup such as ``super(A, obj).x`` (where ``obj``
   is an instance of ``A`` or of a subclass of ``A``) searches
   ``type(obj).__mro__`` for such a base class ``B`` that follows
   ``A`` and whose :attr:`__dict__` contains the name ``"x"``;
   then ``B.__dict__['x'].__get__(obj, type(obj))`` is returned.
   If not a descriptor, ``B.__dict__['x']`` is returned unchanged.

--

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Eric Snow  added the comment:


New changeset 313f92a57bc3887026ec16adb536bb2b7580ce47 by Eric Snow in branch 
'main':
bpo-46008: Move thread-related interpreter state into a sub-struct. (gh-29971)
https://github.com/python/cpython/commit/313f92a57bc3887026ec16adb536bb2b7580ce47


--

___
Python tracker 

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



[issue17975] altinstall should not install libpython3.so (conflict between multiple $VERSIONs)

2021-12-07 Thread Irit Katriel


Irit Katriel  added the comment:

The discussion here seems to have been abandoned 7 years ago after Martin asked 
Patrick to clarify the issue. I will close this soon if nobody will explain 
what is left to be done.

--
nosy: +iritkatriel
resolution:  -> wont fix
status: open -> pending

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Eric Snow  added the comment:


New changeset 8262c96bcc1841188866c1b022d9087e89639d98 by Eric Snow in branch 
'main':
bpo-46008: Return void from _PyEval_InitState(). (gh-29970)
https://github.com/python/cpython/commit/8262c96bcc1841188866c1b022d9087e89639d98


--

___
Python tracker 

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



[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-07 Thread Jan Kaliszewski


Jan Kaliszewski  added the comment:

Sorry, a few mistakes distorted my proposal. It should be:

   A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an
   instance of ``A`` or of a subclass of ``A``) searches ``A.__mro__``
   for a base class whose `__dict__` contains name ``"x"``, and
   then returns ``B.__dict__['x'].__get__(obj, type(obj))`` (where
   ``B`` is that base class).  If ``B.__dict__['x']`` is not a
   descriptor, it is returned unchanged.

--

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +28198
pull_request: https://github.com/python/cpython/pull/29973

___
Python tracker 

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



[issue20751] Harmonize descriptor protocol documentation: direct call, super binding with Descriptor Howto docs

2021-12-07 Thread Jan Kaliszewski


Jan Kaliszewski  added the comment:

So the current (after the aforementioned commit) form of the description is:

   A dotted lookup such as ``super(A, a).x`` searches
   ``obj.__class__.__mro__`` for a base class ``B`` following ``A`` and then
   returns ``B.__dict__['x'].__get__(a, A)``.  If not a descriptor, ``x`` is
   returned unchanged.

I guess here ``obj`` was supposed to be ``a``.

But is the description correct when it comes to what class is used where?
I.e., shouldn't it be rather something along the lines of the following:

   A dotted lookup such as ``super(A, obj).x`` (where ``obj`` is an
   instance of ``A`` of some other subclass of ``A``) searches
   ``A.__mro__`` for a base class ``B`` whose `__dict__` contains name
   ``"x"`` and then returns ``B.__dict__['x'].__get__(obj, type(obj))``.
   If ``B.__dict__['x']`` is not a descriptor, it is returned unchanged.

***

Ad my comment #2 -- yes, it became groundless with time... Minor explanation: 
when I reported this issue in 2015, the signature of `object.__get__` was 
documented just as "__get__(self, instance, owner)" (see: 
https://docs.python.org/3.5/reference/datamodel.html#implementing-descriptors); 
that's why I wrote about an inconsistency.

--
status: closed -> open

___
Python tracker 

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



[issue33411] All console message are in the error output in bash interpretor

2021-12-07 Thread Irit Katriel


Irit Katriel  added the comment:

I think the question here is why this went to stderr rather than stdout:

Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +28197
pull_request: https://github.com/python/cpython/pull/29972

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +28196
pull_request: https://github.com/python/cpython/pull/29971

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


Change by Eric Snow :


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

___
Python tracker 

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



[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-07 Thread Eric Snow


New submission from Eric Snow :

There are a few things in `_PyRuntimeState`, `PyInterpreterState`, 
`PyThreadState`, and there initialization (Python/pystate.c & 
Python/pylifecycle.c) that would benefit from some minor cleanup.  Normally I 
wouldn't bother (due to the cost of churn), but such cleanup would help with 
other changes I'm working on.

The cleanup includes:

* move thread related interpreter state to `PyInterpreterState.threads`
* return void from `_PyEval_InitState()`
* separate Py*State initialization from creation
* distinguish between initialized-to-safe-state and ready-to-use
* separate init for global types/objects into phases: object state vs. global 
objects vs. global types

--
assignee: eric.snow
components: Interpreter Core
messages: 407963
nosy: eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: Prepare runtime/interp/thread state and init for upcoming changes.
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



[issue36850] shutil.copy2 fails with even with source network filesystem not supporting extended attributes

2021-12-07 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-07 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 91b59a3fcdcb93d74bb89cce536f11d2990f655d by Christian Heimes in 
branch 'main':
bpo-45847: Revert Port _ctypes partly to PY_STDLIB_MOD (GH-29747) (GH-29969)
https://github.com/python/cpython/commit/91b59a3fcdcb93d74bb89cce536f11d2990f655d


--

___
Python tracker 

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



[issue46003] os.replace is not cross-platform: at least improve documentation

2021-12-07 Thread nobody


nobody  added the comment:

Thank you for your replies. I have been reading more and conclude that I/O 
programming on Windows and Linux are two different things.

Python is not cross-platform in the sense that a Python program always works on 
different operating systems but that you can make it work on different 
operating systems (most of the time).

My application uses the PyPi package cachelib. The file system interface is 
implemented in this file:

https://github.com/pallets/cachelib/blob/main/src/cachelib/file.py

This package uses os.replace and other file I/O methods. 

>From what I understand is that this package must be modified to also handle 
>WinError 5 and Errno 13 if you want to use it on Windows,
meaning more specific exception handling and adding retries and a delay for 
every I/O related function accessing the os.replace file.

Please correct me if I am wrong.

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-07 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28194
pull_request: https://github.com/python/cpython/pull/29969

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-12-07 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 06c4ae8b1380eec1c5f3cd8faa21102d1c940bab by Christian Heimes in 
branch 'main':
bpo-45582: Fix framework path and bootstrap build (GH-29954)
https://github.com/python/cpython/commit/06c4ae8b1380eec1c5f3cd8faa21102d1c940bab


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I may need to revert this commit to unblock the release if no one can take a 
look today

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

After PR29747, some buildbots are failing:

https://buildbot.python.org/all/#/builders/58/builds/1217

for example:

```
0:35:41 load avg: 3.70 Re-running failed tests in verbose mode
0:35:41 load avg: 3.70 Re-running test_code in verbose mode
test_bad_index (test.test_code.CoExtra) ... ok
test_free_called (test.test_code.CoExtra) ... Fatal Python error: Illegal 
instruction
Current thread 0xb7bd4700 (most recent call first):
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_code.py",
 line 575 in test_free_called
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py",
 line 547 in _callTestMethod
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py",
 line 591 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py",
 line 646 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/runner.py",
 line 197 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/support/__init__.py",
 line 1009 in _run_suite
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/support/__init__.py",
 line 1135 in run_unittest
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py",
 line 273 in _test_module
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py",
 line 309 in _runtest_inner2
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py",
 line 352 in _runtest_inner
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py",
 line 227 in _runtest
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py",
 line 257 in runtest
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py",
 line 337 in rerun_failed_tests
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py",
 line 715 in _main
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py",
 line 658 in main
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py",
 line 736 in main
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/__main__.py",
 line 2 in 
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/runpy.py", 
line 86 in _run_code
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/runpy.py", 
line 196 in _run_module_as_main
```

unfortunately, this is blocking the release of Python 3.11 :(

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



[issue22910] test_pydoc test_synopsis_sourceless is a flaky test

2021-12-07 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue27062] `inspect` doesn't have `__all__`

2021-12-07 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue45986] 3.10.0 ships with older tcl/tk DLLs than 3.9.9 causing Windows Installer problems

2021-12-07 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue23469] Delete Misc/*.wpr files

2021-12-07 Thread Berker Peksag


Change by Berker Peksag :


--
stage: resolved -> 
status: closed -> open
versions: +Python 3.11 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-07 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28193
pull_request: https://github.com/python/cpython/pull/29968

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-07 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28192
pull_request: https://github.com/python/cpython/pull/29967

___
Python tracker 

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



[issue45999] Links to packaging broken

2021-12-07 Thread Ned Deily


Ned Deily  added the comment:

Perhaps I'm misunderstanding to which links you are referring but I am not 
seeing any broken links in that section at the moment. Could you retry and, if 
so, list exactly which links do not work for you?

--
nosy: +ned.deily
status: open -> pending

___
Python tracker 

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



[issue17780] the test suite should use a TEMPDIR in the build directory, not the source directory

2021-12-07 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> TEST_DATA_DIR for out-of-tree builds

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-07 Thread STINNER Victor


STINNER Victor  added the comment:

There are around 27 _PyUnicode_EqualToASCIIId() calls in the Python code base. 
I don't think that avoiding _PyUnicode_EqualToASCIIId() is a good solution :-)

Fixing _PyUnicode_EqualToASCIIId() to make it compatible with subinterpreters 
sound more reasonable: remove the PyUnicode_CHECK_INTERNED() test optimization.

--

___
Python tracker 

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



[issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API

2021-12-07 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +petr.viktorin

___
Python tracker 

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



[issue46007] [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API

2021-12-07 Thread STINNER Victor


New submission from STINNER Victor :

The PyUnicode_CHECK_INTERNED() macro uses the PyASCIIObject structure which is 
*excluded* from the limited C API:

/* Use only if you know it's a string */
#define PyUnicode_CHECK_INTERNED(op) \
(((PyASCIIObject *)(op))->state.interned)

Using this macro in the limited C API doesn't work.

I propose to remove it from the limited C API.

IMO it's not a good idea to fix the function in the limited C API by converting 
it to a regular function hiding the implementation details and so working at 
the ABI level. We should not expose such "implementation detail" (if a string 
is "interned or not") in the *limited* C API.

--
components: C API
messages: 407955
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] PyUnicode_CHECK_INTERNED() doesn't work in the limited C API
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue39465] [subinterpreters] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2021-12-07 Thread STINNER Victor


STINNER Victor  added the comment:

This change introduced a subtle regression: bpo-46006 "[subinterpreter] 
_PyUnicode_EqualToASCIIId() issue with subinterpreters".

--

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-07 Thread STINNER Victor


STINNER Victor  added the comment:

> Depending on how the stdlib abc.py file was loaded (in the main interpreter 
> and in the subinterpreter), __code__.co_freevars[0] may or may not be an 
> interned string.

When the bug occurs, I see that the Python stdlib abc.py file is loaded twice: 
the main interpreter builds a code object, and then subinterpreter builds its 
own code object: same content, but different Python object (at different memory 
addresses so inequal pointers!).

I modified reproducer.c to add "Py_VerboseFlag = 1;" before the Py_Initialize() 
call. Truncated output:
---
...
# code object from /opt/py310/lib/python3.10/abc.py
...
# code object from /opt/py310/lib/python3.10/abc.py
Traceback (most recent call last):
  File "", line 1027, in _find_and_load
...
RuntimeError: super(): __class__ cell not found
...
---

--

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-07 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy: Do you recall the idea of the PyUnicode_CHECK_INTERNED() optimization?

The PyUnicode_CHECK_INTERNED() test is as old as the 
_PyUnicode_EqualToASCIIId() function.

commit f5894dd646f5e39918377b37b8c8694cebdca103
Author: Serhiy Storchaka 
Date:   Wed Nov 16 15:40:39 2016 +0200

Issue #28701: Replace _PyUnicode_CompareWithId with 
_PyUnicode_EqualToASCIIId.

The latter function is more readable, faster and doesn't raise exceptions.

Based on patch by Xiang Zhang.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-07 Thread STINNER Victor


STINNER Victor  added the comment:

In Python 3.9, the code works because the _Py_IDENTIFIER() API shares Python 
Unicode objects between all interpreters.

_PyUnicode_FromId() was modified to be per-interpreter in bpo-39465 by:

New changeset ba3d67c2fb04a7842741b1b6da5d67f22c579f33 by Victor Stinner in 
branch 'master':
bpo-39465: Fix _PyUnicode_FromId() for subinterpreters (GH-20058)
https://github.com/python/cpython/commit/ba3d67c2fb04a7842741b1b6da5d67f22c579f33

--

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-07 Thread STINNER Victor


New submission from STINNER Victor :

_PyUnicode_EqualToASCIIId() seems to be incompatible with subinterpreter: it 
makes the assumption that if direct pointer comparison fails and the string is 
interned, the two strings are not equal.

--

super_init_without_args() of Objects/typeobject.c calls 
_PyUnicode_EqualToASCIIId(name, &PyId___class__) to test if the Unicode string 
'name' is equal to "__class__".

int
_PyUnicode_EqualToASCIIId(PyObject *left, _Py_Identifier *right)
{
right_uni = _PyUnicode_FromId(right);
...
if (left == right_uni)
return 1;
if (PyUnicode_CHECK_INTERNED(left))
return 0;
...
return unicode_compare_eq(left, right_uni);
}

_PyUnicode_EqualToASCIIId() makes the assumption that left and right are not 
equal if left and _PyUnicode_FromId(right) pointers are not equal and left is 
an interned string.

In the reproducer, left object is abc.ABCMeta.__new__.__code__.co_freevars[0].

Depending on how the stdlib abc.py file was loaded (in the main interpreter and 
in the subinterpreter), __code__.co_freevars[0] may or may not be an interned 
string.

If __code__.co_freevars[0] is an interned string, _PyUnicode_EqualToASCIIId() 
fails in a subinterpreter if the direct pointer comparison fails (if left and 
right_uni pointers are not equal).

--

Reproducer from: https://github.com/ninia/jep/issues/358#issuecomment-988090696

* Build Python 3.10 with "./configure --enable-shared --prefix /opt/py310" and 
install it.
* Download attached reproducer.c.
* Build the reproducer with: 
  gcc -o reproducer reproducer.c $(/opt/py310/bin/python3.10-config --embed 
--cflags --ldflags)
* Remove all stdlib .pyc files:
  find /opt/py310 -type d -name __pycache__|xargs rm -rf
* Run the reproducer with:
  LD_LIBRARY_PATH=/opt/py310/lib ./reproducer

Output:
---
Before creating sub interpreter
Traceback (most recent call last):
  File "/opt/py310/lib/python3.10/io.py", line 52, in 
  File "/opt/py310/lib/python3.10/abc.py", line 184, in 
  File "/opt/py310/lib/python3.10/abc.py", line 106, in __new__
RuntimeError: super(): __class__ cell not found
Fatal Python error: _PyThreadState_Delete: tstate 0x7f9f2001c710 is still 
current
Python runtime state: initialized

Current thread 0x7f9f27c99640 (most recent call first):
  
Abandon (core dumped)
---

py-bt command in gdb:
---
(gdb) py-bt
Traceback (most recent call first):
  File "/opt/py310/lib/python3.10/abc.py", line 106, in __new__
cls = super().__new__(mcls, name, bases, namespace, **kwargs)
  
  File "/opt/py310/lib/python3.10/abc.py", line 184, in 
class ABC(metaclass=ABCMeta):
  
  File "", line 241, in _call_with_frames_removed
  File "", line 883, in exec_module
  File "", line 688, in _load_unlocked
  File "", line 1006, in _find_and_load_unlocked
  File "", line 1027, in _find_and_load
  File "/opt/py310/lib/python3.10/io.py", line 52, in 
import abc
  
  File "", line 241, in _call_with_frames_removed
  File "", line 883, in exec_module
  File "", line 688, in _load_unlocked
  File "", line 1006, in _find_and_load_unlocked
  File "", line 1027, in _find_and_load
  
---

--
components: C API, Subinterpreters
files: reproducer.c
messages: 407950
nosy: corona10, erlendaasland, vstinner
priority: normal
severity: normal
status: open
title: [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters
versions: Python 3.10, Python 3.11
Added file: https://bugs.python.org/file50482/reproducer.c

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-12-07 Thread Christian Heimes


Christian Heimes  added the comment:

I just noticed that the PKG_CHECK_MODULES() fallbacks override the PKG_CONFIG 
environment variables. We should do something like

   ZLIB_CFLAGS=${ZLIB_CFLAGS:-""}
   ZLIB_LIBS=${ZLIB_LIBS:-"-lz"}

for all env vars. I prefer the syntax over ${ZLIB_CFLAGS:=""} because it is 
more obvious what is happening.

Env vars:

  LIBUUID_CFLAGS
  C compiler flags for LIBUUID, overriding pkg-config
  LIBUUID_LIBS
  linker flags for LIBUUID, overriding pkg-config
  LIBFFI_CFLAGS
  C compiler flags for LIBFFI, overriding pkg-config
  LIBFFI_LIBS linker flags for LIBFFI, overriding pkg-config
  LIBNSL_CFLAGS
  C compiler flags for LIBNSL, overriding pkg-config
  LIBNSL_LIBS linker flags for LIBNSL, overriding pkg-config
  LIBSQLITE3_CFLAGS
  C compiler flags for LIBSQLITE3, overriding pkg-config
  LIBSQLITE3_LIBS
  linker flags for LIBSQLITE3, overriding pkg-config
  GDBM_CFLAGS C compiler flags for gdbm
  GDBM_LIBS   additional linker flags for gdbm
  ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config
  ZLIB_LIBS   linker flags for ZLIB, overriding pkg-config
  BZIP2_CFLAGS
  C compiler flags for BZIP2, overriding pkg-config
  BZIP2_LIBS  linker flags for BZIP2, overriding pkg-config
  LIBLZMA_CFLAGS
  C compiler flags for LIBLZMA, overriding pkg-config
  LIBLZMA_LIBS
  linker flags for LIBLZMA, overriding pkg-config
  LIBCRYPT_CFLAGS
  C compiler flags for LIBCRYPT, overriding pkg-config
  LIBCRYPT_LIBS
  linker flags for LIBCRYPT, overriding pkg-config

--

___
Python tracker 

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



[issue19745] TEST_DATA_DIR for out-of-tree builds

2021-12-07 Thread Irit Katriel


Irit Katriel  added the comment:

It does seem to be used here: 

https://github.com/python/cpython/blob/a6c3b0faa1d55e36539caf19bd3bcf1dea12df84/Lib/test/support/__init__.py#L553

--
nosy: +iritkatriel

___
Python tracker 

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



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-07 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset d596acbd3b4f6716ed98895eb0b48e9830e0b320 by Irit Katriel in 
branch 'main':
bpo-45635: standardize error handling in traceback.c (GH-29905)
https://github.com/python/cpython/commit/d596acbd3b4f6716ed98895eb0b48e9830e0b320


--

___
Python tracker 

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



[issue23947] Add mechanism to import stdlib package bypassing user packages

2021-12-07 Thread Irit Katriel


Change by Irit Katriel :


--
type:  -> enhancement
versions: +Python 3.11 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue45947] Place dict (and values) pointers at a fixed (negative) offset from the base of the object.

2021-12-07 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 8319114feedd2a5b77378bba24eb9fb2689c5033 by Mark Shannon in 
branch 'main':
bpo-45947: Place dict and values pointer at fixed (negative) offset just before 
GC header. (GH-29879)
https://github.com/python/cpython/commit/8319114feedd2a5b77378bba24eb9fb2689c5033


--

___
Python tracker 

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread miss-islington


miss-islington  added the comment:


New changeset db42809d299d1bc3a07b29fabe8f74fa02a7e59e by Miss Islington (bot) 
in branch '3.9':
bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963)
https://github.com/python/cpython/commit/db42809d299d1bc3a07b29fabe8f74fa02a7e59e


--

___
Python tracker 

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread miss-islington


miss-islington  added the comment:


New changeset 14f03ce6e8a33cc8b45f11c4d428193fc7c4a145 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-35821: Fix restructuredtext code formatting in logging.rst 
(GH-29963) (GH-29965)
https://github.com/python/cpython/commit/14f03ce6e8a33cc8b45f11c4d428193fc7c4a145


--

___
Python tracker 

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



[issue25726] [doc] sys.setprofile / sys.getprofile asymetry

2021-12-07 Thread Irit Katriel


Change by Irit Katriel :


--
title: sys.setprofile / sys.getprofile asymetry -> [doc] sys.setprofile / 
sys.getprofile asymetry
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4

___
Python tracker 

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread Ken Jin


Ken Jin  added the comment:


New changeset c7e7a4b969b5728d4b4f3c59bf98e1e830d5c6d6 by Ken Jin in branch 
'main':
bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963)
https://github.com/python/cpython/commit/c7e7a4b969b5728d4b4f3c59bf98e1e830d5c6d6


--

___
Python tracker 

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28191
pull_request: https://github.com/python/cpython/pull/29966

___
Python tracker 

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28190
pull_request: https://github.com/python/cpython/pull/29965

___
Python tracker 

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



[issue46004] Incorrect bad token identified in 3.10.1

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>From 
> (https://friendly-traceback.github.io/docs/syntax_tracebacks_en_3.10.html#for-loop-missing-in-operator),
>  this is what was shown for Python 3.10.0

Yeah, we are not showing that anymore as we only trigger the error when it 
happens inside collections to avoid many of the false positives we were seeing.

This PR fixes the problem to point to the correct token, but still show "syntax 
error"

--

___
Python tracker 

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



[issue46004] Incorrect bad token identified in 3.10.1

2021-12-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue46004] Incorrect bad token identified in 3.10.1

2021-12-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c52141200364898818956a73b955f7c04f634dc8 by Pablo Galindo Salgado 
in branch '3.10':
[3.10] bpo-46004: Fix error location for loops with invalid targets (GH-29959). 
(GH-29961)
https://github.com/python/cpython/commit/c52141200364898818956a73b955f7c04f634dc8


--

___
Python tracker 

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



[issue24393] Test urllib2_localnet fails depending on host proxy configuration

2021-12-07 Thread Irit Katriel


Irit Katriel  added the comment:

I'm closing this as there was no activity for 6 years and 3.5 is no longer 
maintained. Furthermore, it's not clear what problem the patch trying to solve. 
If this problem still exists on current versions (>= 3.9), please create a new 
issue and explain in more detail the scenario in which you had a problem with 
this test.

--
nosy: +iritkatriel
resolution:  -> out of date
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



[issue26120] pydoc: move __future__ imports out of the DATA block

2021-12-07 Thread Vedran Čačić

Vedran Čačić  added the comment:

I thought that _Feature starts with an underscore precisely to evade such 
listings. Do other "private" module data also get listed?

--
nosy: +veky

___
Python tracker 

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



  1   2   >