[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread Christian Heimes


Christian Heimes  added the comment:

I don't agree with GH-31673. Did you try defining NO_MISALIGNED_ACCESSES 
instead?

--
nosy: +christian.heimes

___
Python tracker 

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



[issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work

2022-03-03 Thread Vinay Sajip


Vinay Sajip  added the comment:

> If so, then it probably good to adjust ... since it still talks about it 
> being expected.

Do you mean just adding a note to the effect that SysLogHandler won't work on 
macOS 12.2 because of changes to the syslog daemon on that platform?

IIRC using the syslog module was not an option at the time SysLogHandler was 
added, I think because of both thread-safety and lack-of-functionality issues.

--

___
Python tracker 

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



[issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work

2022-03-03 Thread Philip Bloom


Philip Bloom  added the comment:

I could certainly understand that.  It's a weird apple choice.  

If so, then it probably good to adjust 
https://docs.python.org/3/library/logging.handlers.html#sysloghandler since it 
still talks about it being expected.

--

___
Python tracker 

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



[issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir()

2022-03-03 Thread Eryk Sun


Eryk Sun  added the comment:

> e = Path(r'F:\ceven\test2')

Using forward slashes in the string literal is preferred, e.g. 
Path('F:/ceven/test2'). This avoids the problem of backslash escapes in string 
literals. The Path constructor parses the path and stores it internally as 
component parts. When the path object is needed as a string, os.fspath() 
returns the path using the platform's preferred path separator. A WindowsPath 
or PureWindowsPath uses backslash as the path separator. For example:

>>> os.fspath(pathlib.PureWindowsPath('F:/ceven/test2'))
'F:\\ceven\\test2'

--

___
Python tracker 

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



[issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir()

2022-03-03 Thread Eryk Sun


Eryk Sun  added the comment:

> FileNotFoundError: [WinError 3] The system cannot find 
> the path specified: 'F:\\ceven\\test2'

The Windows error code, ERROR_PATH_NOT_FOUND (3), indicates that the parent 
path, r"F:\ceven", does not exist. Try e.mkdir(parents=True) [1].

[1] https://docs.python.org/3/library/pathlib.html#pathlib.Path.mkdir

--
nosy: +eryksun

___
Python tracker 

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



[issue46744] installers on ARM64 suggest wrong folders

2022-03-03 Thread Steve Dower


Steve Dower  added the comment:


New changeset 8f31bf46980956c735dd18f9914f3e7144e87c77 by Steve Dower in branch 
'main':
bpo-46744: Move Windows ARM64 installation directory to correct ProgramFiles 
(GH-31677)
https://github.com/python/cpython/commit/8f31bf46980956c735dd18f9914f3e7144e87c77


--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6a14330318c9c7aedf3e9841c3dfea337064d8e6 by Victor Stinner in 
branch '3.9':
bpo-46913: Fix test_ctypes, test_hashlib, test_faulthandler on UBSan (GH-31675) 
(GH-31676)
https://github.com/python/cpython/commit/6a14330318c9c7aedf3e9841c3dfea337064d8e6


--

___
Python tracker 

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



[issue46744] installers on ARM64 suggest wrong folders

2022-03-03 Thread Steve Dower


Steve Dower  added the comment:

Posted half a PR for this, which is worth taking in itself, but doesn't 
completely address the whole change. It will install to the correct 
ProgramFiles folder on ARM64 now, but still with the suffix.

If we are to take the rest of the change (use "-amd64" for AMD64 builds on 
ARM64 OS), it has to be ready for beta 1. There's still time, but absent a 
major issue from *not* doing it, we want to avoid changing on-disk layout 
during beta/RC.

--

___
Python tracker 

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



[issue46744] installers on ARM64 suggest wrong folders

2022-03-03 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29796
pull_request: https://github.com/python/cpython/pull/31676

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7b5b429adab4fe0fe81858fe3831f06adc2e2141 by Victor Stinner in 
branch '3.10':
[3.10] bpo-46913: Fix test_ctypes, test_hashlib, test_faulthandler on UBSan 
(GH-31675)
https://github.com/python/cpython/commit/7b5b429adab4fe0fe81858fe3831f06adc2e2141


--

___
Python tracker 

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



[issue42337] Skip building web installers on Windows

2022-03-03 Thread Steve Dower


Steve Dower  added the comment:

Forget exactly when I did this, but I did it.

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

I pushed changes just to turn back the buildbot back to green, but undefined 
behaviors in test_ctypes.test_shorts() and _sha3 (tested by test_hashlib) must 
be fixed.

Previously, test_ctypes, test_hashlib and test_faulthandler were fully skipped 
on UBSan. Now only 1 test_ctypes test and a few test_hashlib tests are skipped 
on the UBSan buildbot (test_faulthandler now pass on UBSan).

--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29795
pull_request: https://github.com/python/cpython/pull/31675

___
Python tracker 

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



[issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ec4a580f7cada002441ae5611b909d56e3b5b613 by Victor Stinner in 
branch 'main':
bpo-46355: Update pythoncapi_compat project URL (GH-31670)
https://github.com/python/cpython/commit/ec4a580f7cada002441ae5611b909d56e3b5b613


--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ad1b04451d3aca2c6fa6dbe2891676a4e0baac49 by Victor Stinner in 
branch 'main':
bpo-46913: Skip test_ctypes.test_shorts() on UBSan (GH-31674)
https://github.com/python/cpython/commit/ad1b04451d3aca2c6fa6dbe2891676a4e0baac49


--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6d0d7d2b8c1e04fd51c6cb29cc09a41b60b97b7b by Victor Stinner in 
branch 'main':
bpo-46913: test_hashlib skips _sha3 tests on UBSan (GH-31673)
https://github.com/python/cpython/commit/6d0d7d2b8c1e04fd51c6cb29cc09a41b60b97b7b


--

___
Python tracker 

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



[issue46852] Remove the float.__set_format__() method

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

I created a follow-up issue: bpo-46917 "Require IEEE 754 floating point to 
build Python 3.11". I close this one: float.__set_format__() has been removed.

--
resolution:  -> fixed
status: open -> closed
title: Remove the float.__setformat__() method -> Remove the 
float.__set_format__() method

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

The initial issue "Python leaks one reference at exit on Windows" is now fixed.

If someone wants to investigate the remaining leak of 1 memory block or the 
negative ref count of PYTHONDUMPREFS=1, please open a separated 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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-46887: ./Programs/_freeze_module fails with MSAN: Uninitialized 
value was created by an allocation of 'stat.i'.

--

___
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-03 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 05a8bc1c944709e7468f157bd1b6032f368e43bf by Brandt Bucher in 
branch 'main':
bpo-46841: Use inline caching for attribute accesses (GH-31640)
https://github.com/python/cpython/commit/05a8bc1c944709e7468f157bd1b6032f368e43bf


--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 65b92ccdec2ee4a99e54aaf7ae2d9bbc2ebfe549 by Victor Stinner in 
branch 'main':
bpo-46913: Fix test_faulthandler.test_read_null() on UBSan (GH31672)
https://github.com/python/cpython/commit/65b92ccdec2ee4a99e54aaf7ae2d9bbc2ebfe549


--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29794
pull_request: https://github.com/python/cpython/pull/31674

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29793
pull_request: https://github.com/python/cpython/pull/31673

___
Python tracker 

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



[issue46915] Build with Py_LIMITED_API fails unknown type name ‘PyModuleDef_Slot’

2022-03-03 Thread Christian Heimes


Christian Heimes  added the comment:

Please add a blurb entry.

--
assignee: christian.heimes -> vstinner
priority:  -> normal
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir()

2022-03-03 Thread Vincent FUNG


Vincent FUNG  added the comment:

This problem occurs when the directory starts with 't', but works with 
os.makedirs(e) or macOS.

>>> e = Path(r'F:\ceven\test2')
>>> e.mkdir()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python310\lib\pathlib.py", line 1173, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 
'F:\\ceven\\test2'
>>> os.makedirs(e)



Another question about \t:

If a directory is passed as a parameter it will not be possible to use the 
parameter as a raw string. os.makedirs gives the same error whether it's r'%s' 
or repr().

--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29792
pull_request: https://github.com/python/cpython/pull/31672

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

> https://github.com/python/buildmaster-config/commit/0fd1e3e49e4b688d5767501484cccea5fa35d3fc

Previously, 4 tests were skipped on the UBSAN buildbot

* test_faulthandler
* test_hashlib
* test_concurrent_futures
* test_ctypes

It's not a regression, it's just that I made the buildbot stricter. I'm 
planning to attempt to fix the 3 failing tests, or at least skip them in 
Python, rather than skipping them in the buildbot configuration.

--

___
Python tracker 

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



[issue46917] Require IEEE 754 floating point to build Python 3.11

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue46917] Require IEEE 754 floating point to build Python 3.11

2022-03-03 Thread STINNER Victor


New submission from STINNER Victor :

See "[Python-Dev] Should we require IEEE 754 floating-point for CPython?" 
thread:
https://mail.python.org/archives/list/python-...@python.org/thread/J5FSP6J4EITPY5C2UJI7HSL2GQCTCUWN/

I propose to require IEEE 754 floating-point to build Python 3.11. I propose 
the following build:

* Mention the new build requirement in What's New in Python 3.11.
* Modify configure script to make it fail if the IEEE 754 support is missing.
* Remove code handling missing NAN and infinity: float("nan"), float("inf"), 
math.nan and math.inf are always available.
* Remove @requires_IEEE_754 decorator of test.support and tests.
* Remove "unknown_format" code path of pack/unpack functions like 
_PyFloat_Pack8() (see bpo-46906 which proposes to make these functions public).


The _PY_SHORT_FLOAT_REPR==0 code path is kept. For now, platforms with float 
larger than 64-bit but without HAVE_PY_SET_53BIT_PRECISION are still supported 
(but don't get "short float repr"). See GH-31592 for details.


I prepared this requirement with these two changes:

commit 1b2611eb0283055835e5df632a7a735db8c894b8
Author: Victor Stinner 
Date:   Fri Feb 25 01:32:57 2022 +0100

bpo-46656: Remove Py_NO_NAN macro (GH-31160)

Building Python now requires support for floating point Not-a-Number
(NaN): remove the Py_NO_NAN macro.

commit 5ab745fc51e159ead28b523414e52f0bcc1ef353
Author: Victor Stinner 
Date:   Sat Feb 26 00:53:27 2022 +0100

bpo-46852: Remove the float.__set_format__() method (GH-31585)

Remove the undocumented private float.__set_format__() method,
previously known as float.__set_format__() in Python 3.7. Its
docstring said: "You probably don't want to use this function. It
exists mainly to be used in Python's test suite."


By the way, building Python 3.11 now requires a C11 compiler.

--
components: Build
messages: 414485
nosy: vstinner
priority: normal
severity: normal
status: open
title: Require IEEE 754 floating point to build Python 3.11
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



[issue46841] Inline bytecode caches

2022-03-03 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +29791
pull_request: https://github.com/python/cpython/pull/31671

___
Python tracker 

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



[issue25415] [io doc] Reword "there is no public constructor"

2022-03-03 Thread Irit Katriel


Irit Katriel  added the comment:

> I think that the fix should be to delete the original incorrect statement and 
> not replace it with another incorrect statement.


I agree with this.

--

___
Python tracker 

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



[issue46916] There is a problem with escape characters in the path passed in by pathlib.Path.mkdir()

2022-03-03 Thread Vincent FUNG


New submission from Vincent FUNG :

This problem occurs when the directory starts with 't', but works with 
os.makedirs(e) or macOS.

>>> e = Path(r'F:\ceven\test2')
>>> e.mkdir()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python310\lib\pathlib.py", line 1173, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 
'F:\\ceven\\test2'
>>> os.makedirs(e)

--
components: Windows
messages: 414483
nosy: paul.moore, steve.dower, tim.golden, vincent.fung, zach.ware
priority: normal
severity: normal
status: open
title: There is a problem with escape characters in the path passed in by 
pathlib.Path.mkdir()
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



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

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

lxml does crash on the current Cython 0.29.x development branch.

--

___
Python tracker 

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



[issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29789
pull_request: https://github.com/python/cpython/pull/31670

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 32f0c8271706550096c454eb512450b85fbfc320 by Victor Stinner in 
branch 'main':
bpo-45459: Use type names in the internal C API (GH-31669)
https://github.com/python/cpython/commit/32f0c8271706550096c454eb512450b85fbfc320


--

___
Python tracker 

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



[issue46915] Build with Py_LIMITED_API fails unknown type name ‘PyModuleDef_Slot’

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

Fixed by 
https://github.com/python/cpython/commit/0b63215bb152c06404cecbd5303b1a50969a9f9f

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2022-03-03 Thread William Woodruff


William Woodruff  added the comment:

Nosying myself; this affects 3.9 and 3.10 as well.

--
nosy: +yossarian
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0b63215bb152c06404cecbd5303b1a50969a9f9f by Victor Stinner in 
branch 'main':
bpo-45459: Fix PyModuleDef_Slot type in the limited C API (GH-31668)
https://github.com/python/cpython/commit/0b63215bb152c06404cecbd5303b1a50969a9f9f


--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

Reproducer of test_ctypes undefined behavior:
---
from ctypes import *

class BITS(Structure):
_fields_ = [("A", c_int, 1),
("B", c_int, 2),
("C", c_int, 3),
("D", c_int, 4),
("E", c_int, 5),
("F", c_int, 6),
("G", c_int, 7),
("H", c_int, 8),
("I", c_int, 9),

("M", c_short, 1),
("N", c_short, 2),
("O", c_short, 3),
("P", c_short, 4),
("Q", c_short, 5),
("R", c_short, 6),
("S", c_short, 7)]

b = BITS()
a = getattr(b, "M")
---

> GET_BITFIELD(val, size); // < HERE

I expanded the macro:
---
if (NUM_BITS(size)) {
size_t s = sizeof(val)*8;
Py_ssize_t low = LOW_BIT(size);
Py_ssize_t nbits = NUM_BITS(size);
// val=0, size=65553 = (1 << 16) + 17
// s=16, low=17, nbits=1
// s - low - nbits = (size_t)-2
val <<= (s - low - nbits);
val >>= (s - nbits);
}
---

The problem is that (s - low - nbits) is negative (-2), but becomes a very 
large number since it's unsigned (s is unsigned: "sizeof(v)*8" in the macro).

C code:
---
#include 

int main()
{
short s = 0x7fff;
size_t z = (size_t)-2;
s <<= z;
printf("s = %hi\n", s);
return 0;
}
---

GCC and clang disagree :-D
---
$ gcc x.c -o x -O3 -Wall -Wextra -Wconversion && ./x
s = 0

$ clang x.c -o x -O3 -Wall -Wextra -Wconversion && ./x
s = -5784
---

Moreover, runtime the binary built by clang produces a different result at each 
run...
---
$ ./x
s = -4824
$ ./x
s = 4120
$ ./x
s = -22344
$ ./x
s = -26744
$ ./x
s = -18184
---

--

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29788
pull_request: https://github.com/python/cpython/pull/31669

___
Python tracker 

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



[issue46915] Build with Py_LIMITED_API fails unknown type name ‘PyModuleDef_Slot’

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

I proposed a fix: https://github.com/python/cpython/pull/31668

--

___
Python tracker 

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



[issue46915] Build with Py_LIMITED_API fails unknown type name ‘PyModuleDef_Slot’

2022-03-03 Thread Christian Heimes

Christian Heimes  added the comment:

With fix:

$ /tmp/python311/bin/pip3 install --no-binary :all: cryptography
Collecting cryptography
  Using cached cryptography-36.0.1.tar.gz (572 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: cffi>=1.12 in 
/tmp/python311/lib/python3.11/site-packages (from cryptography) (1.15.0)
Requirement already satisfied: pycparser in 
/tmp/python311/lib/python3.11/site-packages (from cffi>=1.12->cryptography) 
(2.21)
Building wheels for collected packages: cryptography
  Building wheel for cryptography (PEP 517) ... done
  Created wheel for cryptography: 
filename=cryptography-36.0.1-cp311-cp311-linux_x86_64.whl size=2628351 
sha256=fb3cc21f8eaa546cd2c0123ea01a98bf92a9824fcdca36cfcf765b2c044bd186
  Stored in directory: 
/home/heimes/.cache/pip/wheels/6c/77/a9/3c4762d4e65bef5f742a304c507f9723ca3563a38d108618ad
Successfully built cryptography
Installing collected packages: cryptography
Successfully installed cryptography-36.0.1


Without fix:

  gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC 
-I/tmp/python311/include/python3.11 -c build/temp.linux-x86_64-3.11/_openssl.c 
-o build/temp.linux-x86_64-3.11/build/temp.linux-x86_64-3.11/_openssl.o 
-Wconversion -Wno-error=sign-conversion
  In file included from /tmp/python311/include/python3.11/Python.h:66,
   from build/temp.linux-x86_64-3.11/_openssl.c:57:
  /tmp/python311/include/python3.11/moduleobject.h:82:3: error: unknown type 
name ‘PyModuleDef_Slot’
 82 |   PyModuleDef_Slot *m_slots;
|   ^~~~

--
keywords:  -patch
stage: patch review -> 

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29787
pull_request: https://github.com/python/cpython/pull/31668

___
Python tracker 

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



[issue46915] Build with Py_LIMITED_API fails unknown type name ‘PyModuleDef_Slot’

2022-03-03 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue46915] Build with Py_LIMITED_API fails unknown type name ‘PyModuleDef_Slot’

2022-03-03 Thread Christian Heimes


Christian Heimes  added the comment:

The problem was first reported to PyCA cryptography project in bug 
https://github.com/pyca/cryptography/issues/6929

--

___
Python tracker 

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



[issue46915] Build with Py_LIMITED_API fails unknown type name ‘PyModuleDef_Slot’

2022-03-03 Thread Christian Heimes

New submission from Christian Heimes :

Extension modules with bare "#define Py_LIMITED_API" without version fail to 
build with error:

   moduleobject.h:82:3: error: unknown type name ‘PyModuleDef_Slot’

The issue was introduced in PR GH-31528 and bpo-45459. The type 
PyModuleDef_Slot is only defined when Py_LIMITED_API is set to Python 3.5.0 or 
higher.

--
assignee: christian.heimes
components: Build, Interpreter Core
keywords: 3.11regression
messages: 414473
nosy: christian.heimes, pablogsal, vstinner
priority: release blocker
severity: normal
status: open
title: Build with Py_LIMITED_API fails unknown type name ‘PyModuleDef_Slot’
type: compile error
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



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

2022-03-03 Thread Ned Deily


Ned Deily  added the comment:

My apologies: I'm not sure where I got the idea you were building on macOS!

In any case, this problem has come up a few times in the past, no doubt for a 
similar reason, most recently in open issue Issue31114. I'm closing this issue 
as a duplicate of that. But be aware that Distutils is now deprecated in 
general and in the upcoming 3.11 feature release, there are major changes to 
getpath and also to begin the process of eliminating the use of Distutils when 
building Python itself, so it is unlikely that any bug fixes for this minor 
wart will be forthcoming for current releases.

But a very simple workaround should be to use --prefix=/usr/local or some other 
path within your chroot environment rather than trying to install in / of the 
chroot.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> 'make install' fails when the configure 'prefix' is '/' and 
DESTDIR is used

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29785
pull_request: https://github.com/python/cpython/pull/31666

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4173d677a1d7c72bb32d292fbff1b4cf073d615c by Victor Stinner in 
branch 'main':
bpo-46913: Fix test_faulthandler.test_sigfpe() on UBSAN (GH-31662)
https://github.com/python/cpython/commit/4173d677a1d7c72bb32d292fbff1b4cf073d615c


--

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-03 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Per interpreter seems best.

If someone using this feature writes a buggy implementation of a callback that 
doesn't chain reliably, that is a bug in their code and all of the fallout from 
that is "just" a bug to be fixed in said code.

Think of it like a C signal handler, the OS doesn't chain for you - it is the 
signal handler installer's responsibility to chain to the previous one.  Not an 
unusual pattern for callback hooks in C.

We already have such global C callback hooks in SetProfile and SetTrace. 
https://docs.python.org/3/c-api/init.html#profiling-and-tracing

Those don't even provide for chaining.  We could do the same here and not let a 
hook be set more than once instead of providing a Get API to allow for manual 
chaining.  That seems less useful.

--

___
Python tracker 

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



[issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work

2022-03-03 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

This is probably not a bug in python, but a change in system behaviour.

In particular, I've used the lsof command to check the open files for the 
syslogd proces on a macOS 10.13 and 12.2 system. On the former syslogd has 
/var/run/syslog open, on the latter it doesn't.

The feature to listen on this socket has been removed entirely, the 12.2 system 
no longer lists a "-bsd_in" option for syslogd in the manual page whereas it is 
both available and enabled by default on 10.13.

It might be possible to change the SyslogHandler to optionally use the syslog 
module to log, but I'm not sure it is worth doing this and that would 
definitely be a new feature.

--
resolution:  -> third party
type:  -> behavior

___
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-03 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +29783
pull_request: https://github.com/python/cpython/pull/31664

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-03 Thread Carl Meyer


Carl Meyer  added the comment:

> Could we (or others) end up with unguarded stale caches if some buggy 
> extension forgets to chain the calls correctly?

Yes. I can really go either way on this. I initially opted for simplicity in 
the core support at the cost of asking a bit more of clients, on the theory 
that a) there are lots of ways for a buggy C extension to cause crashes with 
bad use of the C API, and b) I don't expect there to be very many extensions 
using this API. But it's also true that the consequences of a mistake here 
could be hard to debug (and easily blamed to the wrong place), and there might 
turn out to be more clients for dict-watching than I expect! If the consensus 
is to prefer CPython tracking an array of callbacks instead, we can try that.

> when you say "only one global callback": does that mean per-interpreter, or 
> per-process?

Good question! The currently proposed API suggests per-process, but it's not a 
question I've given a lot of thought to yet; open to suggestions. It seems like 
in general the preference is to avoid global state and instead tie things to an 
interpreter instance? I'll need to do a bit of research to understand exactly 
how that would affect the implementation. Doesn't seem like it should be a 
problem, though it might make the lookup at write time to see if we have a 
callback a bit slower.

--

___
Python tracker 

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



[issue44800] Code readability: rename InterpreterFrame to `_Py_framedata`

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



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

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-03 Thread Brandt Bucher


Brandt Bucher  added the comment:

Also, when you say "only one global callback": does that mean per-interpreter, 
or per-process?

--

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-03 Thread Brandt Bucher

Brandt Bucher  added the comment:

> CPython will track only one global callback; it is a well-behaved client’s 
> responsibility to check if a callback is already set when setting a new one, 
> and daisy-chain to the previous callback if so.

Hm, this is a bit scary. Could we (or others) end up with unguarded stale 
caches if some buggy extension forgets to chain the calls correctly?

Core CPython seems most at risk of this, since we would most likely be 
registered first.

--

___
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-03 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Pablo, we are good. The PRs were merged in open branches a while ago, and this 
was tracking security releases backports.

--

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-03 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

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



[issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work

2022-03-03 Thread Ned Deily


Change by Ned Deily :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work

2022-03-03 Thread Philip Bloom


New submission from Philip Bloom :

Hello, don't file these often so apologies for any mistakes, trying to be good 
python citizen here.

Checked this on the python-list first, and others reported it as reproducible.

The issue is:
On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work.  It won't 
throw any error but the ASL/Console.App does not see any messages from it.  On 
OSX Big Sur (11.x) this works just fine with the exact same code.

I think I've cut this into a small example proof that can be run to demonstrate 
the issue.  If this is run and any of the substrings are searched for in 
Console.App when it is checking events, only the QQQ message from SysLog will 
show up.

Gonna work around it likely on our end, but hope this helps it get fixed for a 
future version.

---

import logging
from logging.handlers import SysLogHandler

root_logger = logging.getLogger()
root_logger.setLevel(logging.DEBUG)
basic_datefmt = '%m/%d/%Y %I:%M:%S %p'

syslog_format = logging.Formatter(fmt='SetupCDNGUI: %(message)s', 
datefmt=basic_datefmt)

sys_handler = SysLogHandler(address='/var/run/syslog')
#sys_handler.encodePriority(SysLogHandler.LOG_USER, SysLogHandler.LOG_ALERT)
# Tried with the above, but didn't make a difference.  Neither did not defining 
the address and letting it go to local host.
sys_handler.setFormatter(syslog_format)
root_logger.addHandler(sys_handler)


# None of these will show up.
logging.critical("CCC This is a test critical")
logging.error("EEE This is a test error")
logging.info("III Still a test")


# Comparatively this sends a message received just fine
import syslog

syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_USER)
syslog.syslog(syslog.LOG_NOTICE, 'QQQ test log')

--
components: macOS
messages: 414464
nosy: ned.deily, pbloom, ronaldoussoren
priority: normal
severity: normal
status: open
title: On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue46823] Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode

2022-03-03 Thread Brandt Bucher


Brandt Bucher  added the comment:

Reopening since this needed to be removed for 
https://github.com/python/cpython/pull/31640.

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

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-03 Thread Carl Meyer


Carl Meyer  added the comment:

Thanks gps! Working on a PR and will collect pyperformance data as well.

We haven't observed any issues in Cinder with the callback just being called at 
shutdown, too, but if there are problems with that it should be possible to 
just have CPython clear the callback at shutdown time.

--

___
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-03 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 127797f572cc7374192e415c44ea2e95b009d5ab by Brandt Bucher in 
branch 'main':
bpo-46841: Improve the failure stats for COMPARE_OP (GH-31663)
https://github.com/python/cpython/commit/127797f572cc7374192e415c44ea2e95b009d5ab


--

___
Python tracker 

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



[issue46908] Debugger jumps to a wrong instruction in for loop

2022-03-03 Thread Vedran Čačić

Vedran Čačić  added the comment:

pdb on Py3.10.2 works fine with that code.

--
nosy: +veky

___
Python tracker 

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



[issue46908] Debugger jumps to a wrong instruction in for loop

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



[issue46841] Inline bytecode caches

2022-03-03 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +29782
pull_request: https://github.com/python/cpython/pull/31663

___
Python tracker 

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



[issue46877] [doc] unittest.doModuleCleanups() does not exist

2022-03-03 Thread Guido van Rossum


Change by Guido van Rossum :


--
components: +Library (Lib)
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type: enhancement -> behavior

___
Python tracker 

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



[issue46877] [doc] unittest.doModuleCleanups() does not exist

2022-03-03 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset cc400585fab02994255f21ae8183d5f147236815 by Kumar Aditya in 
branch 'main':
bpo-46877: export unittest.doModuleCleanups in unittest package (#31613)
https://github.com/python/cpython/commit/cc400585fab02994255f21ae8183d5f147236815


--
nosy: +gvanrossum

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

test_faulthandler: test_sigfpe() fails with:

==
FAIL: test_sigfpe (test.test_faulthandler.FaultHandlerTests)
--
Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_faulthandler.py", line 228, in 
test_sigfpe
self.check_fatal_error("""
^^
  File "/home/vstinner/python/main/Lib/test/test_faulthandler.py", line 129, in 
check_fatal_error
self.check_error(code, line_number, fatal_error, **kw)
^^
  File "/home/vstinner/python/main/Lib/test/test_faulthandler.py", line 122, in 
check_error
self.assertRegex(output, regex)
^^^
AssertionError: Regex didn't match: '(?m)^Fatal Python error: Floating point 
exception\n\nCurrent thread 0x[0-9a-f]+ \\(most recent call first\\):\n  File 
"", line 3 in ' not found in 'Modules/faulthandler.c:1112:11: 
runtime error: division by zero\nSUMMARY: UndefinedBehaviorSanitizer: 
undefined-behavior Modules/faulthandler.c:1112:11 in '

--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

test_hashlib: test_gil() fails with:
---
test_gil (test.test_hashlib.HashLibTestCase) ... 
/home/vstinner/python/main/Modules/_sha3/kcp/KeccakP-1600-opt64.c:467:9: 
runtime error: load of misaligned address 0x02daafd7 for type 'UINT64' (aka 
'unsigned long'), which requires 8 byte alignment
0x02daafd7: note: pointer points here
 23 23 23 23 23  23 23 23 23 23 23 23 23  23 23 23 23 23 23 23 23  23 23 23 23 
23 23 23 23  23 23 23
 ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
/home/vstinner/python/main/Modules/_sha3/kcp/KeccakP-1600-opt64.c:467:9 in 
---

--

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

test_ctypes: test_shorts() of ctypes.test.test_bitfields.C_Test is failing with:

---
test_shorts (ctypes.test.test_bitfields.C_Test) ... 
/home/vstinner/python/main/Modules/_ctypes/cfield.c:554:5: runtime error: shift 
exponent 18446744073709551614 is too large for 16-bit type 'short'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
/home/vstinner/python/main/Modules/_ctypes/cfield.c:554:5 in 
---

It's a test on the "h" format code:

#define LOW_BIT(x)  ((x) & 0x)
#define NUM_BITS(x) ((x) >> 16)

#define GET_BITFIELD(v, size)   \
if (NUM_BITS(size)) {   \
v <<= (sizeof(v)*8 - LOW_BIT(size) - NUM_BITS(size));   \
v >>= (sizeof(v)*8 - NUM_BITS(size));   \

static PyObject *
h_get(void *ptr, Py_ssize_t size)
{
short val;
memcpy(&val, ptr, sizeof(val));
GET_BITFIELD(val, size); // < HERE
return PyLong_FromLong((long)val);
}

static struct fielddesc formattable[] = {
...
{ 'h', h_set, h_get, NULL, h_set_sw, h_get_sw},
...
};


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-03 Thread STINNER Victor


New submission from STINNER Victor :

I recently changed how tests are skipped in ASAN, MSAN and UBSAN CIs (buildbot 
workers and GitHub Action jobs):

* bpo-46633
* 
https://github.com/python/buildmaster-config/commit/0fd1e3e49e4b688d5767501484cccea5fa35d3fc

3 tests are now failing on "AMD64 Arch Linux Usan 3.x":

* test_ctypes
* test_faulthandler
* test_hashlib

First failed build:
https://buildbot.python.org/all/#/builders/719/builds/632

--
components: Tests
messages: 414455
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing
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



[issue1666807] Incorrect file path reported by inspect.getabsfile()

2022-03-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

So this bug is referenced when pydevd encounters some problem with 3.11a5+:

https://github.com/fabioz/PyDev.Debugger/issues/213

Since the link to this bug is apparently baked into the error messages printed 
by pydevd, I am adding this comment to this old, closed bug.

I can't seem to reproduce it. I modernized the reproducer script:

###

import inspect,sys

print('Version info:',sys.version_info)
print()

f1 = inspect.getabsfile(inspect)
f2 = inspect.getabsfile(inspect.iscode)
print('File for `inspect`   :',f1)
print('File for `inspect.iscode`:',f2)
print('Do these match?',f1==f2)
if f1==f2:
print('OK')
else:
print('BUG - this is a bug in this version of Python')

###EOF

And the output is:

Version info: sys.version_info(major=3, minor=11, micro=0, 
releaselevel='alpha', serial=5)

File for `inspect`   : 
c:\users\gvanrossum\appdata\local\programs\python\python311\lib\inspect.py
File for `inspect.iscode`: 
c:\users\gvanrossum\appdata\local\programs\python\python311\lib\inspect.py
Do these match? True
OK

I tried it with the most recent Python built from source and get the same 
result:

Version info: sys.version_info(major=3, minor=11, micro=0, 
releaselevel='alpha', serial=5)

File for `inspect`   : c:\users\gvanrossum\cpython\lib\inspect.py
File for `inspect.iscode`: c:\users\gvanrossum\cpython\lib\inspect.py
Do these match? True
OK


So I wonder if the problem that's currently plagueing pydevd in 3.11 alpha 
releases is slightly different?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue43312] Interface to select preferred "user" or "home" sysconfig scheme for an environment

2022-03-03 Thread Miro Hrončok

Change by Miro Hrončok :


--
nosy: +hroncok
nosy_count: 8.0 -> 9.0
pull_requests: +29780
pull_request: https://github.com/python/cpython/pull/31034

___
Python tracker 

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



[issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2

2022-03-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

I understand. Then I'm going to close this issue, since there's nothing we can 
do.

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

___
Python tracker 

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



[issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2

2022-03-03 Thread Ajaya Sutar


Ajaya Sutar  added the comment:

Actually we can not share code due to certain term and conditions. 

Thanks.

--

___
Python tracker 

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



[issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop

2022-03-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Unfortunately, we cannot do much here. The reason is that the parser allows 
break and continue outside loops as they count as statements. As these are 
associated with control flow, is the compiler the one that will show the Syntax 
warning once it tries to make sense of the abstract syntax tree that the parser 
generates.

The error you are getting happens because for the parser, the unindented else 
*is* a syntax error so it fails much sooner and prevents the compiler to 
complain about the break.

This means that in the presence of two syntax errors, one being a parser error 
and the other a compiler error, the parser will always be first, no matter if 
the other one appears before in the code.

Given this, I am afraid we need to close this issue as "won't fix" :(

Bing said that, if someone devises some easy way to do this without major 
changes everywhere, I am happy to reopen it

--
resolution:  -> wont fix
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



[issue46908] Debugger jumps to a wrong instruction in for loop

2022-03-03 Thread Mark Shannon


Mark Shannon  added the comment:

Which debugger? Which version of Python?

Please provide all the steps required to reproduce, otherwise there is little 
we can do.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour

2022-03-03 Thread Vidhya


Vidhya  added the comment:

Thanks Irit for your help.

On Thu., Mar. 3, 2022, 10:17 a.m. Irit Katriel, 
wrote:

>
> Irit Katriel  added the comment:
>
> Thank you @vidhya.
>
> --
> resolution:  -> fixed
> stage: patch review -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour

2022-03-03 Thread Irit Katriel


Irit Katriel  added the comment:

Thank you @vidhya.

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



[issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour

2022-03-03 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 09819863a3fb7092ca5cbdfcb722882ebbac806b by Miss Islington (bot) 
in branch '3.9':
bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter 
(GH-31639) (GH-31661)
https://github.com/python/cpython/commit/09819863a3fb7092ca5cbdfcb722882ebbac806b


--

___
Python tracker 

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



[issue44800] Code readability: rename InterpreterFrame to `_Py_framedata`

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

Oh. I didn't know this issue. I recently made changes around PyFrameObject:

* Move PyFrameObject to the internal C API (see bpo-46836 for the rationale)
* Rename CFrame to _PyCFrame
* Rename InterpreterFrame to _PyInterpreterFrame

I prepared PRs for Cython, greenlet and gevent to use the internal C API 
pycore_frame.h to get the PyFrameObject structure:

https://bugs.python.org/issue46836#msg414283

For the short term, these projects should use the internal C API. But I sent a 
call to add getter and setter functions:

https://mail.python.org/archives/list/capi-...@python.org/thread/RCT4SB5LY5UPRRRALEOHWEQHIXFNTHYF/

If possible, it would be great to have a public C API so these projects don't 
use the internal C API at all, that's being discussed at:

* https://github.com/faster-cpython/ideas/issues/309
* https://bugs.python.org/issue40421

In terms of backward compatibility, since PyFrameObject is now part of the 
internal C API, we can break things. In practice... it's better to not break 
3rd party code too often. See for example Brandt Bucher who is directly 
impacted by these changes:

https://bugs.python.org/issue46836#msg414279

--
nosy: +vstinner

___
Python tracker 

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



[issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour

2022-03-03 Thread miss-islington


miss-islington  added the comment:


New changeset 9d9dc59d07d51d73e5af7dd506d0da63aa336995 by Miss Islington (bot) 
in branch '3.10':
bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter 
(GH-31639)
https://github.com/python/cpython/commit/9d9dc59d07d51d73e5af7dd506d0da63aa336995


--

___
Python tracker 

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



[issue46912] Full gc collection blocked from collecting after some amount of objects in oldest gen

2022-03-03 Thread Alexei Komarov


New submission from Alexei Komarov :

Hi!

Maybe it is just my misunderstanding of the mechanism, so please excuse me if 
it is so. Looking at the GC module code, I think that once there are X objects 
in the oldest gen, a full collection blocked due to the condition 
https://github.com/python/cpython/blob/3.10/Modules/gcmodule.c#L1465-L1467 
being always True.

So, if youngest gen is collected each 700 objects, the middle gen will have 
maximum 7000 objects. Full collection will be triggered each ~70K objects. X/4 
= 7 ===> X=28. If oldest gen has >280K objects in it, the condition for 
full collection (long_lived_pending < gcstate->long_lived_total / 4) is always 
true since to my understanding, long_lived_pending is 70K at most, and got 
zeroed each full collection 
(https://github.com/python/cpython/blob/3.10/Modules/gcmodule.c#L1253).

--
components: Extension Modules
messages: 41
nosy: al3x3i.k
priority: normal
severity: normal
status: open
title: Full gc collection blocked from collecting after some amount of objects 
in oldest gen
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



[issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour

2022-03-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 11.0 -> 12.0
pull_requests: +29778
pull_request: https://github.com/python/cpython/pull/31660

___
Python tracker 

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



[issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour

2022-03-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29779
pull_request: https://github.com/python/cpython/pull/31661

___
Python tracker 

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



[issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour

2022-03-03 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 10117f1d8cb49ce95493555c06050faf636ccee7 by vidhya in branch 
'main':
bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter 
(GH-31639)
https://github.com/python/cpython/commit/10117f1d8cb49ce95493555c06050faf636ccee7


--

___
Python tracker 

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



[issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2

2022-03-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

> I was running one python script

Again: you need to show us the script that's causing this problem. I (and 
millions of others) run scripts all the time which do not fail in the way you 
describe. Unless you show us a script that causes the problem, we cannot help 
you.

--

___
Python tracker 

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



[issue46061] GCState *gcstate = get_gc_state() gives fatal error in Python 3.10.2

2022-03-03 Thread Ajaya Sutar


Ajaya Sutar  added the comment:

I was running one python script. At the time of python exit while calling 
Py_XDECREF(weakRefObject), it is calling giving exception in python 3.10.2. 

While debugging found  

In python 3.8.12, it is working fine with _PyRuntime.

void
PyObject_GC_Del(void *op)
{
PyGC_Head *g = AS_GC(op);
if (_PyObject_GC_IS_TRACKED(op)) {
gc_list_remove(g);
}
struct _gc_runtime_state *state = &_PyRuntime.gc;
if (state->generations[0].count > 0) {
state->generations[0].count--;
}
PyObject_FREE(g);
}

But in Python 3.10.2 it is not working with get_gc_state() giving exception. It 
seems it is memory issues. 

void
PyObject_GC_Del(void *op)
{
PyGC_Head *g = AS_GC(op);
if (_PyObject_GC_IS_TRACKED(op)) {
gc_list_remove(g);
}
GCState *gcstate = get_gc_state();
if (gcstate->generations[0].count > 0) {
gcstate->generations[0].count--;
}
PyObject_Free(g);
}

Could you please check this issue.
Is there any fix or any workaround for it. Because so many python script are 
failing at the exit of python interpreter.

Thanks in advance

--
status: pending -> open
title: Journal execution gives fatal error in Python 3.10.1 -> GCState *gcstate 
= get_gc_state() gives fatal error in Python 3.10.2

___
Python tracker 

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



[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-03-03 Thread Mark Shannon


Change by Mark Shannon :


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



[issue46845] dict: Use smaller entry for Unicode-key only dict.

2022-03-03 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29777
pull_request: https://github.com/python/cpython/pull/31659

___
Python tracker 

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



[issue46874] [sqlite3] optimise user-defined functions

2022-03-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue46874] [sqlite3] optimise user-defined functions

2022-03-03 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 88567a997005c9388137cd18c5d7f4483423dac3 by Erlend Egeberg 
Aasland in branch 'main':
bpo-46874: Speed up sqlite3 user-defined aggregate 'step' method (GH-31604)
https://github.com/python/cpython/commit/88567a997005c9388137cd18c5d7f4483423dac3


--
nosy: +corona10

___
Python tracker 

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



[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-03-03 Thread Ned Batchelder


Ned Batchelder  added the comment:

Yes, this is fixed, thanks.

--

___
Python tracker 

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



[issue46911] Early tracing has lineno=None for modules

2022-03-03 Thread Ned Batchelder


New submission from Ned Batchelder :

Coverage.py has a trick to measure the early execution of stdlib modules. It 
has an "encodings.py" file that sets a trace function, then gets out of the way 
to let the real encodings.py execute.  In 3.11.0a5, that early trace function 
gets None values for the line numbers when modules were first executed.

To reproduce, create two files, encodings.py and prog.py:

--- 8< --
# encodings.py
import sys

class FullCoverageTracer:
def __init__(self):
self.traces = []

def fullcoverage_trace(self, *args):
frame, event, arg = args
if frame.f_lineno is None:
self.traces.append((frame.f_code.co_name, frame.f_code.co_filename))
return self.fullcoverage_trace

sys.settrace(FullCoverageTracer().fullcoverage_trace)

parentdir = max(filter(__file__.startswith, sys.path), key=len)
sys.path.remove(parentdir)
del sys.modules['encodings']
import encodings
-

--- 8< --
# prog.py
import sys

print(sys.version)
trace = sys.gettrace()
print("None traces:", trace.__self__.traces)
print("Hello")
-

Then run:

% PYTHONPATH=$(pwd) python3.10 prog.py
3.10.2 (main, Jan 15 2022, 05:51:59) [Clang 12.0.0 (clang-1200.0.32.29)]
None traces: []
Hello

% PYTHONPATH=$(pwd) python3.11 prog.py
3.11.0a5 (main, Feb  3 2022, 19:11:58) [Clang 12.0.0 (clang-1200.0.32.29)]
None traces: [('', 
'/usr/local/pyenv/pyenv/versions/3.11.0a5/lib/python3.11/encodings/__init__.py'),
 ('', ''), ('', 
'/usr/local/pyenv/pyenv/versions/3.11.0a5/lib/python3.11/encodings/aliases.py'),
 ('', 
'/usr/local/pyenv/pyenv/versions/3.11.0a5/lib/python3.11/encodings/utf_8.py'), 
('', ''), ('', ''), ('', 
''), ('', ''), ('', ''), 
('', ''), ('', ''), 
('', ''), ('', ''), 
('', ''), ('', 
'/System/Volumes/Data/root/src/bugs/fullcov/prog.py')]
Hello

--
components: Interpreter Core
keywords: 3.11regression
messages: 414438
nosy: Mark.Shannon, nedbat
priority: normal
severity: normal
status: open
title: Early tracing has lineno=None for modules
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



  1   2   >