[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-31 Thread Марк Коренберг

Марк Коренберг  added the comment:

Well.
1. We use Python as PID 1. In PID namespace.
2. Further investigation gave information that vfork()+pid=1 actually WORKS. 
The problem is connected with another weird thing in kernel (undocumented 
unshare() flags).
3. The logic to try fork() after vfork() has failed is NICE. Please merge. I 
would also write a message to stderr in case vfork() failed.

P.S. Program may or may not be static in order to work as PID=1.

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

After reading Mark's comments, I reworked my GH-32190 PR to only use the CAST 
macros in other macros, not in the C code. The CAST macros are not used in such 
code pattern:

 else if (PyCFunction_Check(func))
-return ((PyCFunctionObject*)func)->m_ml->ml_name;
+return _PyCFunctionObject_CAST(func)->m_ml->ml_name;

In fact, this change doesn't bring any value.

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c14d7e4b816134b8e93ece4066a86d229631ce96 by Victor Stinner in 
branch 'main':
bpo-47164: Add _PyASCIIObject_CAST() macro (GH-32191)
https://github.com/python/cpython/commit/c14d7e4b816134b8e93ece4066a86d229631ce96


--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f0bc69485677ae8973685866ada0982976d3878f by Victor Stinner in 
branch 'main':
bpo-47164: Add _PyCFunction_CAST() macro (GH-32192)
https://github.com/python/cpython/commit/f0bc69485677ae8973685866ada0982976d3878f


--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7fc39a21cb85163a456eab91b52e5fe85e7f7e3e by Victor Stinner in 
branch 'main':
bpo-47164: Add _PyCFunctionObject_CAST() macr (GH-32190)
https://github.com/python/cpython/commit/7fc39a21cb85163a456eab91b52e5fe85e7f7e3e


--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30286
pull_request: https://github.com/python/cpython/pull/32210

___
Python tracker 

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



[issue47176] Interrupt handling for wasm32-emscripten builds without pthreads

2022-03-31 Thread Christian Heimes


Change by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-03-31 Thread Christian Heimes


Change by Christian Heimes :


--
dependencies: +Interrupt handling for wasm32-emscripten builds without pthreads

___
Python tracker 

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



[issue47179] pymalloc should align to max_align_t

2022-03-31 Thread Petr Viktorin


New submission from Petr Viktorin :

malloc() returns memory that's "suitably aligned for any built-in type".
All of Python's allocation functions should do the same. 

In bpo-27987 (PR-12850, PR-13336), the alignment was raised* to 16 bytes and 
`long double`. This is OK for current architectures, so there is no practical 
issue right now.

But, C11 defines a [max_align_t] type which sounds like the *correct* thing to 
use for determining pymalloc/PyGC_Head alignment.
At least we should assert that obmalloc's ALIGNMENT is a multiple of 
`alignof(max_align_t)`, and use max_align_t rather than `long double` in 
PyGC_Head.



See also this python-cffi issue: 
https://foss.heptapod.net/pypy/cffi/-/issues/531#note_181779

[max_align_t]: https://en.cppreference.com/w/c/types/max_align_t

* (on 64-bit arches)

--
components: C API
messages: 416421
nosy: methane, petr.viktorin, pitrou, vstinner
priority: normal
severity: normal
status: open
title: pymalloc should align to max_align_t

___
Python tracker 

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



[issue47180] Remove unnecessary registration of weakref.WeakSet as a subtype of _collections_abc.Set

2022-03-31 Thread Géry

New submission from Géry :

Registering `weakref.WeakSet` as a subtype of `_collections_abc.MutableSet` 
implies that it is also a subtype of `_collections_abc.Set` since 
`_collections_abc.MutableSet` is a subtype of `_collections_abc.Set` and the 
subtype relation is transitive.

--
components: Library (Lib)
messages: 416422
nosy: maggyero
priority: normal
pull_requests: 30287
severity: normal
status: open
title: Remove unnecessary registration of weakref.WeakSet as a subtype of 
_collections_abc.Set
type: enhancement
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



[issue47181] error: impossible constraint in ‘asm’

2022-03-31 Thread gerald honk

New submission from gerald honk :

On CentOS7 gcc 4.8.5 compiler
it dosen't work
run
./configure --enable-ipv6 --enable-shared --with-dbmliborder=gdbm:ndbm:bdb   
--with-computed-gotos=yes  --with-system-expat   --with-system-ffi 
--enable-loadable-sqlite-extensions --with-dtrace  --with-lto  
--with-ssl-default-suites=openssl --enable-optimizations

error: impossible constraint in ‘asm’

--
components: Build
messages: 416423
nosy: glynnis.honk
priority: normal
severity: normal
status: open
title: error: impossible constraint in ‘asm’
type: compile error
versions: Python 3.8

___
Python tracker 

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



[issue47181] error: impossible constraint in ‘asm’

2022-03-31 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please attach your config.log file?

--
nosy: +christian.heimes

___
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()

2022-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset b36d222110d0d6d84dc8e973ca87d976c2423f5d by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port _tkinter to PY_STDLIB_MOD (GH-31698)
https://github.com/python/cpython/commit/b36d222110d0d6d84dc8e973ca87d976c2423f5d


--

___
Python tracker 

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



[issue47166] Dataclass transform should ignore TypeAlias variables

2022-03-31 Thread Alex Waygood


Alex Waygood  added the comment:

I think implementing this would add complexity to the code in dataclasses.py 
(though Eric's the expert!).

For your use case, is it essential that the type alias declaration be inside 
the class scope? Would it be possible for you to simply have the alias 
declaration in the global scope instead?

--

___
Python tracker 

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



[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-31 Thread Vinay Sajip


Vinay Sajip  added the comment:

The 3.8 branch is security-fix-only now, I'm afraid. And I'm not sure it's 
worth backporting this.

--
versions:  -Python 3.8

___
Python tracker 

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



[issue47166] Dataclass transform should ignore TypeAlias variables

2022-03-31 Thread Eric V. Smith


Eric V. Smith  added the comment:

Same question as Alex: what does the TypeAlias being inside the class offer 
that being at module level doesn't?

--

___
Python tracker 

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



[issue44740] Lowercase "Internet" and "web" in docs

2022-03-31 Thread Mariusz Felisiak


Change by Mariusz Felisiak :


--
resolution:  -> fixed

___
Python tracker 

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



[issue44740] Lowercase "Internet" and "web" in docs

2022-03-31 Thread Mariusz Felisiak


Change by Mariusz Felisiak :


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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-31 Thread Mariusz Felisiak


Mariusz Felisiak  added the comment:

https://sqlite.org/src/info/336851b191fe79f0 was merged to the 3.38 branch, so 
we should expect 3.38.3 in the coming days.

--

___
Python tracker 

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



[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-31 Thread Grégory Starck

Grégory Starck  added the comment:

Enji : you can use this then:

```
In [6]: class Fixed(logging.handlers.SysLogHandler):
   ...: def __init__(self, *a, **kw):
   ...: self.socket = None
   ...: super().__init__(*a, **kw)
   ...: def close(self):
   ...: if self.socket is None:
   ...: return
   ...: super().close()
```

that looks to be enough to prevent the issue.

--

___
Python tracker 

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



[issue47120] Make all jump opcodes relative

2022-03-31 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset a00518d9ad9a8f408a9699191019d75dd8406c32 by Irit Katriel in 
branch 'main':
bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD 
(GH-32115)
https://github.com/python/cpython/commit/a00518d9ad9a8f408a9699191019d75dd8406c32


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer

2022-03-31 Thread Christian Heimes


New submission from Christian Heimes :

unicodeobject.c has a static pointer to a unicode name CAPI capsule:

   static _PyUnicode_Name_CAPI *ucnhash_capi = NULL;

The capsule is initialized on demand when the parser encounters a named unicode 
representation like "\N{digit nine}". Once the capsule pointer ucnhash_capi has 
been initialized, it is never reset. Not even a full interpreter shutdown 
invalidates the pointer.

A shutdown of the main interpreter with Py_Finalize() renders the pointer 
invalid. If the interpreter is re-initialized again, the invalid pointer causes 
a segfault. The problem was first discovered by Trey Hunner in 
https://github.com/ethanhs/python-wasm/issues/69

python.js:219 Uncaught RuntimeError: null function or function signature 
mismatch
at _PyUnicode_DecodeUnicodeEscapeInternal (unicodeobject.c:6493:25)
at decode_unicode_with_escapes (string_parser.c:121:13)
at _PyPegen_parsestr (string_parser.c:273:1)
at strings_rule (action_helpers.c:901:20)
at atom_rule (parser.c:14293:27)
at primary_rule (parser.c:13916:17)
at await_primary_rule (parser.c:13666:17)
at factor_rule (parser.c:13542:29)
at term_rule (parser.c:13330:17)
at sum_rule (parser.c:13044:17)

I can reproduce the issue with pure C code:

$ gcc -Xlinker -export-dynamic -g -IInclude/ -I. -o ucnbug ucnbug.c 
libpython3.11.a -lm -ldl
$ gdb ucnbug
(gdb) run
0
9
Done

1

Program received signal SIGSEGV, Segmentation fault.
0x in ?? ()
(gdb) bt
#0  0x in ?? ()
#1  0x005729a8 in _PyUnicode_DecodeUnicodeEscapeInternal (s=, s@entry=0x7fffea53b6d0 "\\N{digit nine}", size=, 
errors=errors@entry=0x0, 
consumed=consumed@entry=0x0, 
first_invalid_escape=first_invalid_escape@entry=0x7fffc748) at 
Objects/unicodeobject.c:6490
#2  0x00644fe3 in decode_unicode_with_escapes 
(parser=parser@entry=0x7fffea5e45d0, s=0x7fffea53b6d0 "\\N{digit nine}", 
s@entry=0x7fffea6af1d1 "\\N{digit nine}'", len=, 
len@entry=14, t=t@entry=0x7fffea606910) at Parser/string_parser.c:118
#3  0x00645675 in _PyPegen_parsestr (p=p@entry=0x7fffea5e45d0, 
bytesmode=bytesmode@entry=0x7fffc838, rawmode=rawmode@entry=0x7fffc83c, 
result=result@entry=0x7fffc848, 
fstr=fstr@entry=0x7fffc850, fstrlen=fstrlen@entry=0x7fffc858, 
t=0x7fffea606910) at Parser/string_parser.c:269
#4  0x00644163 in _PyPegen_concatenate_strings 
(p=p@entry=0x7fffea5e45d0, strings=strings@entry=0x94e310) at 
Parser/action_helpers.c:896
#5  0x004791e6 in strings_rule (p=p@entry=0x7fffea5e45d0) at 
Parser/parser.c:15463
#6  0x0047c498 in atom_rule (p=p@entry=0x7fffea5e45d0) at 
Parser/parser.c:14274
#7  0x0047e159 in primary_raw (p=0x7fffea5e45d0) at 
Parser/parser.c:13908
#8  primary_rule (p=p@entry=0x7fffea5e45d0) at Parser/parser.c:13706

--
components: Interpreter Core
files: ucnbug.c
messages: 416432
nosy: christian.heimes, lukasz.langa, pablogsal, vstinner
priority: high
severity: normal
status: open
title: _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer
type: crash
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50708/ucnbug.c

___
Python tracker 

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



[issue47179] pymalloc should align to max_align_t

2022-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

On my x86-64 Fedora 35, gcc says 32 bytes for sizeof(max_align_t). By the way, 
g++ also says 32 bytes for sizeof(std::max_align_t).

GCC 11.2.1 defines max_align_t as:
---
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
  || (defined(__cplusplus) && __cplusplus >= 201103L)
#ifndef _GCC_MAX_ALIGN_T
#define _GCC_MAX_ALIGN_T
/* Type whose alignment is supported in every context and is at least
   as great as that of any standard type not using alignment
   specifiers.  */
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long;
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long 
double;
  /* _Float128 is defined as a basic type, so max_align_t must be
 sufficiently aligned for it.  This code must work in C++, so we
 use __float128 here; that is only available on some
 architectures, but only on i386 is extra alignment needed for
 __float128.  */
#ifdef __i386__
  __float128 __max_align_f128 
__attribute__((__aligned__(__alignof(__float128;
#endif
} max_align_t;
#endif
#endif /* C11 or C++11.  */
---
file: /usr/lib/gcc/x86_64-redhat-linux/11/include/stddef.h

It's not an union but a structure with 2 fields (1 long long, 1 long double). 
The __i386__ macro is not defined on Linux x86-64, so the struct does not have 
the 3rd 128-bit float field.

align.c:
---
#include 
int main() { return sizeof(max_align_t); }
---

Build and run (C):
---
$ gcc align.c -o align && (./align; echo $?)
32
---


align.cpp:
---
int main() { return sizeof(std::max_align_t); }
---

Build and run (C++):
---
$ g++ align.cpp -o align && (./align; echo $?)
32
---

--

___
Python tracker 

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



[issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer

2022-03-31 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue47179] pymalloc should align to max_align_t

2022-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

Objects/obmalloc.c currently relies on the SIZEOF_VOID_P macro:
---
#if SIZEOF_VOID_P > 4
#define ALIGNMENT  16   /* must be 2^N */
#define ALIGNMENT_SHIFT 4
#else
#define ALIGNMENT   8   /* must be 2^N */
#define ALIGNMENT_SHIFT 3
#endif
---

If we want to respect sizeof(max_align_t) alignment, we can compute 
sizeof(max_align_t) in configure and uses the result in obmalloc.c. I expect 
that it's either 16 or 32, so we can maybe just hardcode ALIGNMENT_SHIFT using 
something like: "if == 32 ... #elif == 16 ... #else #error ...".

On x86 (32-bit) Fedora 35, gcc says 48 for sizeof(max_align_t) which is way 
larger than the current alignment to 8 bytes!

--

___
Python tracker 

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



[issue47179] pymalloc should align to max_align_t

2022-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, it seems like this issue is a duplicate of bpo-31912 created in 2017.

--

___
Python tracker 

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



[issue14911] generator.throw() documentation inaccurate

2022-03-31 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 8be7c2bc5ad5e295f0f855bb31db412eef2c7c92 by Dave Goncalves in 
branch 'main':
bpo-14911: Corrected generator.throw() documentation (GH-32207)
https://github.com/python/cpython/commit/8be7c2bc5ad5e295f0f855bb31db412eef2c7c92


--
nosy: +asvetlov

___
Python tracker 

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



[issue14911] generator.throw() documentation inaccurate

2022-03-31 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +30289
pull_request: https://github.com/python/cpython/pull/32213

___
Python tracker 

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



[issue14911] generator.throw() documentation inaccurate

2022-03-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30290
pull_request: https://github.com/python/cpython/pull/32214

___
Python tracker 

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



[issue47180] Remove unnecessary registration of weakref.WeakSet as a subtype of _collections_abc.Set

2022-03-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue47180] Remove unnecessary registration of weakref.WeakSet as a subtype of _collections_abc.Set

2022-03-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue14911] generator.throw() documentation inaccurate

2022-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset 625f6704c0d783360574bbab2f78b0b9bbed5891 by Miss Islington (bot) 
in branch '3.10':
bpo-14911: Corrected generator.throw() documentation (GH-32207)
https://github.com/python/cpython/commit/625f6704c0d783360574bbab2f78b0b9bbed5891


--

___
Python tracker 

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



[issue14911] generator.throw() documentation inaccurate

2022-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset 98d57737de73342d33d1b90dc0285f586465d22b by Miss Islington (bot) 
in branch '3.9':
bpo-14911: Corrected generator.throw() documentation (GH-32207)
https://github.com/python/cpython/commit/98d57737de73342d33d1b90dc0285f586465d22b


--

___
Python tracker 

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



[issue14911] generator.throw() documentation inaccurate

2022-03-31 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue47120] Make all jump opcodes relative

2022-03-31 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +30291
pull_request: https://github.com/python/cpython/pull/32215

___
Python tracker 

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



[issue47178] Improve the implementations of Sequence.index and MutableSequence.extend in collections.abc

2022-03-31 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Marking as closed because the changes are incorrect.  See the comments in the 
PR.

--
assignee:  -> rhettinger
nosy: +rhettinger
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



[issue47083] The __complex__ method is missing from the complex, float, and int built-in types

2022-03-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer

2022-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset 44e915028d75f7cef141aa1aada962465a5907d6 by Christian Heimes in 
branch 'main':
bpo-47182: Fix crash by named unicode characters after interpreter 
reinitialization (GH-32212)
https://github.com/python/cpython/commit/44e915028d75f7cef141aa1aada962465a5907d6


--
nosy: +miss-islington

___
Python tracker 

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



[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-31 Thread Enji Cooper

Enji Cooper  added the comment:

Grégory: that will fix this issue, but what I really need is some of the other 
changes, like moving the getaddrinfo logic into a separate route (connect).

--

___
Python tracker 

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



[issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer

2022-03-31 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30292
pull_request: https://github.com/python/cpython/pull/32216

___
Python tracker 

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



[issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer

2022-03-31 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30293
pull_request: https://github.com/python/cpython/pull/32217

___
Python tracker 

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



[issue47182] _PyUnicode_Fini should invalidate ucnhash_capi capsule pointer

2022-03-31 Thread Christian Heimes


Change by Christian Heimes :


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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-31 Thread Steve Dower


Steve Dower  added the comment:

Erlend - would you be up for write permissions on the cpython-source-deps repo 
so you can push the SQLite updates yourself.

As I've mentioned before, merging PRs into that repo isn't any easier than 
doing it directly (since you also need to check file hashes and add a tag), but 
doing it yourself is easier than waiting on me or Zach.

--

___
Python tracker 

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



[issue47146] PR check "Check if generated files are up to date" failing intermittently

2022-03-31 Thread Eric Snow


Eric Snow  added the comment:

I re-ran jobs that had failed before I merged that gh-32206.  Several passed, 
but the following are still failing:

* https://github.com/python/cpython/pull/32188
   + https://github.com/python/cpython/runs/5773938424
* https://github.com/python/cpython/pull/32132
   + https://github.com/python/cpython/runs/5774054192
* https://github.com/python/cpython/pull/32177
   + https://github.com/python/cpython/runs/5773949869

Back to the drawing board...

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue47146] PR check "Check if generated files are up to date" failing intermittently

2022-03-31 Thread Eric Snow


Eric Snow  added the comment:

Brandt pointed out this is consistently reproducible locally:

   make clean regen-all -j

I'll get this sorted out today.

--

___
Python tracker 

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



[issue32658] Metacharacter (\) documentation suggestion

2022-03-31 Thread mike mcleod


mike mcleod  added the comment:

After sync'ing to upstream/main and then running make html I get: ...
checking consistency... done
preparing documents... failed

Warning, treated as error:
unsupported theme option 'license_url' given
make: *** [Makefile:53: build] Error 2

I cant see anything from googling the error above.
This is before I have made any changes.

--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-31 Thread Erlend E. Aasland

Erlend E. Aasland  added the comment:

> Erlend - would you be up for write permissions on the cpython-source-deps 
> repo so you can push the SQLite updates yourself.

Yep, I’m fine with that.

--

___
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 public getter functions for the internal PyFrameObject structure

2022-03-31 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 74b95d86e0f14603f878c4df3133bc8a93f8f80a by Mark Shannon in 
branch 'main':
bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114)
https://github.com/python/cpython/commit/74b95d86e0f14603f878c4df3133bc8a93f8f80a


--

___
Python tracker 

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



[issue47183] Cant compile html docs

2022-03-31 Thread mike mcleod

New submission from mike mcleod :

After sync'ing to upstream/main and then
python/Doc on  main via 🐍 v3.11.0a6+ 
❯ make html
mkdir -p build
Building NEWS from Misc/NEWS.d with blurb
PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees   -W . build/html 
Running Sphinx v3.5.4
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 495 source files that are out of date
updating environment: [new config] 495 added, 0 changed, 0 removed
reading sources... [100%] whatsnew/index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... failed

Warning, treated as error:
unsupported theme option 'license_url' given
make: *** [Makefile:53: build] Error 2

No changes to source.

--
assignee: docs@python
components: Documentation
messages: 416448
nosy: docs@python, mikecmcleod
priority: normal
severity: normal
status: open
title: Cant compile html docs
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



[issue47183] Cant compile html docs

2022-03-31 Thread Zachary Ware


Zachary Ware  added the comment:

You have a rather old version of Sphinx; the 3.11 docs are built with v4.5.0.  
Try `make clean-venv venv html`?

--
nosy: +zach.ware

___
Python tracker 

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



[issue47172] Make virtual opcodes in the compiler negative and is_jump() identify only proper jumps

2022-03-31 Thread Irit Katriel


Change by Irit Katriel :


--
title: Make virtual opcodes in the compiler > 256 and is_jump() identify only 
proper jumps -> Make virtual opcodes in the compiler negative and is_jump() 
identify only proper jumps

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-31 Thread Steve Dower


Steve Dower  added the comment:

Done. Feel free to push directly to the repo, and bear in mind that changes may 
be reflected in any version build at any point, which is why we use tags 
(ahem... mostly... we've gotten it wrong before). Fourth field of the version 
number is our private one, so it gets incremented if we need to patch or 
re-release something, rather than changing the tag, unless we really do want to 
force change the tag.

Feel free to reach out if you have any questions. Otherwise, SQLite updates are 
all yours :)

--

___
Python tracker 

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



[issue47184] multiprocessing.set_start_method force argument is not documented

2022-03-31 Thread John Hagen


New submission from John Hagen :

multiprocessing.set_start_method() has a `force` argument that is not 
documented: 
https://docs.python.org/3.10/library/multiprocessing.html#multiprocessing.set_start_method

--
assignee: docs@python
components: Documentation
messages: 416451
nosy: John Hagen, docs@python
priority: normal
severity: normal
status: open
title: multiprocessing.set_start_method force argument is not documented
type: enhancement
versions: Python 3.10, Python 3.11, 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



[issue23325] Turn SIG_DFL and SIG_IGN into functions

2022-03-31 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue45886] Fix Program/_freeze_module for cross compiling Python

2022-03-31 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue47176] Interrupt handling for wasm32-emscripten builds without pthreads

2022-03-31 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7

2022-03-31 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-31 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks. I had wondered if this was really a pid=1 restriction or not, but I 
could definitely imagine kernel scenarios where vfork is simply forbidden 
regardless. There are a variety of policy mechanisms in kernels, mainline Linux 
or not, that _could_ do that kind of thing.

As much as I'd like to expose that the fallback happened, emitting to stderr 
isn't friendly and using warnings from this code is complicated so I'm inclined 
to keep the silent fallback on failure simple as is until someone can 
demonstrate of it causing a practical problem.

Outside of unusual configurations, if this were ever happening when it is not 
expected, people observing low subprocess performance could strace and witness 
the vfork syscall failure.

I'll merge once our CI is happy.

--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-31 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Great, thanks :)

--

___
Python tracker 

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



[issue47146] PR check "Check if generated files are up to date" failing intermittently

2022-03-31 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +30294
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32218

___
Python tracker 

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



[issue47183] Cant compile html docs

2022-03-31 Thread Zachary Ware


Change by Zachary Ware :


--
resolution:  -> works for me
status: open -> pending

___
Python tracker 

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



[issue47146] PR check "Check if generated files are up to date" failing intermittently

2022-03-31 Thread Eric Snow


Eric Snow  added the comment:


New changeset e7bb7c2f047b4f97e4426c42ae209c969808069d by Eric Snow in branch 
'main':
bpo-47146: Stop Depending On regen-deepfreeze For regen-global-objects 
(gh-32218)
https://github.com/python/cpython/commit/e7bb7c2f047b4f97e4426c42ae209c969808069d


--

___
Python tracker 

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



[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-31 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 4a08c4c469d36f99d3a5e0f17ad82ab35dcf2835 by Gregory P. Smith in 
branch 'main':
bpo-47151: Fallback to fork when vfork fails in subprocess. (GH-32186)
https://github.com/python/cpython/commit/4a08c4c469d36f99d3a5e0f17ad82ab35dcf2835


--

___
Python tracker 

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



[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-31 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +30295
pull_request: https://github.com/python/cpython/pull/32219

___
Python tracker 

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



[issue47146] PR check "Check if generated files are up to date" failing intermittently

2022-03-31 Thread Eric Snow


Eric Snow  added the comment:

I'll keep an eye on PRs for the next day or so.

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

___
Python tracker 

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



[issue47146] PR check "Check if generated files are up to date" failing intermittently

2022-03-31 Thread Eric Snow


Eric Snow  added the comment:

Specifically: https://github.com/python/cpython/actions/workflows/build.yml.

--
status: pending -> open

___
Python tracker 

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



[issue40469] TimedRotatingFileHandler rotating on use not time

2022-03-31 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

See this thread on Discuss:

https://discuss.python.org/t/logging-timedrotatingfilehandler-never-rotates-in-certain-cases/14747/1

--
nosy: +steven.daprano

___
Python tracker 

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



[issue46111] test_unittest fails in optimized mode

2022-03-31 Thread Ezio Melotti


Change by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue45099] asyncio.Task's documentation says that loop arg is removed when it's not

2022-03-31 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset ab89ccff3ca6efc2a8e6f5f45c30d568fb3d212f by Andrew Svetlov in 
branch 'main':
bpo-45099: Document asyncio internal API (GH-32166)
https://github.com/python/cpython/commit/ab89ccff3ca6efc2a8e6f5f45c30d568fb3d212f


--

___
Python tracker 

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



[issue45099] asyncio.Task's documentation says that loop arg is removed when it's not

2022-03-31 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset 9ed179b07df6ce7432f972f5d069a7c8dee56e79 by Miss Islington (bot) 
in branch '3.10':
bpo-47151: Fallback to fork when vfork fails in subprocess. (GH-32186)
https://github.com/python/cpython/commit/9ed179b07df6ce7432f972f5d069a7c8dee56e79


--

___
Python tracker 

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



[issue47120] Make all jump opcodes relative

2022-03-31 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +30296
pull_request: https://github.com/python/cpython/pull/32221

___
Python tracker 

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



[issue44159] mimetypes - "strict" on Windows

2022-03-31 Thread Mark Dong


Mark Dong  added the comment:

Hi, 

I want to follow up on this:

On Linux (Ubuntu 20.04.4 LTS), the module also loads everything it finds in the 
registries (a.k.a, entries in the "knownfiles" variable) in "strict" mode, even 
though some of them aren't registered in IANA. (I'm assuming that "registered 
in IANA" means everything in here only: 
https://www.iana.org/assignments/media-types/media-types.xhtml)

For example, ".com" is recognized as having mimetype 
"applications/x-msdos-program". This becomes problematic when an unparsed URL, 
such as "http://abc.efg/hij.html#http://abc.com";, is fed into guess_type.

I'm wondering if we should make the documentation clearer and state that 
"strict=True" means using IANA registered types along with the types found on 
the machine, it seems like this is the expected behavior based on the comments 
in "def _default_mime_types()", or we should actually move everything other 
than IANA registered types out of strict mode.

Best regards,
Mark

--
components:  -Windows
nosy: +markdtw
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



[issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior

2022-03-31 Thread Éric Araujo

Éric Araujo  added the comment:

I would like to know what Senthil is thinking before the PR with options à la 
carte are merged!

--

___
Python tracker 

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



[issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior

2022-03-31 Thread Ethan Furman


Ethan Furman  added the comment:

Sounds good.

--

___
Python tracker 

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



[issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior

2022-03-31 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

I will review this in a day. 
I had been following the conversation, but couldn't look deeper into the code.
Thank you for engaging and contributions.

--

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


Change by Brandt Bucher :


--
pull_requests: +30297
pull_request: https://github.com/python/cpython/pull/3

___
Python tracker 

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



[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2022-03-31 Thread EZ


EZ  added the comment:

First, I hope we all agree:
'C:\Windows' and '/usr/bin' == absolute path
'Windows' and 'bin' == relative path
'C:\Program Files' and '/bin' == absolute path
'C:\Windows\..\Program Files' and '/usr/../bin' == relative path

It is very confusing between these two, but despite claims otherwise, 
absolute() does not work as expected. However, to sum up the findings below: 
* absolute() fails to resolve paths with relative steps (esp "..") but will 
always add the dir structure even if the file doesn't exist.
* resolve() will always give an absolute path.
** unless the file doesn't exist -- 
** unless unless the path includes a '..'! 
* There's also a related problem with is_absolute() being incorrect with 
relative paths (such as '..'), which usually results in it saying 
absolute().is_absolute() is True when it is obviously False.

Done on Windows 10, python 3.9.5

>>> ini
WindowsPath('desktop.ini/..')
>>> ini.resolve().is_absolute()
True
>>> ini.absolute()
WindowsPath('C:/Users/zim/Downloads/desktop.ini/..')
>>> ini.absolute().is_absolute()
True

This second should not be True, there is a trailing '..' not resolved by 
absolute()

Now let's create a truly messy path:
>>> ini.resolve()
WindowsPath('C:/Users/zim/Downloads')
>>> ini = ini / "ntuser.ini"
>>> ini.exists()
False
>>> ini.resolve()
WindowsPath('C:/Users/zim/Downloads/ntuser.ini')
>>> ini = ini / "../ntuser.ini"
>>> ini.exists()
False
>>> ini.resolve()
WindowsPath('C:/Users/zim/Downloads/ntuser.ini')
>>> ini = ini / "../../ntuser.ini"
>>> ini.resolve()
WindowsPath('C:/Users/zim/ntuser.ini')
>>> ini.exists()
True
>>> ini.absolute()
WindowsPath('C:/Users/zim/Downloads/desktop.ini/../ntuser.ini/../ntuser.ini/../../ntuser.ini')
>>> ini.absolute().is_absolute()
True

absolute() not only doesn't give an absolute path, but is_absolute() is somehow 
ok with that.

Now a file that doesn't exist:
>>> mike = Path("palin.jpg")
>>> mike.resolve()
WindowsPath('palin.jpg')
>>> mike.resolve().is_absolute()
False
>>> mike.absolute()
WindowsPath('C:/Users/zim/Downloads/palin.jpg')
>>> mike.absolute().is_absolute()
True

Finally, absolute() is right about the right thing, but resolve() is not 
terribly wrong. is_absolute() is correctly False here (for once). 

The problem is that the after a resolve() call, a Path object can still be used 
to create a file (good), but if resolve() is used before file creation, then 
the full path will not be there as should be expected (bad). This seems like a 
bug with resolve()

What if a file is non existent AND relative? Things get more confusing.

>>> badrel = Path('../circus.jpg')
>>> badrel
WindowsPath('../circus.jpg')
>>> badrel.absolute()
WindowsPath('C:/Users/zim/Downloads/../circus.jpg')
>>> badrel.resolve()
WindowsPath('C:/Users/zim/circus.jpg')
>>> badrel.exists()
False

So, absolute() still acts like the normal trash fire it is with relative paths, 
but what's this, resolve() actually gives an absolute path?!

I should note resolve() only behaves unpredictably on Windows. It correctly 
resolves non-existent files no matter what on macOS and Linux (caveat: my linux 
test was done with python 3.6). However, absolute() always fails to distill 
paths with relative steps regardless of OS.

So, it seems clear:
Bug 1: resolve() should work the same with non-existent files with incomplete 
paths on Windows as it does on *nix platforms, as it does on Windows when 
handling existent files and non-existent ones with parent path notation.
Bug 2: Obviously if absolute() is supposed to be in the lib, it should be 
documented, and it likely should be distinct from resolve(), but most of all: 
it should return actual absolute paths! If these cannot be fulfilled, it should 
be set to be deprecated (after resolve() is fixed, hopefully)
Bug 3: is_absolute() should actually detect absolute paths, instead it seems to 
report True if the path contains a root starting point, but ignores relative 
changes in between. (this issue exists on all three major OSs)

--
nosy: +Zim -45757
versions: +Python 3.9

___
Python tracker 

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



[issue47120] Make all jump opcodes relative

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



[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-31 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue47120] Make all jump opcodes relative

2022-03-31 Thread Brandt Bucher


Brandt Bucher  added the comment:

Another benefit of this work is that we'll be able to remove `first_instr` from 
the eval loop.

--

___
Python tracker 

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



[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-31 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-31 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset d4bb38f82bf18b00db3129031ce4969b6f0caab9 by Andrew Svetlov in 
branch 'main':
bpo-47167: Allow overriding a future compliance check in asyncio.Task (GH-32197)
https://github.com/python/cpython/commit/d4bb38f82bf18b00db3129031ce4969b6f0caab9


--

___
Python tracker 

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



[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-31 Thread Yury Selivanov


Yury Selivanov  added the comment:

Sorry, I don't like the committed change and I think it should be reverted.

Futures and Tasks have a documented `get_loop()` method which simply should be 
called by Task machinery, without the need to expose (and document) private 
methods.

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



[issue45099] asyncio.Task's documentation says that loop arg is removed when it's not

2022-03-31 Thread Yury Selivanov


Yury Selivanov  added the comment:

> I have a feeling that we need a low-level API section that describes 
> *supported* API that is intended to task extenders only (guys who want to 
> provide an alternative task factory for example).

I'm not sure how exposing all private methods spiraled out of this issue. We 
haven't discussed documenting the low-level methods you just exposed Andrew. 
IMO this should be reverted.

--

___
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-31 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue47120] Make all jump opcodes relative

2022-03-31 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-31 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue23689] Memory leak in Modules/sre_lib.h

2022-03-31 Thread Ma Lin


Change by Ma Lin :


--
pull_requests: +30298
pull_request: https://github.com/python/cpython/pull/32223

___
Python tracker 

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



[issue39090] Document various options for getting the absolute path from pathlib.Path objects

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

Vedran Čačić  added the comment:

> First, I hope we all agree:
> 'C:\Windows\..\Program Files' and '/usr/../bin' == relative path

I don't agree. To me, absolute means regardless of a reference point. So, 
absolute path would be a path that refers to the same entity from whichever 
directory you reference it. And that is surely the case for these two.

--

___
Python tracker 

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