[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-03-14 Thread Jason R. Coombs


Change by Jason R. Coombs :


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



[issue47009] Streamline list.append for the common case

2022-03-14 Thread Inada Naoki


Inada Naoki  added the comment:

Hmm. Would you measure benefit from inlining and skipping incref/decref 
separately?

If benefit of inlining is very small, making _PyList_AppendTakeRef() as regular 
internal API looks better to me.

--
nosy: +methane

___
Python tracker 

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



[issue47007] [doc] str docs are inconsistent with special method lookup

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

Vedran Čačić  added the comment:

You mean `type(object).__str__(object)` instead of `type(object).__str__()`, 
obviously.

--
nosy: +veky

___
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-14 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +29963
pull_request: https://github.com/python/cpython/pull/31865

___
Python tracker 

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



[issue35228] Index search in CHM help crashes viewer

2022-03-14 Thread Inada Naoki


Inada Naoki  added the comment:

I know chm is handy. But Microsoft abandoned it already.
I think we should stop providing chm.

--

___
Python tracker 

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



[issue47010] Implement zero copy writes in SelectorSocketTransport in asyncio

2022-03-14 Thread Kumar Aditya


New submission from Kumar Aditya :

Currently, _SelectorSocketTransport transport creates a copy of the data before 
sending which in case of large amount of data, can create multiple giga bytes 
copies of data before sending.

Script demonstrating current behavior:

-

import asyncio
import memory_profiler

@memory_profiler.profile
async def handle_echo(reader: asyncio.StreamReader, writer: 
asyncio.StreamWriter):
data = b'x' * 1024 * 1024 * 1000 # 1000 MiB payload
writer.write(data)
await writer.drain()
writer.close()

async def main():
server = await asyncio.start_server(
handle_echo, '127.0.0.1', )

addrs = ', '.join(str(sock.getsockname()) for sock in server.sockets)
print(f'Serving on {addrs}')

async with server:
asyncio.create_task(server.start_serving())
reader, writer = await asyncio.open_connection('127.0.0.1', )
while True:
data = await reader.read(1024 * 1024 * 100)
if not data:
break

asyncio.run(main())
-

Memory profile result:

Filename: test.py

Line #Mem usageIncrement  Occurrences   Line Contents
=
 4 17.7 MiB 17.7 MiB   1   @memory_profiler.profile
 5 async def handle_echo(reader: 
asyncio.StreamReader, writer: asyncio.StreamWriter):
 6   1017.8 MiB   1000.1 MiB   1   data = b'x' * 1024 * 1024 * 
1000 # 1000 MiB payload
 7   2015.3 MiB997.5 MiB   1   writer.write(data)
 8   2015.3 MiB   -988.1 MiB   2   await writer.drain()
 9   1027.1 MiB   -988.1 MiB   1   writer.close()



To make it zero copy, python's buffer protocol can be used and use memory views 
of data to save RAM. The writelines method currently joins all the data before 
sending whereas it can use `socket.sendmsg` to make it more memory efficient.


Links:

- writelines - 
https://github.com/python/cpython/blob/2153daf0a02a598ed5df93f2f224c1ab2a2cca0d/Lib/asyncio/transports.py#L116

- socket.sendmsg - 
https://docs.python.org/3/library/socket.html#socket.socket.sendmsg

- memory_profiler -
https://pypi.org/project/memory-profiler/

--
components: asyncio
messages: 415124
nosy: asvetlov, gvanrossum, kumaraditya303, yselivanov
priority: normal
severity: normal
status: open
title: Implement zero copy writes in SelectorSocketTransport in asyncio
type: resource usage
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



[issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API

2022-03-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29964
pull_request: https://github.com/python/cpython/pull/31866

___
Python tracker 

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



[issue47011] Cloned turtle pen is not cleared completely

2022-03-14 Thread Learn Coding


New submission from Learn Coding :

When calling clear() method on a cloned turtle, some painted lines still remain 
on the screen.

--
components: Library (Lib)
files: testturtle.py
messages: 415125
nosy: learncoding
priority: normal
severity: normal
status: open
title: Cloned turtle pen is not cleared completely
versions: Python 3.10
Added file: https://bugs.python.org/file50673/testturtle.py

___
Python tracker 

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



[issue47011] Cloned turtle pen is not cleared completely

2022-03-14 Thread Learn Coding


Learn Coding  added the comment:

Tested on Windows 10

--

___
Python tracker 

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



[issue47009] Streamline list.append for the common case

2022-03-14 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

The attached _PyList_AppendTakeRef.diff has the ceval.c, but this 
implementation:

int
_PyList_AppendTakeRef(PyListObject *self, PyObject *newitem)
{
assert(self != NULL && newitem != NULL);
assert(PyList_Check(self));
Py_ssize_t len = PyList_GET_SIZE(self);
Py_ssize_t allocated = self->allocated;
assert((size_t)len + 1 < PY_SSIZE_T_MAX);
if (allocated > len) {
PyList_SET_ITEM(self, len, newitem);
Py_SET_SIZE(self, len + 1);
return 0;
}
if (list_resize(self, len + 1) < 0) {
Py_DECREF(newitem);
return -1;
}
PyList_SET_ITEM(self, len, newitem);
return 0;
}

Results:

| Benchmark   | main  | PR 31864  | 
_PyList_AppendTakeRef.diff |
|-|:-:|:-:|:--:|
| listcomp 100| 1.61 us   | 1.33 us: 1.21x faster | 1.55 us: 1.04x 
faster  |
| append 100  | 2.11 us   | 1.82 us: 1.15x faster | 2.05 us: 1.03x 
faster  |
| listcomp 1000   | 12.6 us   | 9.83 us: 1.28x faster | 11.9 us: 1.06x 
faster  |
| append 1000 | 18.1 us   | 15.3 us: 1.18x faster | 17.6 us: 1.03x 
faster  |
| listcomp 1  | 121 us| 93.2 us: 1.29x faster | 114 us: 1.06x 
faster   |
| append 1| 175 us| 150 us: 1.17x faster  | 172 us: 1.02x 
faster   |
| listcomp 10 | 1.17 ms   | 923 us: 1.26x faster  | 1.15 ms: 1.02x 
faster  |
| append 10   | 1.70 ms   | 1.49 ms: 1.14x faster | not significant 
   |
| Geometric mean  | (ref) | 1.21x faster  | 1.03x faster
   |

--
Added file: https://bugs.python.org/file50674/_PyList_AppendTakeRef.diff

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-14 Thread Maximilian Hils


Maximilian Hils  added the comment:

asvetlov: Sorry if I articulated myself badly, but I do think this is a valid 
bug. It's unfortunately hard to provide a better repro (I tried), but we are 
hitting this regularly when mitmproxy is accepting connections under heavy 
load. We're just calling `asyncio.start_server(handler, "127.0.0.1", 8080)` in 
mitmproxy and never interact with the underlying socket object.

Here are some observations that are true for all crashes:

- The socket fileno is -1 when it crashes.
- `_call_connection_lost` is called by `_ProactorBasePipeTransport.close`, 
which is called by `_ProactorBasePipeTransport.__del__` [1]
- There are no previous calls to `_call_connection_lost`.
- Windows only, loopback connections in our case.
- Wireshark shows that client and server are first happily exchanging packets. 
At some point the client sends a FIN, which the Python server ACKs immediately. 
A few seconds later the Python server sends a FIN back.


An obvious fix without understanding the root cause would be to check fileno in 
https://github.com/python/cpython/blob/d929aa70e2a324ea48fed221c3257f929be05115/Lib/asyncio/proactor_events.py#L161.
 I'm not too familar with proactor to assess if that is a good idea. Sorry for 
not being able to provide more details.


[1] 
https://github.com/python/cpython/blob/d929aa70e2a324ea48fed221c3257f929be05115/Lib/asyncio/proactor_events.py#L102-L116

--

___
Python tracker 

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



[issue47012] Speed up iteration of bytes and bytearray

2022-03-14 Thread Kumar Aditya


New submission from Kumar Aditya :

Benchmark and results are attached in the PR.

--
messages: 415129
nosy: gvanrossum, kumaraditya303
priority: normal
pull_requests: 29965
severity: normal
status: open
title: Speed up iteration of bytes and bytearray
type: performance
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



[issue43215] Document Happy Eyeballs arguments of asyncio.open_connection

2022-03-14 Thread Illia Volochii


Change by Illia Volochii :


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

___
Python tracker 

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



[issue43215] Document Happy Eyeballs arguments of asyncio.open_connection

2022-03-14 Thread Illia Volochii


Change by Illia Volochii :


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

___
Python tracker 

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



[issue40001] ignore errors in SimpleCookie

2022-03-14 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya
nosy_count: 3.0 -> 4.0
pull_requests: +29968
pull_request: https://github.com/python/cpython/pull/19214

___
Python tracker 

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



[issue40001] ignore errors in SimpleCookie

2022-03-14 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests:  -29968

___
Python tracker 

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



[issue40001] ignore errors in SimpleCookie

2022-03-14 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy:  -BTaskaya

___
Python tracker 

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



[issue46994] Accept explicit contextvars.Context in asyncio create_task() API

2022-03-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 9523c0d84f351a610dc651b234461eb015fa3b82 by Andrew Svetlov in 
branch 'main':
bpo-46994: Accept explicit contextvars.Context in asyncio create_task() API 
(GH-31837)
https://github.com/python/cpython/commit/9523c0d84f351a610dc651b234461eb015fa3b82


--

___
Python tracker 

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



[issue46994] Accept explicit contextvars.Context in asyncio create_task() API

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



[issue47010] Implement zero copy writes in SelectorSocketTransport in asyncio

2022-03-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Known problem, PR is welcome!
I expect the fix is not trivial.

--

___
Python tracker 

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



[issue46843] PersistentTaskGroup API

2022-03-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I think we should close the PR now.
I'm open to the discussion resurrection in Python 3.12 or 3.13, when aiotools 
implementation will be battle-tested.

--

___
Python tracker 

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



[issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId

2022-03-14 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset bb1c543f4a183f5cfdf15aad59f59094d50b37fd by Dong-hee Na in branch 
'main':
bpo-46987: Remove _PySys_GetObjectId / _PySys_GetObjectId (GH-31835)
https://github.com/python/cpython/commit/bb1c543f4a183f5cfdf15aad59f59094d50b37fd


--

___
Python tracker 

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



[issue46987] Remove _PySys_GetObjectId / _PySys_GetObjectId

2022-03-14 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue43215] Document Happy Eyeballs arguments of asyncio.open_connection

2022-03-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 649cc9d688f79765cf052429683b708678c26fbd by Illia Volochii in 
branch '3.9':
[3.9] bpo-43215: Document Happy Eyeballs args of asyncio.open_connection 
(GH-24525) (GH-31868)
https://github.com/python/cpython/commit/649cc9d688f79765cf052429683b708678c26fbd


--

___
Python tracker 

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



[issue43215] Document Happy Eyeballs arguments of asyncio.open_connection

2022-03-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset c6828408342cb1a2f8ba5038adccfbc1a95250cc by Illia Volochii in 
branch '3.10':
[3.10] bpo-43215: Document Happy Eyeballs args of asyncio.open_connection 
(GH-24525) (GH-31869)
https://github.com/python/cpython/commit/c6828408342cb1a2f8ba5038adccfbc1a95250cc


--

___
Python tracker 

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



[issue46991] Specialize list[slice]

2022-03-14 Thread Ken Jin


Change by Ken Jin :


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

___
Python tracker 

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



[issue47010] Implement zero copy writes in SelectorSocketTransport in asyncio

2022-03-14 Thread Kumar Aditya


Change by Kumar Aditya :


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

___
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-14 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset f00ced8396f2d7683e58b9d5ebbf5797992bf477 by Christian Heimes in 
branch 'main':
bpo-40280: select: Use NULL for empty fdset (GH-31865)
https://github.com/python/cpython/commit/f00ced8396f2d7683e58b9d5ebbf5797992bf477


--

___
Python tracker 

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



[issue45150] Add a file_digest() function in hashlib

2022-03-14 Thread Aur Saraf


Aur Saraf  added the comment:

Tarek,

Are you still working on this? Would you like me to take over?

Aur

--
nosy: +Aur.Saraf

___
Python tracker 

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



[issue42514] Relocatable framework for macOS

2022-03-14 Thread Shakeeb Alireza


Shakeeb Alireza  added the comment:

I have struggled with this exact issue in my py-js project 
(https://github.com/shakfu/py-js) which embeds a python3 interpreter in a 
max/msp plugin or in a relocatable folder (package) structure. For the latter 
case, Greg's solution, which is based on standard methods, has been absolutely 
crucial. Thank you!

I have found that trying to do the same with a python distro built with 
--enable-shared is basically impossible because in this case sys.prefix is 
hardcoded and it dos not respond (like the framework structure) to the same 
@rpath methods used by Greg.

It would be great for those who embed python for a fun or profit to have these 
issues addressed across all of the standard build structures.

--
nosy: +shakfu

___
Python tracker 

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



[issue45150] Add a file_digest() function in hashlib

2022-03-14 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

@Aur, go for it, I started to implement it and got lost into the details for 
each backend..

--

___
Python tracker 

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



[issue47011] Cloned turtle pen is not cleared completely

2022-03-14 Thread Learn Coding


Change by Learn Coding :


--
type:  -> behavior

___
Python tracker 

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



[issue18309] Make python slightly more relocatable

2022-03-14 Thread Shakeeb Alireza


Shakeeb Alireza  added the comment:

I have exactly the same need and use-case as Mathias in my project which 
includes a requirement to embed python3 in a relocatable folder structure w 
which serves as an application package (https://github.com/shakfu/py-js).

This can be done using the Framework structure, thanks to Greg Neagle's 
solution referenced in (https://bugs.python.org/issue42514), but not for any 
python builds with --enabled-shared.

In any case, providing options (at the c-level or otherwise, for embedded 
applications as described by Mathias would be ideal: "I can imagine to provide 
several functions to build up the pythonpath starting from something.
So say, have a 'get python path from argv[0]', a 'get python path from shared 
python library' and a 'get python path from prefix' function (I may miss a 
variant)."

--
nosy: +shakfu

___
Python tracker 

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



[issue45150] Add a file_digest() function in hashlib

2022-03-14 Thread Aur Saraf


Aur Saraf  added the comment:

OK, I'll give it a go.

--

___
Python tracker 

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



[issue46923] Implement stack overflow protection for supported platforms

2022-03-14 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

issue33955 is an older issue about implementing the current functionality for 
this on macOS, which has an API for querying stack limits.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue46991] Specialize list[slice]

2022-03-14 Thread Ken Jin


Ken Jin  added the comment:

Closed for now. See 
https://github.com/python/cpython/pull/31870#issuecomment-1066884537 for an 
explanation.

--
resolution:  -> rejected
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



[issue18309] Make python slightly more relocatable

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

In Python 3.11, Modules/getpath.c has been rewritten in Python: 
Modules/getpath.py. Maybe it's now simpler to hack this file. But you must 
rebuild Python to take changes in account.

--

___
Python tracker 

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



[issue37907] speed-up PyLong_As*() for large longs

2022-03-14 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

> So I think `encoding="locale"` should use real locale encoding (ACP on 
> Windows) regardless UTF-8 mode is enabled or not.

If you want to change the default, would it be possible to add a function to 
get this encoding?

--

___
Python tracker 

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



[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

There are multiple "locale encodings":

* "current" locale encoding: locale.nl_langinfo(locale.CODESET)
* "Python" locale encoding: locale.getpreferredencoding(False), ignore the 
locale in UTF-8 Mode (always return "UTF-8"), ignore the locale on Android and 
VxWorks (always return "UTF-8")
* Python "filesystem" encoding: similar to the Python locale encoding, but 
always use UTF-8 on Android, macOS and VxWorks

Include/pyport.h:
---
#if defined(__ANDROID__) || defined(__VXWORKS__)
   // Use UTF-8 as the locale encoding, ignore the LC_CTYPE locale.
   // See _Py_GetLocaleEncoding(), PyUnicode_DecodeLocale()
   // and PyUnicode_EncodeLocale().
#  define _Py_FORCE_UTF8_LOCALE
#endif

#if defined(_Py_FORCE_UTF8_LOCALE) || defined(__APPLE__)
   // Use UTF-8 as the filesystem encoding.
   // See PyUnicode_DecodeFSDefaultAndSize(), PyUnicode_EncodeFSDefault(),
   // Py_DecodeLocale() and Py_EncodeLocale().
#  define _Py_FORCE_UTF8_FS_ENCODING
#endif
---

See bpo-43552 "Add locale.get_locale_encoding() and 
locale.get_current_locale_encoding()" (rejected).

Marc-Andre Lemburg dislikes locale.getpreferredencoding(False) API and 
suggested adding a new function locale.getencoding() with no argument:
https://bugs.python.org/issue46659#msg412667

--

___
Python tracker 

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



[issue18309] Make python slightly more relocatable

2022-03-14 Thread Shakeeb Alireza


Shakeeb Alireza  added the comment:

Thanks, Victor. I can imagine getpath.py will be more hackable (even if it is 
frozen). 

Still, it replicates the old algorithm:

# Before any searches are done, the location of the executable is
# determined.  If Py_SetPath() was called, or if we are running on
# Windows, the 'real_executable' path is used (if known).  Otherwise,
# we use the config-specified program name or default to argv[0].

In my case (and I think for Mathias), the executable is a non python 
application and what is actually dynamically linking to libpythonX.Y.dylib 
(built via --enable-shared) is a c-based plugin (which calls PyInitialize()), 
and these two are only aware of their relative locations via the @rpath, 
@loader_path mechanism. 

Currently, in this scenario, libpythonX.Y.dylib doesn't know here pythonhome is 
unless explicitly told via PySetPath() or it defaults to the hardcoded 
sys.prefix .

If this is to be relocatable, then PySetPath() should be able to handle 
relative paths.

--

___
Python tracker 

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



[issue46843] PersistentTaskGroup API

2022-03-14 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay.

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



[issue37355] SSLSocket.read does a GIL round-trip for every 16KB TLS record

2022-03-14 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue40735] test_nntplib depends on unreliable external servers

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

It tomorrow a test_nntplib test fails too often, I suggest to simply skip it, 
since PEP 594 is accepted. Especially tests using external real NNTP servers.

--

___
Python tracker 

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



[issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 11c25b87aeed162d422bc18530fe9699f311e586 by Victor Stinner in 
branch 'main':
bpo-46906: Mention native endian in PyFloat_Pack8() doc (GH-31866)
https://github.com/python/cpython/commit/11c25b87aeed162d422bc18530fe9699f311e586


--

___
Python tracker 

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



[issue46906] Add PyFloat_(Pack|Unpack)(2|4|8) to the public C API

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

msgpack and bitstruct use the newly added functions: my two PRs got merged. 
msgpack was my main motivation to add these functions :-)

Thanks to great reviews, the functions got a new better documentation!

I close the issue. Thanks again for reviews!

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



[issue46920] Remove code made dead long ago with #if 0

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e885ac3d5f2fd83617ab75a098aab269b7a446c3 by Oleg Iarygin in 
branch 'main':
bpo-46920: Remove code that has no explainer why it was disabled (GH-31814)
https://github.com/python/cpython/commit/e885ac3d5f2fd83617ab75a098aab269b7a446c3


--

___
Python tracker 

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



[issue46920] Remove code made dead long ago with #if 0

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a52f82baf246e2fbbc58fe03ef7a51f3cc9514e1 by Oleg Iarygin in 
branch 'main':
 bpo-46920: Remove disabled debug code added decades ago and likely unnecessary 
(GH-31812)
https://github.com/python/cpython/commit/a52f82baf246e2fbbc58fe03ef7a51f3cc9514e1


--

___
Python tracker 

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



[issue46920] Remove code made dead long ago with #if 0

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 13b041222399152acb555337572bd1d571734984 by Oleg Iarygin in 
branch 'main':
bpo-46920: Remove code that has explainers why it was disabled (GH-31813)
https://github.com/python/cpython/commit/13b041222399152acb555337572bd1d571734984


--

___
Python tracker 

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



[issue46920] Remove code made dead long ago with #if 0

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Can this issue be closed? Or is there remaining dead code that you want to 
remove?

--

___
Python tracker 

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



[issue46587] datetime and time tests use non-portable "%4Y" format

2022-03-14 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue47013] 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang Installed 3.10

2022-03-14 Thread STINNER Victor


New submission from STINNER Victor :

Since build 298, test_bdb test_distutils fail on s390x Fedora Rawhide Clang 
Installed 3.10:
https://buildbot.python.org/all/#/builders/694/builds/298

2 changes of build 298:

* bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)(21 hours ago)
* [3.10] bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819) (GH-31849)(21 
hours ago)

Logs:

0:02:03 load avg: 9.95 [213/427/1] test_distutils failed (uncaught exception) 
-- running: test_concurrent_futures (42.4 sec)
test test_distutils crashed -- Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/libregrtest/runtest.py",
 line 335, in _runtest_inner
refleak = _runtest_inner2(ns, test_name)
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/libregrtest/runtest.py",
 line 280, in _runtest_inner2
the_module = importlib.import_module(abstest)
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/importlib/__init__.py",
 line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1050, in _gcd_import
  File "", line 1027, in _find_and_load
  File "", line 1006, in _find_and_load_unlocked
  File "", line 688, in _load_unlocked
  File "", line 883, in exec_module
  File "", line 241, in _call_with_frames_removed
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/test_distutils.py",
 line 15, in 
import distutils.tests
ModuleNotFoundError: No module named 'distutils.tests'

==
FAIL: test_skip (test.test_bdb.StateTestCase)
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/test_bdb.py",
 line 730, in test_skip
with TracerRun(self, skip=skip) as tracer:
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/test_bdb.py",
 line 448, in __exit__
self.test_case.fail(err_msg)
  File 
"/home/dje/cpython-buildarea/3.10.edelsohn-fedora-rawhide-z.clang-installed/build/target/lib/python3.10/test/test_bdb.py",
 line 582, in fail
raise self.failureException(msg) from None
AssertionError: Wrong event type at expect_set item 2, got 'call'
  Expected: ('line', 3, 'tfunc_import')
  Got:  ('call', 84, 'find_spec'),  ('quit',),

--
components: Tests
messages: 415157
nosy: vstinner
priority: normal
severity: normal
status: open
title: 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang 
Installed 3.10
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



[issue47013] 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang Installed 3.10

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Reproduce:

$ ./configure --prefix /opt/py310 && make clean && make && make install 
$ cd /somewhere/else/
$ /opt/py310/bin/python3 -m test -v test_bdb
...
FAIL: test_skip (test.test_bdb.StateTestCase)
...
$ /opt/py310/bin/python3 -m test -v test_distutils 
...
ModuleNotFoundError: No module named 'distutils.tests'
...

setuptools installs this file:

$ cat /opt/py310/lib/python3.10/site-packages/distutils-precedence.pth
import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 
'local') == 'local'; enabled and __import__('_distutils_hack').add_shim();

--

___
Python tracker 

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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

This update broke the "s390x Fedora Rawhide Clang Installed 3.10" buildbot: 
bpo-47013.

--
nosy: +vstinner

___
Python tracker 

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



[issue47013] 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang Installed 3.10

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

See: [BUG] Having setuptools installed causes cpython stdlib build to fail
https://github.com/pypa/setuptools/issues/3007

--

___
Python tracker 

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



[issue47013] test_bdb and test_distutils fail on installed Python 3.9 and 3.10 (setuptools 60.9.3, pip 22.0.4)

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

x86 Gentoo Installed with X 3.9:
https://buildbot.python.org/all/#builders/527/builds/474

4 tests failed:
test_bdb test_distutils test_importlib test_peg_generator

Python 3.9 gets two more issues: test_importlib and test_peg_generator.

==
FAIL: test_package_discovery (test.test_importlib.test_main.DiscoveryTests)
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/cpython/3.9.ware-gentoo-x86.installed/build/target/lib/python3.9/test/test_importlib/test_main.py",
 line 159, in test_package_discovery
assert all(
AssertionError

0:06:27 load avg: 3.96 [ 83/425/3] test_peg_generator failed (uncaught 
exception) -- running: test_multiprocessing_forkserver (1 min 27 sec)
Warning -- warnings.filters was modified by test_peg_generator
Failed to import test module: test.test_peg_generator.test_c_parser
Traceback (most recent call last):
  File 
"/buildbot/buildarea/cpython/3.9.ware-gentoo-x86.installed/build/target/lib/python3.9/unittest/loader.py",
 line 436, in _find_test_path
module = self._get_module_from_name(name)
  File 
"/buildbot/buildarea/cpython/3.9.ware-gentoo-x86.installed/build/target/lib/python3.9/unittest/loader.py",
 line 377, in _get_module_from_name
__import__(name)
  File 
"/buildbot/buildarea/cpython/3.9.ware-gentoo-x86.installed/build/target/lib/python3.9/test/test_peg_generator/test_c_parser.py",
 line 4, in 
from distutils.tests.support import TempdirManager
ModuleNotFoundError: No module named 'distutils.tests'

--
title: 3.10: test_bdb test_distutils fail on s390x Fedora Rawhide Clang 
Installed 3.10 -> test_bdb and test_distutils fail on installed Python 3.9 and 
3.10 (setuptools 60.9.3, pip 22.0.4)

___
Python tracker 

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



[issue47013] test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4)

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

AMD64 Fedora Stable Clang Installed 3.x:
https://buildbot.python.org/all/#builders/350/builds/1621

2 re-run tests:
test_bdb test_distutils

--
title: test_bdb and test_distutils fail on installed Python 3.9 and 3.10 
(setuptools 60.9.3, pip 22.0.4) -> test_bdb and test_distutils fail on 
installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4)
versions: +Python 3.11, Python 3.9

___
Python tracker 

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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

> This update broke the "s390x Fedora Rawhide Clang Installed 3.10" buildbot: 
> bpo-47013.

test_bdb and test_distutils fail on 3.9, 3.10 and main branches when run on an 
installed Python. I didn't check Python 3.7.

--

___
Python tracker 

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



[issue47013] test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4)

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

> $ ./configure --prefix /opt/py310 && make clean && make && make install 
> $ cd /somewhere/else/
> $ /opt/py310/bin/python3 -m test -v test_bdb

I also reproduce test_bdb and test_distutils failures on the main branch.

--

___
Python tracker 

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



[issue45786] Avoid allocating when exiting frame; it may be unsafe.

2022-03-14 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 2.0 -> 3.0
pull_requests: +29972
pull_request: https://github.com/python/cpython/pull/31874

___
Python tracker 

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



[issue46920] Remove code made dead long ago with #if 0

2022-03-14 Thread Oleg Iarygin


Change by Oleg Iarygin :


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



[issue31415] Add -X option to show import time

2022-03-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-14 Thread Steve Dower


Steve Dower  added the comment:

> If it's already turning into a rewrite, how feasible would it be to adopt 
> Brett's `py` launcher?

I looked at it already, and I'd have to write literally the same code to 
implement what's needed :) (as well as learning Rust and convincing everyone to 
let us use Rust in CPython...). Practically nothing can be reused - there's no 
registry, no shebang handling, and our process launching on Windows is already 
very complex (and has to remain that way for compatibility).

For now, the old launcher will remain to be used for venv redirectors, but I've 
got the setup in the new one to be able to play the same role, as well as 
potentially being able to be a script or .pyz launcher with a simple rename.

If Brett's proposal for extensions (other executables on PATH that know how to 
identify Python installs) happens, we'll probably copy it, though PEP 514 
covers Windows adequately (and the rewrite allows non-PythonCore installs to be 
found/launched). But the codebase itself isn't helpful.

--

___
Python tracker 

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



[issue46920] Remove code made dead long ago with #if 0

2022-03-14 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Oleg Iarygin for the cleanup!

--

___
Python tracker 

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



[issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file

2022-03-14 Thread Steve Dower


Steve Dower  added the comment:

>> Why can't the filename of the "foo"-like file in the test be
>> simply os_helper.TESTFN, as done in some other tests?
> 
> I suppose the current working directory will be fine. I was looking to keep 
> the test on a NTFS filesystem, with known behavior, but there's no hard 
> guarantee that the user's temp directory is on the system volume.

All tests should use the current working directory, or the test helper 
for getting other directories. *Do not look up other directories*, 
because it prevents test runners from ensuring that tests run in valid 
locations (and skips implicit tests for directories with spaces/Unicode 
characters/etc.)

--

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-14 Thread Paul Moore


Paul Moore  added the comment:

> as well as potentially being able to be a script or .pyz launcher with a 
> simple rename.

Would it be possible to also make the launcher work when prepended to a 
zipfile? That's a really useful use-case (make a zipapp automatically runnable, 
but still a single file) that at the moment needs a 3rd party launcher (Vinay's 
simple-launcher project).

If not, then that's fine, but if we're already doing a significant rewrite that 
might be a good time to add it.

--

___
Python tracker 

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



[issue47014] ProactorEventLoop ignores Ctrl+C after closing unrelated loop

2022-03-14 Thread Maximilian Hils


New submission from Maximilian Hils :

When a (second) ProactorEventLoop is garbage-collected, the current 
ProactorEventLoop starts to ignore Ctrl+C on Windows until it is woken up. The 
attached repro shows a minimal example. Uncommenting the `create_task` call or 
not using a second event loop fixes the behavior.

I couldn't find any shared/global objects in asyncio/windows_events.py, so I'm 
not sure what is causing this, or why the wakeup task helps.

FWIW, the second event loop in our code base originated from a stray 
`get_event_loop()` call, one more example that speaks in favor of 
`get_running_loop()`!

--
components: asyncio
files: proactor-repro.py
messages: 415169
nosy: asvetlov, mhils, yselivanov
priority: normal
severity: normal
status: open
title: ProactorEventLoop ignores Ctrl+C after closing unrelated loop
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50675/proactor-repro.py

___
Python tracker 

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



[issue31415] Add -X option to show import time

2022-03-14 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 29624e769c5c3c1e59c6acc8b69383ead53e8a9f by Victor Stinner in 
branch 'main':
bpo-31415: importtime was made by Inada Naoki (GH-31875)
https://github.com/python/cpython/commit/29624e769c5c3c1e59c6acc8b69383ead53e8a9f


--

___
Python tracker 

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



[issue47001] deadlock in ctypes?

2022-03-14 Thread Rocco Matano


Rocco Matano  added the comment:

I forgot to say thank you. I would like to make up for that:
Thank you, Eryk.

--

___
Python tracker 

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



[issue18309] Make python slightly more relocatable

2022-03-14 Thread Mathias Fröhlich

Mathias Fröhlich  added the comment:

Hey,

Shakeeb Alireza is right, the original problem was an application that links 
and embeds against libpython*{so,dll,dynlib} and should more easily find 
components like /*/lib*/python*.*/site.py and most probably now it needs to 
find getpath.py as well.

While I am no longer working on that application where I wanted to have that 
feature, I still believe it would be worthwhile to find the *.py files in the 
file system relative to the location of the libpython*{so,dll,dynlib} file.

Thanks for taking care.

Mathias

--

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-14 Thread Steve Dower


Steve Dower  added the comment:

I'd like to, the main challenge with that is it'd invalidate the code signature 
on the file, which will make it basically unusable (at the very least, you'll 
get warnings). A simple rename does not.

But yeah, it can probably go in. Hopefully my restructure will make it easier 
to follow where certain things get checked.

--

___
Python tracker 

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



[issue46950] Windows 11, VENV not working with case sensitive windows paths

2022-03-14 Thread Darrel O'Pry


Darrel O'Pry  added the comment:

I've done some additional troubleshooting today. I have case sensitivity 
enabled in my git checkouts where I am creating the virtual env. I do this for 
a more consistent cross-platform experience for managing code with team members 
also using linux and macos. I have had issues in the past with case changes in 
filenames causing issue on projects and enabling case sensitivity has eliminate 
these issues when working with my counterparts on other platforms. 


I've tested the following with both powershell and bash. 

```
mkdir test-venv-case-sensitivity
cd test-venv-case-sensitivity
fsutil.exe file setCaseSensitiveInfo . enable
python -m venv ./venv
./venv/Scripts/Activate.ps1
pip # you should get the error "No module named 'pip'
cd ./venv/
fsutil.exe file setCaseSensitiveInfo . disable
pip # the command now works
```

This wasn't an issue prior to upgrading to Windows 11, so something may have 
changed in the handling of the case sensitivity flag on Windows. 

I have a venv created on windows 10, prior to my windows 11 upgrade that does 
work. 

I didn't encounter the issue until setting up an installation of Python 3.9.10 
to support another project, then trying to create a new 3.10.2 venv. 

I can work around the issue by specifically disabling case sentitivity in my 
venv folders, but it would be nice if venvs worked out of the box with case 
sensitive filesytems on windows. 


It seems like some code is making assumptions about case sensitivity on 
windows. 




I found that if I disable case sensitivity in the venv folder, the venv starts 
working again.

--
title: Windows 11 venv -> Windows 11, VENV not working with case sensitive 
windows paths

___
Python tracker 

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



[issue46890] getpath problems with framework build

2022-03-14 Thread Steve Dower


Steve Dower  added the comment:

The sys module gets initialised in _PySys_UpdateConfig() in Python/sysmodule.c. 
It gets called later in pylifecycle.c. But it ought to just copy directly from 
the config.

However, it's the site.py module that actually updates sys.prefix for the venv. 
So you may just be inspecting at the wrong point? Or possibly it's in a 
codepath that doesn't run on macOS because *previously* it was being set 
correctly in getpath instead of being deferred until later?

--

___
Python tracker 

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



[issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file

2022-03-14 Thread Eryk Sun


Eryk Sun  added the comment:

I was following the pattern of StatAttributeTests.test_access_denied(), which 
uses the current user's temp directory to get a filesystem that supports 
security. 

It would probably be better to skip tests if the filesystem of the current 
working directory doesn't support the test, e.g. if it needs NTFS or needs 
support for security, hard links, or reparse points. For example, 
Win32JunctionTests should be skipped if reparse points aren't supported. The 
os_helper module could implement a function that calls GetVolumeInformationW() 
to get the filesystem name (e.g. "Ntfs") and flags (e.g. FILE_PERSISTENT_ACLS, 
FILE_SUPPORTS_HARD_LINKS, FILE_SUPPORTS_REPARSE_POINTS).

--

___
Python tracker 

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



[issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file

2022-03-14 Thread Steve Dower


Steve Dower  added the comment:

> It would probably be better to skip tests if the filesystem of the current 
> working directory doesn't support the test, 

Yes, this would be good. Then whoever is configuring the test runner can 
move where tests are run to make sure it is supported. There are command 
line options specifically for this, that also correctly handle 
multiprocessing.

Tests that bypass the CWD make this unfixable by the runner, which is 
why they should just use CWD.

--

___
Python tracker 

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



[issue47008] Add Lib/site-packages to .gitignore

2022-03-14 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-14 Thread Brett Cannon


Brett Cannon  added the comment:

"Practically nothing can be reused - there's no registry, no shebang handling, 
and our process launching on Windows is already very complex (and has to remain 
that way for compatibility)."

I do process the shebang to restrict searching, or did you mean something else?

And registry support [is 
planned](https://github.com/brettcannon/python-launcher/issues/15).

--

___
Python tracker 

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



[issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist

2022-03-14 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 879fbd9472753149b627f32add3ddca90ac47ab7 by slateny in branch 
'main':
bpo-30677: [doc] mention that os.mkdir() can raise FileNotFoundError (GH-31548)
https://github.com/python/cpython/commit/879fbd9472753149b627f32add3ddca90ac47ab7


--
nosy: +iritkatriel

___
Python tracker 

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



[issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist

2022-03-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +29974
pull_request: https://github.com/python/cpython/pull/31877

___
Python tracker 

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



[issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist

2022-03-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29975
pull_request: https://github.com/python/cpython/pull/31878

___
Python tracker 

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



[issue47013] test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4)

2022-03-14 Thread Ned Deily


Ned Deily  added the comment:

(The buildbot failures were triggered by yesterday's merges for Issue46986 
which updated the bundled setuptools in ensurepip. I'm reverting those merges 
now to unblock planned releases.)

--
nosy: +jaraco, ned.deily
versions: +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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-14 Thread Steve Dower


Steve Dower  added the comment:

> I do process the shebang to restrict searching, or did you mean something 
> else?

That's what I meant. Guess I missed seeing it when scanning the code (probably 
I should've read the docs :D )

> And registry support [is 
> planned](https://github.com/brettcannon/python-launcher/issues/15).

It's attached to a milestone with no due date and 0% completion ;) Being aware 
that you'll need to do it isn't the same as planning to do it.

--

___
Python tracker 

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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread Ned Deily


Ned Deily  added the comment:

My apologies for not testing running the test suite with installed Pythons as I 
usually do and thanks, Victor, for noting the buildbot failures. I'm reverting 
these setuptools updates to avoid blocking releases. We can track the issue 
with setuptools in bpo-47013.

--

___
Python tracker 

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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +29976
pull_request: https://github.com/python/cpython/pull/31879

___
Python tracker 

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



[issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac

2022-03-14 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I've had the same issue and fixed it with:

  brew remove --ignore-dependencies gettext

@Ned thanks for help!

--
nosy: +andrei.avk

___
Python tracker 

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



[issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac

2022-03-14 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> third party
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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread Ned Deily


Ned Deily  added the comment:


New changeset 19f69993ae97db0bbea3b845a33b060b73b658b3 by Ned Deily in branch 
'main':
Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31879)
https://github.com/python/cpython/commit/19f69993ae97db0bbea3b845a33b060b73b658b3


--

___
Python tracker 

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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue47015] Update tests from asyncore to asyncio

2022-03-14 Thread Oleg Iarygin

New submission from Oleg Iarygin :

PEP 594 – Removing dead batteries from the standard library [1] removes 
asyncore and asynchat in 3.12 with the following note:

> The asyncore module is also used in stdlib tests. The tests for ftplib, 
> logging, smptd, smtplib, and ssl are partly based on asyncore. These tests 
> must be updated to use asyncio or threading.

(Note: the tests for `os` module are not mentioned and smtpd will be removed in 
3.12 along with its tests anyway)

I'm performing the update now to avoid keeping asynchat and asyncore as private 
subpackages of `test` package.

[1] https://peps.python.org/pep-0594/

--
components: Tests
messages: 415185
nosy: arhadthedev
priority: normal
severity: normal
status: open
title: Update tests from asyncore to asyncio
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue47015] Update tests from asyncore to asyncio

2022-03-14 Thread Oleg Iarygin


Change by Oleg Iarygin :


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

___
Python tracker 

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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist

2022-03-14 Thread miss-islington


miss-islington  added the comment:


New changeset efa72501599029d9ac3f8a2e5ce900302c7d8f56 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-30677: [doc] mention that os.mkdir() can raise FileNotFoundError 
(GH-31548) (GH-31877)
https://github.com/python/cpython/commit/efa72501599029d9ac3f8a2e5ce900302c7d8f56


--

___
Python tracker 

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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +29980
pull_request: https://github.com/python/cpython/pull/31882

___
Python tracker 

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



[issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist

2022-03-14 Thread miss-islington


miss-islington  added the comment:


New changeset b4fd91b4d931dd97ceaf76750d227dd042c236f8 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-30677: [doc] mention that os.mkdir() can raise FileNotFoundError 
(GH-31548) (GH-31878)
https://github.com/python/cpython/commit/b4fd91b4d931dd97ceaf76750d227dd042c236f8


--

___
Python tracker 

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



[issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist

2022-03-14 Thread Irit Katriel


Change by Irit Katriel :


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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread Ned Deily


Ned Deily  added the comment:


New changeset 80cc10fa7d5f41daaf59ae9173022303f35a403c by Ned Deily in branch 
'3.7':
Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31882)
https://github.com/python/cpython/commit/80cc10fa7d5f41daaf59ae9173022303f35a403c


--

___
Python tracker 

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



[issue31415] Add -X option to show import time

2022-03-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 12.0 -> 13.0
pull_requests: +29981
pull_request: https://github.com/python/cpython/pull/31883

___
Python tracker 

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



[issue31415] Add -X option to show import time

2022-03-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29982
pull_request: https://github.com/python/cpython/pull/31884

___
Python tracker 

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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread Ned Deily


Ned Deily  added the comment:


New changeset 0cfcc0cbee4a0d48c412169f46b7199728fb298a by Ned Deily in branch 
'3.10':
Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31880)
https://github.com/python/cpython/commit/0cfcc0cbee4a0d48c412169f46b7199728fb298a


--

___
Python tracker 

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



[issue46986] Upgrade ensurepip bundled setuptools to 60.9.3

2022-03-14 Thread Ned Deily


Ned Deily  added the comment:


New changeset 1b1239205d1b7ace1b054477c14fe77d54f471c4 by Ned Deily in branch 
'3.9':
Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31881)
https://github.com/python/cpython/commit/1b1239205d1b7ace1b054477c14fe77d54f471c4


--

___
Python tracker 

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



  1   2   >