[issue44011] Borrow asyncio ssl implementation from uvloop

2022-02-25 Thread Kumar Aditya


Change by Kumar Aditya :


--
pull_requests: +29720
pull_request: https://github.com/python/cpython/pull/31597

___
Python tracker 

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



[issue46859] NameError: free variable 'outer' referenced before assignment in enclosing scope

2022-02-25 Thread Norman Fung


Norman Fung  added the comment:

Also, i reverted back to python 3.8.5 and overwrote task.py as recommended.
I think that version we dont already have "GenericAlias".

import asyncio
  File "C:\ProgramData\Anaconda3\lib\asyncio\__init__.py", line 8, in

from .base_events import *
  File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 45, in

from . import staggered
  File "C:\ProgramData\Anaconda3\lib\asyncio\staggered.py", line 11, in

from . import tasks
  File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 20, in 
from types import GenericAlias
ImportError: cannot import name 'GenericAlias' from 'types'
(C:\ProgramData\Anaconda3\lib\types.py)

On Sat, Feb 26, 2022 at 3:20 PM Norman Fung  wrote:

>
> Norman Fung  added the comment:
>
> Thanks Andrew for heads up.
>
> *1. My laptop (Windows 10) *with no changes runs happily with no error from
> here.
> python 3.8.5
> asyncio 3.4.3
>
> 2. *My Windows VM (AWS EC2)* is where the whole mess is happening. I
> *upgraded
> *from Python 3.8.5 to 3.9.7. Asynio stayed 3.4.3, no change.
>
> I manually overwrite C:\ProgramData\Anaconda3\Lib\asyncio\task.py with
> what's here https://github.com/python/cpython/pull/31441/files
> (Only
>
> https://github.com/asvetlov/cpython/blob/150ef068c77abc6a5e7ba97397ac65113dba355a/Lib/asyncio/tasks.py
> )
>
> Before I made this change, the error was:
>   File "src\xxx\xxx.py", line 37, in _invoke_runners
> one_loop.run_until_complete(runner.xxx(xxx, xxx))
>   File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
> 90, in run_until_complete
> self._run_once()
>   File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
> 127, in _run_once
> handle._run()
>   File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
> 196, in run
> ctx.run(self._callback, *self._args)
>   File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 356, in
> _set_state
> _copy_future_state(other, future)
>   File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 335, in
> _copy_future_state
> dest.set_result(result)
>   File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 237, in
> set_result
> self.__schedule_callbacks()
>   File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 149, in
> __schedule_callbacks
> self._loop.call_soon(callback, self, context=ctx)
> Traceback (most recent call last):
>   File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
> 196, in run
> ctx.run(self._callback, *self._args)
>   File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 762, in
> _done_callback
> if outer.done():
> NameError: free variable 'outer' referenced before assignment in enclosing
> scope
>
> After I upgraded python to 3.9.7 and overwrite task.py, a different error
> (but also in asyncio stack):
>
> 2022-02-26 06:48:27,047 casin0: @slack algo_order.id: 13 #8 Algo tick
> level
> error casin0 uat  Non-thread-safe operation invoked
> on an event loop other than the current one Traceback (most recent call
> last):
>   File "C:\dev\xxx.py", line 547, in xxx
> await asyncio.sleep(algo.param.interval_ms / 1000)
>   File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 651, in sleep
> h = loop.call_later(delay,
>   File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 714, in
> call_later
> timer = self.call_at(self.time() + delay, callback, *args,
>   File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 727, in
> call_at
> self._check_thread()
>   File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 785, in
> _check_thread
> raise RuntimeError(
> RuntimeError: Non-thread-safe operation invoked on an event loop other than
> the current one
>
> On Sat, Feb 26, 2022 at 2:36 PM Andrew Svetlov 
> wrote:
>
> >
> > Andrew Svetlov  added the comment:
> >
> > Also, fix is 1 week old. There are no python releases with the fix
> > included yet.
> >
> > On Sat, Feb 26, 2022, 06:58 Norman Fung  wrote:
> >
> > >
> > > Norman Fung  added the comment:
> > >
> > > Thanks Jelle, let me try upgrade first.
> > >
> > > Norman
> > >
> > > On Sat, Feb 26, 2022 at 9:27 AM Jelle Zijlstra  >
> > > wrote:
> > >
> > > >
> > > > Jelle Zijlstra  added the comment:
> > > >
> > > > 3.8 is only receiving security fixes now. Please upgrade. If you
> cannot
> > > > upgrade, I suggest manually applying the patch from
> > > > https://github.com/python/cpython/pull/31441/files to your
> > installation
> > > > of Python.
> > > >
> > > > --
> > > > nosy: +Jelle Zijlstra
> > > > resolution:  -> out of date
> > > > stage:  -> resolved
> > > > status: open -> closed
> > > >
> > > > ___
> > > > Python tracker 
> > > > 
> > > > ___
> > > >
> > >
> > > --
> > >
> > > ___
> > > Python tracker 
> > > 

[issue46430] intern strings in deepfrozen modules

2022-02-25 Thread Kumar Aditya


Change by Kumar Aditya :


--
pull_requests: +29719
pull_request: https://github.com/python/cpython/pull/31596

___
Python tracker 

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



[issue46859] NameError: free variable 'outer' referenced before assignment in enclosing scope

2022-02-25 Thread Norman Fung


Norman Fung  added the comment:

Thanks Andrew for heads up.

*1. My laptop (Windows 10) *with no changes runs happily with no error from
here.
python 3.8.5
asyncio 3.4.3

2. *My Windows VM (AWS EC2)* is where the whole mess is happening. I *upgraded
*from Python 3.8.5 to 3.9.7. Asynio stayed 3.4.3, no change.

I manually overwrite C:\ProgramData\Anaconda3\Lib\asyncio\task.py with
what's here https://github.com/python/cpython/pull/31441/files
(Only
https://github.com/asvetlov/cpython/blob/150ef068c77abc6a5e7ba97397ac65113dba355a/Lib/asyncio/tasks.py
)

Before I made this change, the error was:
  File "src\xxx\xxx.py", line 37, in _invoke_runners
one_loop.run_until_complete(runner.xxx(xxx, xxx))
  File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
90, in run_until_complete
self._run_once()
  File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
127, in _run_once
handle._run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
196, in run
ctx.run(self._callback, *self._args)
  File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 356, in
_set_state
_copy_future_state(other, future)
  File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 335, in
_copy_future_state
dest.set_result(result)
  File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 237, in
set_result
self.__schedule_callbacks()
  File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 149, in
__schedule_callbacks
self._loop.call_soon(callback, self, context=ctx)
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
196, in run
ctx.run(self._callback, *self._args)
  File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 762, in
_done_callback
if outer.done():
NameError: free variable 'outer' referenced before assignment in enclosing
scope

After I upgraded python to 3.9.7 and overwrite task.py, a different error
(but also in asyncio stack):

2022-02-26 06:48:27,047 casin0: @slack algo_order.id: 13 #8 Algo tick level
error casin0 uat  Non-thread-safe operation invoked
on an event loop other than the current one Traceback (most recent call
last):
  File "C:\dev\xxx.py", line 547, in xxx
await asyncio.sleep(algo.param.interval_ms / 1000)
  File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 651, in sleep
h = loop.call_later(delay,
  File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 714, in
call_later
timer = self.call_at(self.time() + delay, callback, *args,
  File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 727, in
call_at
self._check_thread()
  File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 785, in
_check_thread
raise RuntimeError(
RuntimeError: Non-thread-safe operation invoked on an event loop other than
the current one

On Sat, Feb 26, 2022 at 2:36 PM Andrew Svetlov 
wrote:

>
> Andrew Svetlov  added the comment:
>
> Also, fix is 1 week old. There are no python releases with the fix
> included yet.
>
> On Sat, Feb 26, 2022, 06:58 Norman Fung  wrote:
>
> >
> > Norman Fung  added the comment:
> >
> > Thanks Jelle, let me try upgrade first.
> >
> > Norman
> >
> > On Sat, Feb 26, 2022 at 9:27 AM Jelle Zijlstra 
> > wrote:
> >
> > >
> > > Jelle Zijlstra  added the comment:
> > >
> > > 3.8 is only receiving security fixes now. Please upgrade. If you cannot
> > > upgrade, I suggest manually applying the patch from
> > > https://github.com/python/cpython/pull/31441/files to your
> installation
> > > of Python.
> > >
> > > --
> > > nosy: +Jelle Zijlstra
> > > resolution:  -> out of date
> > > stage:  -> resolved
> > > status: open -> closed
> > >
> > > ___
> > > Python tracker 
> > > 
> > > ___
> > >
> >
> > --
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue46712] Share global string identifiers in deepfreeze

2022-02-25 Thread Kumar Aditya


Change by Kumar Aditya :


--
pull_requests: +29718
pull_request: https://github.com/python/cpython/pull/31596

___
Python tracker 

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



[issue46861] os.environ forces variable names to upper case on Windows

2022-02-25 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> os.environ should preserve the case of the OS keys ?

___
Python tracker 

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



[issue28824] os.environ should preserve the case of the OS keys ?

2022-02-25 Thread Eryk Sun


Change by Eryk Sun :


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



[issue46859] NameError: free variable 'outer' referenced before assignment in enclosing scope

2022-02-25 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Also, fix is 1 week old. There are no python releases with the fix
included yet.

On Sat, Feb 26, 2022, 06:58 Norman Fung  wrote:

>
> Norman Fung  added the comment:
>
> Thanks Jelle, let me try upgrade first.
>
> Norman
>
> On Sat, Feb 26, 2022 at 9:27 AM Jelle Zijlstra 
> wrote:
>
> >
> > Jelle Zijlstra  added the comment:
> >
> > 3.8 is only receiving security fixes now. Please upgrade. If you cannot
> > upgrade, I suggest manually applying the patch from
> > https://github.com/python/cpython/pull/31441/files to your installation
> > of Python.
> >
> > --
> > nosy: +Jelle Zijlstra
> > resolution:  -> out of date
> > stage:  -> resolved
> > status: open -> closed
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-25 Thread Barney Gale


Barney Gale  added the comment:

Should pkgutil call os.fspath() in this case?

--
nosy: +barneygale

___
Python tracker 

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



[issue46862] subprocess makes environment blocks with duplicate keys on Windows

2022-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

I suggest closing this issue as a duplicate of bpo-43702.

--

___
Python tracker 

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



[issue43702] [Windows] correctly sort and remove duplicates in _winapi getenvironment()

2022-02-25 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue46862] subprocess makes environment blocks with duplicate keys on Windows

2022-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

This should be handled in _winapi.CreateProcess(). An environment block is 
technically required to be sorted. (Ages ago this was a MUST requirement for 
getting and setting variables to work correctly, since the implementation 
depended on the sort order, but I think nowadays it's a SHOULD requirement.) 
For example, see the documentation of CreateProcessW() [1]:

If an application provides an environment block, ... explicitly create
these environment variable strings, sort them alphabetically (because
the system uses a sorted environment)

"Changing Environment Variables" is more specific [2]:

All strings in the environment block must be sorted alphabetically by name.
The sort is case-insensitive, Unicode order, without regard to locale.

CompareStringOrdinal() [3] implements a case-insensitive ordinal comparison. 
When a key compares as equal, either keep the current one in the sorted list, 
or replace it with the new key.

---

[1] 
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw
[2] 
https://docs.microsoft.com/en-us/windows/win32/procthread/changing-environment-variables
[3] 
https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-comparestringordinal

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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread Ned Deily

Ned Deily  added the comment:

“I would like to know what environment is the official recommendation for 
static python3.7 compilation.”

There is no official recommendation. As I’ve mentioned, we normally do not 
build with modified Modules/Setup configurations when developing and releasing 
Python. It’s complicated. That’s why setup.py and using Distutils to build the 
standard library modules was introduced years ago. Most users don’t need a 
statically linked Python. Please accept that you need to look elsewhere for 
assistance.

--
status: open -> closed

___
Python tracker 

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



[issue46863] Python 3.10 OpenSSL Configuration Issues

2022-02-25 Thread Adam Pinckard

New submission from Adam Pinckard :

Python 3.10 does not appear to respecting the OpenSSL configuration within 
linux. Testing completed using Pyenv on both Ubuntu 20.04.4 and Centos-8. Note 
PEP 644 which requires OpenSSL >= 1.1.1 is released in Python 3.10.

We operate behind a corporate proxy / firewall which causes an SSL error where 
the Diffie-Hellman key size is too small. In previous Python versions this is 
resolved by updating the OpenSSL configuration, e.g. downgrading the linux 
crypto policies `sudo update-crypto-policies --set LEGACY`. 

The issue is reproducible in both Ubuntu 20.04.4 and Centos-8. In both linux 
distributions the SSL error is resolvable in earlier Python version, using the 
OpenSSL configurations, but the configuration is not respected with Python 
3.10.2.

See the details below on the kernel versions, linux distributions, and Openssl 
versions, many thanks in advance.

1. Python 3.10.2 Error:
(py_3_10_2) ➜  py_3_10_2 pip install --upgrade pip
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: 
DH_KEY_TOO_SMALL] dh key too small (_ssl.c:997)'))': /simple/pip/

2. Ubuntu details
uname -a
Linux Horatio 5.13.0-30-generic #33~20.04.1-Ubuntu SMP Mon Feb 7 14:25:10 UTC 
2022 x86_64 x86_64 x86_64 GNU/Linux

lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:Ubuntu 20.04.4 LTS
Release:20.04
Codename:   focal

openssl version -a
OpenSSL 1.1.1f  31 Mar 2020
built on: Wed Nov 24 13:20:48 2021 UTC
platform: debian-amd64
options:  bn(64,64) rc4(16x,int) des(int) blowfish(ptr) 
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -Wa,--noexecstack -g 
-O2 -fdebug-prefix-map=/build/openssl-dnfdFp/openssl-1.1.1f=. 
-fstack-protector-strong -Wformat -Werror=format-security 
-DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC 
-DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT 
-DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM 
-DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM 
-DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time 
-D_FORTIFY_SOURCE=2
OPENSSLDIR: "/usr/lib/ssl"
ENGINESDIR: "/usr/lib/x86_64-linux-gnu/engines-1.1"
Seeding source: os-specific

2. Centos-8 details
uname -a
Linux localhost.localdomain 5.4.181-1.el8.elrepo.x86_64 #1 SMP Tue Feb 22 
10:00:15 EST 2022 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/centos-release
CentOS Stream release 8

openssl version -a
OpenSSL 1.1.1k  FIPS 25 Mar 2021
built on: Thu Dec  2 16:40:48 2021 UTC
platform: linux-x86_64
options:  bn(64,64) md2(char) rc4(16x,int) des(int) idea(int) blowfish(ptr) 
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -O2 -g -pipe 
-Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS 
-fexceptions -fstack-protector-strong -grecord-gcc-switches 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-Wa,--noexecstack -Wa,--generate-missing-build-notes=yes 
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -DOPENSSL_USE_NODELETE -DL_ENDIAN 
-DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT 
-DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM 
-DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM 
-DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DZLIB -DNDEBUG 
-DPURIFY -DDEVRANDOM="\"/dev/urandom\"" 
-DSYSTEM_CIPHERS_FILE="/etc/crypto-policies/back-ends/openssl.config"
OPENSSLDIR: "/etc/pki/tls"
ENGINESDIR: "/usr/lib64/engines-1.1"
Seeding source: os-specific
engines:  rdrand dynamic

--
assignee: christian.heimes
components: SSL
messages: 414072
nosy: adam, christian.heimes
priority: normal
severity: normal
status: open
title: Python 3.10 OpenSSL Configuration Issues
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue46858] mmap constructor resets the file pointer on Windows

2022-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

The resize() method also modifies the file pointer. Instead of fixing that 
oversight, I think it should directly set the file's FileEndOfFileInfo and 
FileAllocationInfo. For example:

// resize the file
if (!SetFileInformationByHandle(
self->file_handle, FileEndOfFileInfo,
_size, sizeof(max_size)) ||
  !SetFileInformationByHandle(
self->file_handle, FileAllocationInfo,
_size, sizeof(max_size)))
{
// resizing failed. try to remap the file
file_resize_error = GetLastError();
max_size.QuadPart = self->size;
new_size = self->size;
}

This is cheaper in terms of system calls. The existing implementation makes 
four system calls: one to set the file pointer in SetFilePointerEx() and three 
in SetEndOfFile(), which queries the file pointer, sets the end-of-file info, 
and sets the allocation info. 

Note that this approach doesn't modify the file pointer in any case. This may 
be surprising if the file size shrinks to less than the existing file pointer. 
But os.ftruncate() behaves the same way, as does the resize() method in Linux.

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



[issue46859] NameError: free variable 'outer' referenced before assignment in enclosing scope

2022-02-25 Thread Norman Fung


Norman Fung  added the comment:

Thanks Jelle, let me try upgrade first.

Norman

On Sat, Feb 26, 2022 at 9:27 AM Jelle Zijlstra 
wrote:

>
> Jelle Zijlstra  added the comment:
>
> 3.8 is only receiving security fixes now. Please upgrade. If you cannot
> upgrade, I suggest manually applying the patch from
> https://github.com/python/cpython/pull/31441/files to your installation
> of Python.
>
> --
> nosy: +Jelle Zijlstra
> resolution:  -> out of date
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread aprpp


aprpp <916495...@qq.com> added the comment:

I'm really sorry, I would like to know what environment is the official 
recommendation for static python3.7 compilation? What are the steps and 
commands for compilation officially required? Because the static python3.7 is 
very important to me, it has been a week and it has not been compiled 
successfully.Hope to get official help.Thanks

--
status: closed -> open

___
Python tracker 

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



[issue46862] subprocess makes environment blocks with duplicate keys on Windows

2022-02-25 Thread benrg


New submission from benrg :

On Windows, if one writes

env = os.environ.copy()
env['http_proxy'] = 'whatever'

or either of the documented equivalents ({**os.environ, ...} or (os.environ | 
{...})), and passes the resulting environment to subprocess.run or 
subprocess.Popen, the spawned process may get an environment containing both 
`HTTP_PROXY` and `http_proxy`. Most Win32 software will see only the first one, 
which contains the unmodified value from os.environ.

Because os.environ forces all keys to upper case, it's possible to work around 
this by using only upper case keys in the update, but that behavior of 
os.environ is nonstandard (issue 46861), and subprocess shouldn't depend on it 
always being true, nor should end users have to.

Since dicts preserve order, the user's (presumable) intent is preserved in the 
env argument. I think subprocess should do something like

env = {k.upper(): (k, v) for k, v in env.items()}
env = dict(env.values())

to discard duplicate keys, keeping only the rightmost one.

--
components: Library (Lib), Windows
messages: 414068
nosy: benrg, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: subprocess makes environment blocks with duplicate keys on Windows
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue45735] Promise the long-time truth that `args=list` works

2022-02-25 Thread Tim Peters


Tim Peters  added the comment:


New changeset e466faa9df9a1bd377d9725de5484471bc4af8d0 by Charlie Zhao in 
branch 'main':
bpo-45735: Promise the long-time truth that `args=list` works (GH-30982)
https://github.com/python/cpython/commit/e466faa9df9a1bd377d9725de5484471bc4af8d0


--

___
Python tracker 

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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread Ned Deily


Ned Deily  added the comment:

P.S. One other suggestion: try building a non-static version of Python 3.7 
first, i.e. without modifying Modules/Setup, and, once you get that working, it 
should be easier to examine the output from the build and copy those paths that 
setup.py found into your Modules/Setup.

--

___
Python tracker 

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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread Ned Deily


Ned Deily  added the comment:

Sorry, I'll repeat: "Successfully building a statically-linked version of 
Python depends greatly on the environment in which you are trying to build it 
and is really beyond the scope of this bug tracker." Note, a quick web search 
found this page which should give you some suggestions on what dev packages 
need to be installed in an Ubuntu 18.04 environment. But also note that the 
directions there are for a normal, non-static Python build using setup.py and 
not Modules/Setup which, again, we don't normally test for 3.7. Good luck!

https://linuxize.com/post/how-to-install-python-3-7-on-ubuntu-18-04/

--
status: open -> closed

___
Python tracker 

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



[issue46861] os.environ forces variable names to upper case on Windows

2022-02-25 Thread benrg


New submission from benrg :

The Windows functions that deal with environment variables are case-insensitive 
and case-preserving, like most Windows file systems. Many environment variables 
are conventionally written in all caps, but others aren't, such as 
`ProgramData`, `PSModulePath`, and `windows_tracing_logfile`.

os.environ forces all environment variable names to upper case when it's 
constructed. One consequence is that if you pass a modified environment to 
subprocess.Popen, you end up with variables named `PROGRAMDATA`, etc., even if 
you didn't modify their values.

While this is unlikely to break things since other software normally ignores 
the case, it's nonstandard behavior, and disconcerting when the affected 
variable names are shown to human beings.

Here's an example of someone being confused by this: 
https://stackoverflow.com/questions/19023238/why-python-uppercases-all-environment-variables-in-windows

--
components: Library (Lib), Windows
messages: 414064
nosy: benrg, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.environ forces variable names to upper case on Windows
type: behavior
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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread aprpp


aprpp <916495...@qq.com> added the comment:

As shown in the attachment, how should I add the definition of module _ctypes 
to Modules/Setup? Modules like _ctypes are not given in Modules/Setup.dist, I 
really don't know what they depend on

--
Added file: https://bugs.python.org/file50644/Setup.PNG

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-25 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

> ./configure --enabled-shared --with-py-debug --with-trace-refs

(that's what I get for typing from memory):
./configure --enable-shared --with-pydebug --with-trace-refs

> > I proposed GH-31594 to fix this macro.
>
> Even using that change, I still have negative refs (but I still have
> Py_TRACE_REFS defined)

I initially missed the _PySet_Dummy change, with that total refs (w/o
dump_refs) is now 0.

--

___
Python tracker 

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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread aprpp

aprpp <916495...@qq.com> added the comment:

The platform i build python3.7.12 on is Ubuntu18.04, I would like to know how 
the modules I fail to build, like _ctypes, should be added in Modules/Setup.
The steps for my build are:
1.tar -zxvf Python-3.7.12.tgz && cd Python-3.7.12 
2.edit Modules/Setup, add modules build definitions in the Modules/Setup
3../configure LDFLAGS="-static" --disable-shared --prefix=/home/python3
4.make LDFLAGS="-static" LINKFORSHARED=" "

How to build python3.7 statically without relying on editing Modules/Setup?

--

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-25 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

> Oh wow. How did you find this leak? Did you read all C files and check for 
> code specific to Windows? How did you proceed? Well spotted!

Initially, I modified Py_INCREF to dump the object (addr & tp_name) on
initial inc (ob_refcnt == 1) and Py_DECREF to dump on final dec
(ob_refcnt == 0).
Then filter that list (~65K) to find objects not dealloc'ed.  Given
those names (~200), cross-check with source files containing 'ifdef
MS_WINDOWS' (and related spellings).

> Which command do you type? Do you pass -I option to Python?

For both as -I disables environment lookup:
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -757,6 +757,7 @@ config_init_defaults(PyConfig *config)
config->user_site_directory = 1;
config->buffered_stdio = 1;
config->pathconfig_warnings = 1;
+   config->dump_refs = 1;
#ifdef MS_WINDOWS
config->legacy_windows_stdio = 0;
#endif

For linux:
./configure --enabled-shared --with-py-debug --with-trace-refs
make build_all
LD_LIBRARY_PATH=$PWD ./python -X showrefcount -I -c pass

For Windows:
Add "#define Py_TRACE_REFS 1" to PC\pyconfig.h
build.bat -d -e
amd64\python_d.exe -X showrefcount -I -c pass

> I proposed GH-31594 to fix this macro.

Even using that change, I still have negative refs (but I still have
Py_TRACE_REFS defined)

--
nosy: +jeremy.kloth

___
Python tracker 

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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread aprpp


Change by aprpp <916495...@qq.com>:


--
status: closed -> open

___
Python tracker 

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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread Ned Deily


Ned Deily  added the comment:

Successfully building a statically-linked version of Python depends greatly on 
the environment in which you are trying to build it and is really beyond the 
scope of this bug tracker. You don't say on which OS platform and version you 
are attempting this so it is hard to give any meaningful suggestions other than 
to make sure you have installed development versions (those including header 
files) of the various third-party libraries Python builds depend on (like 
libssl and libcrypto from OpenSSL), if your platform has a package manager, or 
build the required third-party libraries yourself. In any case, you will 
probably need to further edit the Setup file to reflect the location of the 
various third-party headers and libraries. As a rule, we don't do a lot of 
testing of static builds using Setup directly but some of the downstream 
distributors of Python do. Also note that Python 3.7 is now in the 
security-fix-only phase of its lifecycle prior to end-of-life in 2023, so 
further changes 
 to the build process in 3.7 at this point would be out-of-scope. For what it's 
worth, there has been a significant amount of work in this area that is going 
into the next Python feature release, 3.11.0, planned for later this year so it 
should be significantly easier to do static builds and the like in 3.11. If you 
still run into problems with 3.7, suggest you ask in help forums like 
StackOverflow.  Good luck!

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-25 Thread STINNER Victor


STINNER Victor  added the comment:

> Good news, the difference on Windows was easy enough to find, bad news total 
> refs are now negative!

Oh wow. How did you find this leak? Did you read all C files and check for code 
specific to Windows? How did you proceed? Well spotted!


>  #define INIT_ALIAS(NAME, TYPE)

I proposed GH-31594 to fix this macro.


> Strange as well, when using dump_refs, the total refs are much more negative 
> (-12 linux, -13 Windows)

Which command do you type? Do you pass -I option to Python?

With my PR, I get exactly 0 on Linux:

$ ./python -I -X showrefcount -c pass
[0 refs, 0 blocks]


> Note that an allocated block is still leaking.

Right, with my PR, I now get 1 leaked memory block on Windows:

> python -I -X showrefcount -c pass   
[0 refs, 1 blocks]

--

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-25 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29717
pull_request: https://github.com/python/cpython/pull/31594

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-25 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Note that an allocated block is still leaking.

Strange as well, when using dump_refs, the total refs are much more negative 
(-12 linux, -13 Windows)

--

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-25 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Good news, the difference on Windows was easy enough to find, bad news total 
refs are now negative!

--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -3647,8 +3647,7 @@ _PyBuiltins_AddExceptions(PyObject *bltinmod)

 #define INIT_ALIAS(NAME, TYPE) \
 do { \
-Py_INCREF(PyExc_ ## TYPE); \
-Py_XDECREF(PyExc_ ## NAME); \
+Py_XSETREF(PyExc_ ## NAME, PyExc_ ## TYPE); \
 PyExc_ ## NAME = PyExc_ ## TYPE; \
 if (PyDict_SetItemString(mod_dict, # NAME, PyExc_ ## NAME)) { \
 return -1; \

As the PyExc_* aliases just deprecated names for PyExc_OSError, there is no 
need to increment their refcounts.  Or they could be decremented in Fini().  Or 
they could finally be removed entirely.

--
nosy: +jkloth

___
Python tracker 

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



[issue46859] NameError: free variable 'outer' referenced before assignment in enclosing scope

2022-02-25 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

3.8 is only receiving security fixes now. Please upgrade. If you cannot 
upgrade, I suggest manually applying the patch from 
https://github.com/python/cpython/pull/31441/files to your installation of 
Python.

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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread aprpp


aprpp <916495...@qq.com> added the comment:

I  have signed the contributor agreement

--

___
Python tracker 

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



[issue46748] Python.h includes stdbool.h

2022-02-25 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset 2c228a7b8f89e9ed8d390370abd771d4993b79d8 by Petr Viktorin in 
> branch 'main':
> bpo-46748: Don't import  in public headers (GH-31553)

It seems like this change broke ctypes on some architectures like s390x:

https://buildbot.python.org/all/#/builders/3/builds/1573

==
FAIL: test_frozentable (ctypes.test.test_values.PythonValuesTestCase) 
[__phello_alias__]
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/ctypes/test/test_values.py",
 line 86, in test_frozentable
self.assertIsNone(spec.submodule_search_locations)
^^
AssertionError: [] is not None
==
FAIL: test_frozentable (ctypes.test.test_values.PythonValuesTestCase) 
[__phello__]
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/ctypes/test/test_values.py",
 line 86, in test_frozentable
self.assertIsNone(spec.submodule_search_locations)
^^
AssertionError: 
['/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/__phello__']
 is not None
==
FAIL: test_frozentable (ctypes.test.test_values.PythonValuesTestCase) 
[__phello__.ham]
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/ctypes/test/test_values.py",
 line 86, in test_frozentable
self.assertIsNone(spec.submodule_search_locations)
^^
AssertionError: 
['/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/__phello__/ham']
 is not None

--
nosy: +vstinner

___
Python tracker 

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



[issue46838] Parameters and arguments parser syntax error improvments

2022-02-25 Thread Andrej Klychin


Andrej Klychin  added the comment:

@terry.reedy, I based that error message on current >>> foo(**{}, *())
SyntaxError: iterable argument unpacking follows keyword argument unpacking

and >>> foo(__debug__=True)
SyntaxError: cannot assign to __debug__

but the final error message could be anything if it explicitly says "what's 
wrong".

--

___
Python tracker 

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



[issue46838] Parameters and arguments parser syntax error improvments

2022-02-25 Thread Andre Roberge


Change by Andre Roberge :


--
nosy: +aroberge

___
Python tracker 

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



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

2022-02-25 Thread Brett Cannon


Change by Brett Cannon :


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

___
Python tracker 

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



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

2022-02-25 Thread Brett Cannon


New submission from Brett Cannon :

If you use `--with-suffix` on a case-insensitive file system it is ultimately 
ignored and forced to `.exe`.

PR incoming.

--
assignee: brett.cannon
components: Build
messages: 414051
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: `--with-suffix` not respected on case-insensitive file systems
type: behavior

___
Python tracker 

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



[issue46852] Remove the float.__setformat__() method

2022-02-25 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29715
pull_request: https://github.com/python/cpython/pull/31592

___
Python tracker 

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



[issue46852] Remove the float.__setformat__() method

2022-02-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5ab745fc51e159ead28b523414e52f0bcc1ef353 by Victor Stinner in 
branch 'main':
bpo-46852: Remove the float.__set_format__() method (GH-31585)
https://github.com/python/cpython/commit/5ab745fc51e159ead28b523414e52f0bcc1ef353


--

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2022-02-25 Thread STINNER Victor


STINNER Victor  added the comment:

I close again the issue, the C API should now be fine :-)

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



[issue46841] Inline bytecode caches

2022-02-25 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +29714
pull_request: https://github.com/python/cpython/pull/31591

___
Python tracker 

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



[issue46859] NameError: free variable 'outer' referenced before assignment in enclosing scope

2022-02-25 Thread Norman Fung


New submission from Norman Fung :

In reference to ticket (which was fix for Python 3.9 or above) 
https://bugs.python.org/issue46672?@ok_message=msg%20413975%20created%0Aissue%2046672%20nosy_count%2C%20nosy%2C%20messages%2C%20message_count%20edited%20ok&@template=item

I encountered this problem on:
a) Python 3.8.5
b) asyncio 3.4.3

Stack
Exception in callback gather.._done_callback() at C:\ProgramData\Anaconda3\lib\asyncio\tasks.py:758
handle: ._done_callback() 
at C:\ProgramData\Anaconda3\lib\asyncio\tasks.py:758 created at 
C:\ProgramData\Anaconda3\lib\asyncio\futures.py:149>
source_traceback: Object created at (most recent call last):
  File "src\x.py", line 37, in _invoke_runners
one_loop.run_until_complete(runner.x)
  File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line 90, 
in run_until_complete
self._run_once()
  File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line 127, 
in _run_once
handle._run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line 196, 
in run
ctx.run(self._callback, *self._args)
  File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 356, in 
_set_state
_copy_future_state(other, future)
  File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 335, in 
_copy_future_state
dest.set_result(result)
  File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 237, in 
set_result
self.__schedule_callbacks()
  File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 149, in 
__schedule_callbacks
self._loop.call_soon(callback, self, context=ctx)
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line 196, 
in run
ctx.run(self._callback, *self._args)
  File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 762, in 
_done_callback
if outer.done():
NameError: free variable 'outer' referenced before assignment in enclosing scope

--
components: asyncio
messages: 414048
nosy: asvetlov, miss-islington, norman.lm.fung, onerandomusername, sobolevn, 
yselivanov
priority: normal
severity: normal
status: open
title: NameError: free variable 'outer' referenced before assignment in 
enclosing scope
type: crash
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



[issue46816] Remove declarations for non-__STDC__ compilers

2022-02-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4060111f9dc44682f9d7bdafb4e7dacb96706ad3 by Oleg Iarygin in 
branch 'main':
bpo-46816: Remove declarations for non-__STDC__ compilers (GH-31466)
https://github.com/python/cpython/commit/4060111f9dc44682f9d7bdafb4e7dacb96706ad3


--

___
Python tracker 

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



[issue46816] Remove declarations for non-__STDC__ compilers

2022-02-25 Thread STINNER Victor


STINNER Victor  added the comment:

It should be fine :-D Thanks.

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



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

2022-02-25 Thread Inada Naoki


Inada Naoki  added the comment:

>
>
> Do you propose to
> 1. Only use StringKeyDicts when non-string keys are not possible?  (Where
> would this be?)
> 2. Switch to a normal dict when a non-string key is added?  (But likely
> not switch back when the last non-string key is removed.)
> 3. Deprecate and remove the option to add non-string keys to namespace
> dicts?  (Proposed and rejected at least once as not gaining much.)
>
>
>

2. We already do such hack for key sharing dict.
And yes, deleting non string key doesn't switch back. d[0]=0; del d[0];
loop must be amortized O(1).
Only dict.clear() switches back.

--

___
Python tracker 

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



[issue46838] Parameters and arguments parser syntax error improvments

2022-02-25 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue46856] datetime.max conversion

2022-02-25 Thread Eric V. Smith


Eric V. Smith  added the comment:

Probably so. You could step through the code to make sure that's what's going 
on.

--

___
Python tracker 

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



[issue46856] datetime.max conversion

2022-02-25 Thread Joris Geysens


Joris Geysens  added the comment:

I see this in the python source code being tested (datetimetester.py), so I 
guess it is a rounding problem : 

# maximum timestamp: set seconds to zero to avoid rounding issues
max_dt = self.theclass.max.replace(tzinfo=timezone.utc,
   second=0, microsecond=0)
max_ts = max_dt.timestamp()
# date -12-31 23:59:00+00:00: timestamp 253402300740
self.assertEqual(self.theclass.fromtimestamp(max_ts, tz=timezone.utc),
 max_dt)

--
components: +Library (Lib)

___
Python tracker 

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



[issue46854] Failed to compile static python3.7.12

2022-02-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +ned.deily

___
Python tracker 

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



[issue46849] Memory problems detected using Valgrind

2022-02-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

It is possible that some core developer may get regular valgrind reports, but I 
would not know who.  I am pretty sure that you should run it at least on the 
latest release of the 'main' branch, 3.11.0a5, and perhaps even better, the 
current tip.  There might be a performance patch that was not backported.  (I 
have no idea what iotop is.)

--
nosy: +terry.reedy

___
Python tracker 

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



[issue46855] printing a string with strange characters loops forever

2022-02-25 Thread svilen dobrev


svilen dobrev  added the comment:

aha. ctrl-s also closes it.
seems kind-of ( ctrl-q - ctrl-s )
 https://en.wikipedia.org/wiki/Software_flow_control

thanks, closing this.

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



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

2022-02-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

CPython, at least, allows users to insert non-string keys in namespace dicts 
that are conceptually string-key only.

>>> globals()[0] = 'zero'
>>> globals()[0]
'zero'
>>> vars()
{'__name__': '__main__', ..., 0: 'zero'}

[This is for consenting adults only, as it prevents sorting keys and 
string-only operations on keys.
>>> dir()
...
TypeError: '<' not supported between instances of 'int' and 'str']
 
Do you propose to
1. Only use StringKeyDicts when non-string keys are not possible?  (Where would 
this be?)
2. Switch to a normal dict when a non-string key is added?  (But likely not 
switch back when the last non-string key is removed.)
3. Deprecate and remove the option to add non-string keys to namespace dicts?  
(Proposed and rejected at least once as not gaining much.)

--
nosy: +terry.reedy

___
Python tracker 

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



[issue46858] mmap constructor resets the file pointer on Windows

2022-02-25 Thread benrg


New submission from benrg :

On Windows, `mmap.mmap(f.fileno(), ...)` has the undocumented side effect of 
setting f's file pointer to 0.

The responsible code in mmapmodule is this:

/* Win9x appears to need us seeked to zero */
lseek(fileno, 0, SEEK_SET);

Win9x is no longer supported, and I'm quite sure that NT doesn't have whatever 
problem they were trying to fix. I think this code should be deleted, and a 
regression test added to verify that mmap leaves the file pointer alone on all 
platforms.

(mmap also maintains its own file pointer, the `pos` field of `mmap_object`, 
which is initially set to zero. This issue is about the kernel file pointer, 
not mmap's pointer.)

--
components: IO, Library (Lib), Windows
messages: 414039
nosy: benrg, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: mmap constructor resets the file pointer on Windows
type: behavior
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



[issue46838] Parameters and arguments parser syntax error improvments

2022-02-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

With two exceptions, nice suggestions if feasible.

>>> def foo(*args=None): pass
SyntaxError: * argument cannot have default value

>>> def foo(**kwargs=None): pass
SyntaxError: ** argument cannot have default value

Good.

>>> foo(*args=[0])
SyntaxError: cannot assign to iterable argument unpacking

>>> foo(**args={"a": None})
SyntaxError: cannot assign to keyword argument unpacking

Incomprehensible.  It seems to me that these should have same message as first 
two; message should not depend on proposed default.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue46833] Windows installer is unclear and has redundant settings

2022-02-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Installer Wizard is unclear and has redundant settings -> Windows 
installer is unclear and has redundant settings

___
Python tracker 

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



[issue46816] Remove declarations for non-__STDC__ compilers

2022-02-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +vstinner

___
Python tracker 

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



[issue46810] Make multiprocessing.connection.Client support ipv6

2022-02-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +davin, pitrou
title: multiprocessing.connection.Client doesn't support ipv6 -> Make 
multiprocessing.connection.Client support ipv6

___
Python tracker 

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



[issue37426] getpass.getpass not working with on windows when ctrl+v is used to enter the string

2022-02-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -terry.reedy
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



[issue46843] PersistentTaskGroup API

2022-02-25 Thread Joongi Kim


Joongi Kim  added the comment:

Short summary:

PersistentTaskGroup shares the followings from TaskGroup:
- It uses WeakSet to keep track of child tasks.
- After exiting the async context manager scope (or the shutdown procedure), it 
ensures that all tasks are complete or cancelled.

PersistentTaskGroup differs in that:
- It keeps running after all tasks successfully finish unless it is explicitly 
shutdown or the parent task is cancelled.
- It is one of the main use cases that shutdown() method is called separately.  
The shutdown procedure may be triggered from different task contexts.
- It provides two-phase cancellation with a configurable grace period.
- It does not propagate unhandled exceptions and cancellations from child tasks 
to the outside of the task group and sibling tasks but calls a customizable 
fallback exception handler. -> This could be done without modifying TaskGroup.

The API looks similar to TaskGroup with minor modification.
The semantics of a PersistentTaskGroup more resembles a nested event loop, in 
that it has its own set of tasks, it keeps running until closed, and it has its 
own fallback exception handler.

Note that current aiotools implementation lacks many details, such as two-phase 
cancellation.  I'm going to implement more soon.

--

___
Python tracker 

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



[issue46853] Python interpreter can get code from memory, it is not secure.

2022-02-25 Thread Brett Cannon


Brett Cannon  added the comment:

This is by design and thus not a security hole or bug.

Also, for any future security issues, please disclose them responsibly by 
following the instructions at https://www.python.org/dev/security/ .

--
nosy: +brett.cannon
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



[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2022-02-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Also, which of the two patches.

Irit, you just patched Temp file doc, can you look at the PR code?

--
nosy: +iritkatriel

___
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-02-25 Thread Joongi Kim


Joongi Kim  added the comment:

> And just a question: I'm just curious about what happens if belonging tasks 
> see the cancellation raised from their inner tasks.  Sibling tasks should not 
> be cancelled, and the outer task group should not be cancelled, unless the 
> task group itself has requested cancellation.  Could the new cancellation 
> counter help this?

To achieve this by distinguishing cancellation from inner/outer tasks, 
TaskGroup._on_task_done() should be modified to skip setting _on_completed_fut 
because it should keep running.  Swallowing exceptions in child tasks can be 
done without modifying TaskGroup, but this part requires changes of TaskGroup.

Another difference is the usage.  Instead of relying on the async context 
manager interface, we would call "TaskGroup.shutdown()" separately from either 
directly in signal handlers or from cleanup methods of long-lived objects that 
have task groups as attributes.

And I also want to perform two-phase cancellation: instead of cancelling all 
tasks immediately as in current _abort(), have a configurable grace period 
until they have chances to complete and then cancel with additional timeout on 
cancellation itself to prevent hangs.

--

___
Python tracker 

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



[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2022-02-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Éric, you might use git log or git blame to see who that is active has patched 
the relevant file in the last few years.

--

___
Python tracker 

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



[issue46856] datetime.max conversion

2022-02-25 Thread Joris Geysens


Joris Geysens  added the comment:

a ValueError is raised : 

ValueError: year 1 is out of range 

on 

dt = datetime.fromtimestamp(ts, tz=timezone.utc)

or 

dt = datetime.utcfromtimestamp(ts)

--

___
Python tracker 

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



[issue46855] printing a string with strange characters loops forever

2022-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

The ordinal range 0x80-0x9F is the C1 control code set [1]. Ordinal 0x9F is 
"Application Program Command" (APC). The command must be terminated by ordinal 
0x9C, "String Terminator" (ST). For example, "\x9f Some Command \x9c". 

In Gnome Terminal, after executing print('\x9f'), an APC command without a 
terminator, typing Ctrl+L still works to clear the screen and get back to a 
prompt.

[1] https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_controls

--
nosy: +eryksun

___
Python tracker 

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



[issue46836] [C API] Move PyFrameObject to the internal C API

2022-02-25 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



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-02-25 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



[issue46808] remove NEXT_BLOCK() from compile.c

2022-02-25 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



[issue45431] [C API] Rename CFrame or hide it to only export names starting with Py

2022-02-25 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



[issue46843] PersistentTaskGroup API

2022-02-25 Thread Joongi Kim


Joongi Kim  added the comment:

> As for errors in siblings aborting the TaskGroup, could you apply a wrapper 
> to the scheduled coroutines to swallow and log any errors yourself?

Yes, this could be a simplest way to implement PersistentTaskGroup if TaskGroup 
supports "persistent" option to keep it running.

And just a question: I'm just curious about what happens if belonging tasks see 
the cancellation raised from their inner tasks.  Sibling tasks should not be 
cancelled, and the outer task group should not be cancelled, unless the task 
group itself has requested cancellation.  Could the new cancellation counter 
help this?

--

___
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-02-25 Thread Joongi Kim


Joongi Kim  added the comment:

Good to hear that TaskGroup already uses WeakSet.

When all tasks finish, PersistentTaskGroup should not finish and wait for 
future tasks, unless explicitly cancelled or shutdown.  Could this be also 
configured with asyncio.TaskGroup?

I'm also ok with adding a simple option for such behavior to asyncio.TaskGroup 
instead of adding a whole new API/class.

--

___
Python tracker 

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



[issue46712] Share global string identifiers in deepfreeze

2022-02-25 Thread Guido van Rossum


Change by Guido van Rossum :


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

___
Python tracker 

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



[issue46712] Share global string identifiers in deepfreeze

2022-02-25 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset eb002dbe0da9622245a355db5f0cd5aa2fc70b40 by Kumar Aditya in 
branch 'main':
bpo-46712: Share global string identifiers in deepfreeze (GH-31261)
https://github.com/python/cpython/commit/eb002dbe0da9622245a355db5f0cd5aa2fc70b40


--

___
Python tracker 

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



[issue46756] Incorrect authorization check in urllib.request

2022-02-25 Thread Ned Deily


Ned Deily  added the comment:


New changeset 31fef7edf951fb759004c58ae64df18bc32ea376 by Miss Islington (bot) 
in branch '3.7':
bpo-46756: Fix authorization check in urllib.request (GH-31353) (GH-31573)
https://github.com/python/cpython/commit/31fef7edf951fb759004c58ae64df18bc32ea376


--

___
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-02-25 Thread Tin Tvrtković

Tin Tvrtković  added the comment:

The asyncio TaskGroup already uses a WeakSet for its children, so it's suitable 
for long-lived use.

As for errors in siblings aborting the TaskGroup, could you apply a wrapper to 
the scheduled coroutines to swallow and log any errors yourself?

Apart from the timeouts, that should get you a long way towards what you're 
describing.

--

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ea9612a17bc60d44e0058f525d3c02a91c439cef by Victor Stinner in 
branch 'main':
bpo-46857: Fix test_embed.test_no_memleak() on Windows (GH-31589)
https://github.com/python/cpython/commit/ea9612a17bc60d44e0058f525d3c02a91c439cef


--

___
Python tracker 

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



[issue37426] getpass.getpass not working with on windows when ctrl+v is used to enter the string

2022-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

> I have an idea to solve it. But I don't know how to get the 
> clipboard data.

In Windows, using the window manager entails extending the process and the 
current thread with GUI-related structures in the kernel and then connecting 
the process to a window station (usually "WinSta0", which contains the 
clipboard) and connecting the thread to a desktop (usually "Default"). This 
permanently changes how the OS sees the process. I think whether or not the 
process should be a GUI process is something for the application to decide, not 
the standard library. Thus getpass should not read text from the clipboard.

The docs could note that terminals may need to be configured to support 
Ctrl+Shift+C (copy) and Ctrl+Shift+V (paste) shortcuts, and that some terminals 
provide alternate ways to paste text, such as a right-click action or context 
menu. I don't think the docs should provide detailed explanations and 
configuration details for particular terminals.

--

___
Python tracker 

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



[issue46856] datetime.max conversion

2022-02-25 Thread Eric V. Smith


Eric V. Smith  added the comment:

Please show us how they fail.

--
nosy: +eric.smith

___
Python tracker 

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



[issue26897] [doc] Clarify Popen stdin, stdout, stderr

2022-02-25 Thread miss-islington


miss-islington  added the comment:


New changeset de2c91a89aa0e89d5d01d71697d0f27a9f60c11d by Miss Islington (bot) 
in branch '3.9':
bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
https://github.com/python/cpython/commit/de2c91a89aa0e89d5d01d71697d0f27a9f60c11d


--

___
Python tracker 

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



[issue26897] [doc] Clarify Popen stdin, stdout, stderr

2022-02-25 Thread miss-islington


miss-islington  added the comment:


New changeset 1f956d11dbd952fed9b214a0c6e5fd9f91a1f4ca by Miss Islington (bot) 
in branch '3.10':
bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
https://github.com/python/cpython/commit/1f956d11dbd952fed9b214a0c6e5fd9f91a1f4ca


--

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-25 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-25 Thread STINNER Victor


New submission from STINNER Victor :

"./python -X showrefcount -I -c pass" returns "[0 refs, 0 blocks]" as expected 
on Linux: Python doesn't leak any reference nor memory block.

But on Windows, it still leaks 1 reference (and 1 memory block)!

vstinner@DESKTOP-DK7VBIL C:\vstinner\python\main>python -X showrefcount -I -c 
pass
[1 refs, 1 blocks]

I recently added a test in test_embed which now fails on Windows.

See bpo-1635741 "Py_Finalize() doesn't clear all Python objects at exit" for 
the context.

--
components: Interpreter Core
messages: 414020
nosy: vstinner
priority: normal
severity: normal
status: open
title: Python leaks one reference at exit on Windows
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



[issue45316] [C API] Functions not exported with PyAPI_FUNC()

2022-02-25 Thread Eric Snow


Eric Snow  added the comment:

Thanks for working on this, Victor.

--
nosy: +eric.snow

___
Python tracker 

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



[issue46852] Remove the float.__setformat__() method

2022-02-25 Thread STINNER Victor

STINNER Victor  added the comment:

Mark Dickinson:
> I'd be happy to see `float.__setformat__` go, if it's not still needed for 
> Python's test suite (which was its entire raison d'être). If no-one noticed 
> the accidental misnaming, then it's pretty clear no-one's been using it.

Nobody noticed the since Python 3.7 (released in June 2018). Well, even 
test_float didn't use it :-D (I just fixed the typo yesterday.) So I expect 
that no one uses it.

> I'd like to bet that there are at least a few people out there using 
> float.__getformat__, despite that its docstring says "You probably don't want 
> to use this function".

Yeah, I changed my mind and I prefer to leave it unchanged for now. It doesn't 
prevent me to optimize _PyFloat_Pack8().

--

___
Python tracker 

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



[issue26897] [doc] Clarify Popen stdin, stdout, stderr

2022-02-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29711
pull_request: https://github.com/python/cpython/pull/31588

___
Python tracker 

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



[issue26897] [doc] Clarify Popen stdin, stdout, stderr

2022-02-25 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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

___
Python tracker 

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



[issue26897] [doc] Clarify Popen stdin, stdout, stderr

2022-02-25 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset dd69f734218ac5d3a551227069ac53ee09b0cd3e by Kumar Aditya in 
branch 'main':
bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
https://github.com/python/cpython/commit/dd69f734218ac5d3a551227069ac53ee09b0cd3e


--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue26897] [doc] Clarify Popen stdin, stdout, stderr

2022-02-25 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46844] Implicit binding of PersistentTaskGroup (or virtual event loops)

2022-02-25 Thread Guido van Rossum


Guido van Rossum  added the comment:

Let's concentrate the discussion in the other issue.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue46843] PersistentTaskGroup API

2022-02-25 Thread Guido van Rossum


Guido van Rossum  added the comment:

(FWIW I would close this issue but I'll wait to see if @asvetlov has something 
to add.)

--

___
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-02-25 Thread Guido van Rossum


Guido van Rossum  added the comment:

The implementation of asyncio.TaskGroup isn't all that complicated (and the new 
"cancel count" API helps). I recommend that you build one that satisfies your 
requirements yourself, or convince the authors of some other package like 
Quattro or aiotools to provide variations.

--
nosy: +tinchester

___
Python tracker 

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



[issue46856] datetime.max conversion

2022-02-25 Thread Joris Geysens


New submission from Joris Geysens :

Reading the documentation, I don't understand how this is not possible : 

# get the max utc timestamp
ts = datetime.max.replace(tzinfo=timezone.utc).timestamp()

# similarly 
ts2 = datetime(, 12, 31, 23, 59, 59, 99, 
tzinfo=timezone.utc).timestamp()

# timestamp value 253402300800 seems correct
# converting back to timestamp is impossible, these all fail : 

dt = datetime.fromtimestamp(ts, tz=timezone.utc)
dt = datetime.utcfromtimestamp(ts)

It should be possible to get a datetime back from the initially converted 
timestamp, no?

--
messages: 414013
nosy: joris.geysens
priority: normal
severity: normal
status: open
title: datetime.max conversion
type: behavior
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



[issue37426] getpass.getpass not working with on windows when ctrl+v is used to enter the string

2022-02-25 Thread Eryk Sun


Eryk Sun  added the comment:

> Clicking `Edit > Paste` from the window menu
> Use right-click to paste

In particular, if the console has quick-edit mode enabled, then you can paste 
text by right-clicking. Also, if text is selected in quick-edit mode, 
right-clicking copies to the clipboard.

> Enabling `Properties > Options > Use Ctrl+Shift+C/V as Copy/Paste` from the 
> menu

I prefer this setting because it matches the behavior of terminals on other 
platforms. I suggest setting it in the "Defaults" dialog instead of 
"Properties". Otherwise, you'll have to configure it individually for each 
shell link (.LNK file) or session title. (The console session title defaults to 
the executable path, unless set in STARTUPINFO.)

> Using the new Windows Terminal

Terminal allows configuring the actions for keyboard shortcuts. By default it 
grabs Ctrl+C (copy) and Ctrl+V (paste). I disable these mappings. I leave the 
default mappings in place for Ctrl+Shift+C (copy), Ctrl+Shift+V (paste), 
Ctrl+Insert (copy), and Shift+Insert (paste).  

> This behavior is the same Command Prompt and PowerShell

The behavior has to be the same when the parent process is a normal console 
shell such as CMD or PowerShell. Python inherits its console session from the 
shell, and that's the extent of the shell's involvement. 

A console session is hosted by an instance of conhost.exe or openconsole.exe. 
If the host is running in pseudoconsole (headless) mode, then the user 
interface for the session is hosted by another application (e.g. Windows 
Terminal). Even in pseudoconsole mode, however, the console host a lot to do in 
order to manage the session state for the console API.

--

___
Python tracker 

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



[issue46852] Remove the float.__setformat__() method

2022-02-25 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'd be happy to see `float.__setformat__` go, if it's not still needed for 
Python's test suite (which was its entire raison d'être). If no-one noticed the 
accidental misnaming, then it's pretty clear no-one's been using it.

I'd like to bet that there are at least a few people out there using 
float.__getformat__, despite that its docstring says "You probably don't want 
to use this function".

Maybe we could consider moving the information contained in __getformat__ to 
somewhere more accessible (e.g., a new field in sys.float_info)?

--

___
Python tracker 

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



[issue46855] printing a string with strange characters loops forever

2022-02-25 Thread svilen dobrev

New submission from svilen dobrev :

$ python
Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a= "Betrag gr\xc3\xb6\xc3\x9fer als Betrag der Original-Transaktion"
>>> a
'Betrag gröÃ\x9fer als Betrag der Original-Transaktion'
>>> print(a)
Betrag gröÃ~ 

---

And above waits forever. Does not consume resources, but does not hear Ctrl-C. 
Ctrl-\ kills it.

The string above is just a byte string of the utf-8 representation, with 
forgotten "b" infront of it.

--
components: Interpreter Core
messages: 414010
nosy: svild
priority: normal
severity: normal
status: open
title: printing a string with strange characters loops forever
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2022-02-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +29709
pull_request: https://github.com/python/cpython/pull/31586

___
Python tracker 

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



[issue46752] Introduce task groups to asyncio and change task cancellation semantics

2022-02-25 Thread Yves Duprat


Change by Yves Duprat :


--
nosy: +yduprat

___
Python tracker 

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



[issue46836] [C API] Move PyFrameObject to the internal C API

2022-02-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 87af12bff33b3e7546fa26158b7d8680ecb6ecec by Victor Stinner in 
branch 'main':
bpo-46836: Rename InterpreterFrame to _PyInterpreterFrame (GH-31583)
https://github.com/python/cpython/commit/87af12bff33b3e7546fa26158b7d8680ecb6ecec


--

___
Python tracker 

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



  1   2   >