[issue43513] venv: recreate symlinks on --upgrade

2021-08-26 Thread Scott Macpherson


Change by Scott Macpherson :


--
nosy: +macpherson.scott

___
Python tracker 

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



[issue44972] Add workflow_dispatch trigger for GitHub Actions jobs

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Neat! Thanks :)

--

___
Python tracker 

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



[issue44972] Add workflow_dispatch trigger for GitHub Actions jobs

2021-08-26 Thread Ryan Mast (nightlark)


Ryan Mast (nightlark)  added the comment:

> How is manually dispatched workflows different from just opening a PR to your 
> own fork? I do that from time to time in order to run the CI before opening a 
> PR against the CPython repo.

Here are a few thoughts on how it is different:
- They can be set up to take `inputs` that customize the behavior of the 
workflow run. Recently in another issue someone had asked about getting the 
Windows MSI installers from a CI build run but that workflow doesn't upload any 
artifacts; an input could be added that uploads the installers as artifacts in 
the cases they would useful while keeping the default behavior of not uploading 
artifacts for PRs, or an input could be added to enable additional debugging 
output/running extra tests to track down an issue
- Multiple builds of the same commit can be started; if there's a test that 
fails intermittently you could queue up 10 runs of a workflow and come back 
later to see if it is still happening from a larger sample size
- The jobs/workflows run can be more targeted; if you just want to build the 
docs part of a larger change set, you don't need to run the workflow for 
compiling + running tests. If all you care about is a generated installer, only 
that workflow needs to get run (less likely to hit the max concurrent builds 
for your account if you have workflows running in other non-cpython 
repositories)
- Temporary PRs don't need closing to keep subsequent commits from runnings 
jobs if you don't care about their results, or after the PR gets merged in the 
upstream CPython repo
- May be marginally faster to trigger a workflow run than opening a PR (in 
terms of slower loading pages/tabs on the GitHub website)

--

___
Python tracker 

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



[issue45026] More compact range iterator

2021-08-26 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Is it worth removing the len field as well and lazily using get_len_of_range() 
as needed?

Then the hot function can look something like:

static PyObject *
rangeiter_next(rangeiterobject *r)
{
long result = r->start
if (result < r->stop) {
r->start += r->step;
return PyLong_FromLong(result);
}
return NULL;
}

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue44974] Warning about "Unknown child process pid" in test_asyncio

2021-08-26 Thread Ryan Mast (nightlark)


Ryan Mast (nightlark)  added the comment:

I haven't gotten a chance to narrow it down much yet, it might be that it is 
occurs more often on systems with a low core count/higher load -- a bit hard to 
tell with it being intermittent though.

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Guido van Rossum


Guido van Rossum  added the comment:

> The big time consumer is turning marshal'ed code objects back
> into Python objects, though. If that could be made faster by
> e.g. using a more efficient storage format such as one which is
> platform dependent, it'd be a much bigger win than the freezing
> approach.

I've explored a couple of different approaches here (see the issue Eric linked 
to and a few adjacent ones) and this is a tricky issue. Marshal seems to be 
pretty darn efficient as a storage format, because it's very compact compared 
to the Python objects it creates. My final (?) proposal is creating static data 
structures embedded in the code that just *are* Python objects. Unfortunately 
on Windows the C compiler balks at this -- the C++ compiler handles it just 
fine, but it's not clear that we are able to statically link C++ object files 
into Python without depending on a lot of other C++ infrastructure. (In GCC and 
Clang this is apparently a language extension.)

--

___
Python tracker 

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



[issue41818] Lib/pty.py major revision

2021-08-26 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 245f1f260577a005fd631144b4377febef0b47ed by Gregory P. Smith in 
branch 'main':
bpo-41818: ++ termios versionadded markers. (GH-27987)
https://github.com/python/cpython/commit/245f1f260577a005fd631144b4377febef0b47ed


--

___
Python tracker 

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



[issue45026] More compact range iterator

2021-08-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Currently the range iterator contains four integers: index, start, step and 
len. On iteration index is increased until achieve len, the result is 
calculated as start+index*step.

In the proposed PR the range iterator contains only three integers: index was 
removed. Instead len counts the number of iterations that left, and start is 
increased by step on every iteration. Less memory, simpler calculation.

Pickle no longer contains index, but __setstate__ is kept for compatibility.

The only incompatible change is that calling __setstate__ repeatedly will have 
different effect. Currently __setstate__ with the same values does not have 
effect, with this PR it will advance iterator. But Python only calls 
__setstate__ once for just created object when unpickle or copy.

--

___
Python tracker 

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



[issue45027] Allow basicConfig to configure any logger, not just root

2021-08-26 Thread Greg Werbin


New submission from Greg Werbin :

Hello all!

I am proposing to add a "logger=" kwarg to logging.basicConfig(), which would 
cause the configuration to be applied to the specified logger. The value of 
this parameter could be a string or a logging.Logger object. Omitting logger= 
or passing logger=None would be equivalent to the current behavior, using the 
root logger.

My rationale for this proposal is that the Python logging can be verbose to 
configure for "simple" use cases, and can be intimidating for new users, 
especially those who don't have prior experience with comparable logging 
frameworks in other languages. The simplicity of basicConfig() is great, but 
currently there is a very big usability gap between the "root logger only" case 
and the "fully manual configuration" case. This enhancement proposal would help 
to fill that gap.

I observe that many Python users tend to use basicConfig() even when they would 
be better served by configuring only the logger(s) needed for their own 
app/library. And I think many of these same Python users would appreciate the 
reduced verbosity and greater convenience of having a "basic config" option 
that they could apply to various loggers independently.

I know that I personally would use this enhanced basicConfig() all the time, 
and I hope that others feel the same way. I also believe that it would 
encourage adoption of sensible logging setups in a greater number of projects.

Here are the Git diffs, as rendered by Github:

* CPython: 
https://github.com/python/cpython/compare/main...gwerbin:gwerbin/basicconfig-any-logger

* Mypy (typeshed): 
https://github.com/python/mypy/compare/master...gwerbin:gwerbin/basicconfig-any-logger

--
components: Library (Lib)
messages: 400391
nosy: gwerbin
priority: normal
severity: normal
status: open
title: Allow basicConfig to configure any logger, not just root
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



[issue41818] Lib/pty.py major revision

2021-08-26 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +26434
pull_request: https://github.com/python/cpython/pull/27987

___
Python tracker 

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



[issue45026] More compact range iterator

2021-08-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45026] More compact range iterator

2021-08-26 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR provides more compact implementation of the range iterator. It 
consumes less memory and produces smaller pickles. It is presumably faster 
because it performs simpler arithmetic operations on iteration (no 
multiplications).

--
components: Interpreter Core
messages: 400390
nosy: lukasz.langa, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: More compact range iterator
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



[issue41818] Lib/pty.py major revision

2021-08-26 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset ae224bb566301d3602e9b090e37c1dcf5a48c914 by Soumendra Ganguly in 
branch 'main':
bpo-41818: Add termios.tcgetwinsize(), termios.tcsetwinsize(). (GH-23686)
https://github.com/python/cpython/commit/ae224bb566301d3602e9b090e37c1dcf5a48c914


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-26 Thread Gregory Szorc


Change by Gregory Szorc :


--
title: Reliance on C bit fields is C API is undefined behavior -> Reliance on C 
bit fields in C API is undefined behavior

___
Python tracker 

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



[issue44993] enum.auto() starts with one instead of zero

2021-08-26 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> closed

___
Python tracker 

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



[issue45025] Reliance on C bit fields is C API is undefined behavior

2021-08-26 Thread Gregory Szorc


New submission from Gregory Szorc :

At least the PyASCIIObject struct in Include/cpython/unicodeobject.h uses bit 
fields. Various preprocessor macros like PyUnicode_IS_ASCII() and 
PyUnicode_KIND() access this struct's bit field.

This is problematic because according to the C specification, the storage of 
bit fields is unspecified and may vary from compiler to compiler or 
architecture to architecture. Theoretically, a build of libpython with compiler 
A may not have the same storage layout of a bit field as a separate binary 
built with compiler B. These 2 binaries could be linked/loaded together, 
resulting in a crash or incorrect behavior at run-time.

https://stackoverflow.com/questions/6043483/why-bit-endianness-is-an-issue-in-bitfields/6044223#6044223

To ensure bit field behavior is consistent, the same compiler must be used for 
all bit field interaction. Since it is effectively impossible to ensure this 
for programs like Python where multiple compilers are commonly at play (a 3rd 
party C extension will likely not be built on the same machine that built 
libpython), bit fields must not be exposed in the C API. If a bit field must 
exist, the bit field should not be declared in a public .h header and any APIs 
for accessing the bit field must be implemented as compiled functions such that 
only a single compiler will define the bit field storage layout.

In order to avoid undefined behavior, Python's C API should avoid all use of 
bit fields.

This issue is in response to https://github.com/PyO3/pyo3/issues/1824.

--
components: C API
messages: 400388
nosy: indygreg
priority: normal
severity: normal
status: open
title: Reliance on C bit fields is C API is undefined behavior
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue45024] Cannot extend collections ABCs with protocol

2021-08-26 Thread Anup Parikh


New submission from Anup Parikh :

Since the container ABCs are normal classes, and Protocol cannot subclass 
normal classes, there's no way to create a protocol that extends the ABCs 
without explicitly listing out all the methods needed for the collection. e.g., 
can't do this:

from typing import Iterable, Protocol

class IterableWithMethod(Iterable, Protocol):
def method(self) -> None: pass

Since the ABCs don't provide any default implementations (I think?), maybe they 
should just be defined as runtime checkable protocols instead of ABCs?

--
components: Library (Lib), Parser
messages: 400387
nosy: anuppari, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Cannot extend collections ABCs with protocol
type: behavior

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Guido van Rossum


Guido van Rossum  added the comment:

I noticed nedbat un-nosied himself. Probably he didn't realize you were
calling him out because it's possible this would affect coverage.py?

--

___
Python tracker 

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



[issue45022] Update libffi to 3.4.2

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26432
pull_request: https://github.com/python/cpython/pull/27985

___
Python tracker 

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



[issue45022] Update libffi to 3.4.2

2021-08-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +26431
pull_request: https://github.com/python/cpython/pull/27984

___
Python tracker 

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



[issue45022] Update libffi to 3.4.2

2021-08-26 Thread Steve Dower


Steve Dower  added the comment:


New changeset 969ae7f7356584e30667b4e490ffa2ffa1810429 by Steve Dower in branch 
'main':
bpo-45022: Pin current libffi build to fixed version in preparation for 
upcoming update (GH-27982)
https://github.com/python/cpython/commit/969ae7f7356584e30667b4e490ffa2ffa1810429


--

___
Python tracker 

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



[issue45023] Python doesn't exit with proper resultcode on SIGINT in multiprocessing.Process

2021-08-26 Thread Amber Wright


New submission from Amber Wright :

The return code of python on linux/MacOS when the program is ended with a 
KeyboardInterrupt should be -2, when running with multiprocessing the exitcode 
is 1. I've attached a reproduced example. 

>From The Process.join() docs: 
>https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Process.exitcode

> A negative value -N indicates that the child was terminated by signal N.

output:

$ /usr/local/opt/python@3.9/bin/python3 -m test
Traceback (most recent call last):
  File 
"/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py",
 line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
  File 
"/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py",
 line 87, in _run_code
exec(code, run_globals)
  File "/Users/awright/docker/2108/test.py", line 49, in 
sys.exit(main())
  File "/Users/awright/docker/2108/test.py", line 41, in main
return target()
  File "/Users/awright/docker/2108/test.py", line 10, in target
time.sleep(9)
KeyboardInterrupt
proc.wait()=-2
Process SpawnProcess-1:
Traceback (most recent call last):
  File 
"/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py",
 line 315, in _bootstrap
self.run()
  File 
"/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py",
 line 108, in run
self._target(*self._args, **self._kwargs)
  File "/Users/awright/docker/2108/test.py", line 10, in target
time.sleep(9)
KeyboardInterrupt
proc.exitcode=1



See also: 
https://bugs.python.org/issue1054041 and https://bugs.python.org/issue41602

--
components: Interpreter Core
files: test.py
messages: 400384
nosy: ambwrig
priority: normal
severity: normal
status: open
title: Python doesn't exit with proper resultcode on SIGINT in 
multiprocessing.Process
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50237/test.py

___
Python tracker 

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



[issue44140] WeakKeyDictionary should support lookup by id instead of hash

2021-08-26 Thread Alessio Bogon


Change by Alessio Bogon :


--
nosy: +youtux

___
Python tracker 

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



[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-08-26 Thread Alessio Bogon


Change by Alessio Bogon :


--
nosy: +youtux

___
Python tracker 

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



[issue45022] Update libffi to 3.4.2

2021-08-26 Thread Steve Dower


Steve Dower  added the comment:

This first PR is just to avoid accidentally upgrading old builds. Otherwise, as 
soon as I push the new build into the cpython-bin-deps repository, it'll take 
precedence.

This one needs backporting into 3.10 and 3.9, but should be a no-op.

--

___
Python tracker 

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



[issue45022] Update libffi to 3.4.2

2021-08-26 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue45022] Update libffi to 3.4.2

2021-08-26 Thread Steve Dower


New submission from Steve Dower :

libffi is doing releases again! We're a few versions behind, so should pull in 
the latest. https://github.com/libffi/libffi/

Adding RMs for opinions on backporting, and Ned in case this impacts the macOS 
build.

--
components: Build, Windows, ctypes
messages: 400382
nosy: lukasz.langa, ned.deily, pablogsal, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Update libffi to 3.4.2
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


Eric Snow  added the comment:

> For the latter, the obvious solution is to introduce a startup hook

I'm not sure why I said "obvious".  Sorry about that.

--

___
Python tracker 

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



[issue45021] Race condition in thread.py

2021-08-26 Thread nullptr


nullptr  added the comment:

A more direct way to reproduce


from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from time import sleep

def worker():
with ProcessPoolExecutor() as pool:
r = list(pool.map(sleep, [0.01] * 8))


def submit(pool):
pool.submit(submit, pool)


if __name__ == '__main__':
pool = ThreadPoolExecutor(2)
pool.submit(submit, pool)

i = 0
while True:
r = pool.submit(worker)
r = r.result()
print(i)
i += 1

--

___
Python tracker 

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



[issue45021] Race condition in thread.py

2021-08-26 Thread nullptr


Change by nullptr :


--
type:  -> behavior

___
Python tracker 

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



[issue34804] Repetition of 'for example' in documentation

2021-08-26 Thread Diana


Diana  added the comment:

I will handle it. I will send a pull request within 3 days.

--
nosy: +DonnaDia

___
Python tracker 

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



[issue45021] Race condition in thread.py

2021-08-26 Thread nullptr


New submission from nullptr :

The following code can sometimes hang up


import random 
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from time import sleep

def worker():   
with ProcessPoolExecutor() as pool:  
r = list(pool.map(sleep, [0.01] * 8))   

   
if __name__ == '__main__': 
pool = ThreadPoolExecutor() 
   
i = 0  
while True:
if random.random() < 0.9:
pool.submit(sleep, 0.001)  
else: 
r = pool.submit(worker) 
r = r.result()
i += 1   
print('alive', i)


It's a bit hard to trigger that way but with some luck and many restarts it'll 
eventually freeze as r.result() never returns.

The backtrace from a child process shows that the child is stuck in 
Lib/concurrent/futures/thread.py:_python_exit waiting for _global_shutdown_lock.

The fork happened while the lock was already grabbed i.e. while executing 
ThreadPoolExecutor.submit

--
components: Library (Lib)
messages: 400378
nosy: xavier.lacroze
priority: normal
severity: normal
status: open
title: Race condition in thread.py
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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread Łukasz Langa

Change by Łukasz Langa :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue45007] OpenSSL 1.1.1l is released

2021-08-26 Thread Steve Dower


Steve Dower  added the comment:

The new build and tags for Windows are up.

--

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread miss-islington


miss-islington  added the comment:


New changeset f1e3fc4631da5e6ca1ea047c82bd9b42db9dd9ae by Miss Islington (bot) 
in branch '3.9':
bpo-40635: Fix getfqdn() docstring and docs (GH-27971)
https://github.com/python/cpython/commit/f1e3fc4631da5e6ca1ea047c82bd9b42db9dd9ae


--

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread miss-islington


miss-islington  added the comment:


New changeset 719af92e108ea3b31729cb09077673b8f13905d2 by Miss Islington (bot) 
in branch '3.10':
bpo-40635: Fix getfqdn() docstring and docs (GH-27971)
https://github.com/python/cpython/commit/719af92e108ea3b31729cb09077673b8f13905d2


--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Ned Batchelder


Change by Ned Batchelder :


--
nosy:  -nedbat

___
Python tracker 

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



[issue30274] Rename 'name' to 'fullname' argument to ExtensionFileLoader

2021-08-26 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 6.0 -> 7.0
pull_requests: +26429
pull_request: https://github.com/python/cpython/pull/27981

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


Eric Snow  added the comment:

> The big time consumer is turning marshal'ed code objects back
> into Python objects, though. If that could be made faster by
> e.g. using a more efficient storage format such as one which is
> platform dependent, it'd be a much bigger win than the freezing
> approach.

That's something Guido has been exploring. :)

See: https://github.com/faster-cpython/ideas/issues/84 (and others)

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Not sure whether you are aware, but the PyRun project I'm maintaining
does that and goes beyond this by freezing almost the complete stdlib
and statically linking most C extensions into a single binary:

https://www.egenix.com/products/python/PyRun/

Startup is indeed better, but not as much as you might think.
You do save stat calls and can share resources across processes.

The big time consumer is turning marshal'ed code objects back
into Python objects, though. If that could be made faster by
e.g. using a more efficient storage format such as one which is
platform dependent, it'd be a much bigger win than the freezing
approach.

--
nosy: +lemburg

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


Eric Snow  added the comment:

I'm aware of two potentially problematic consequences to this change:

* making changes to those source files for the modules will not be reflected 
during execution until after "make" is run
* tricks to inject hooks ASAP (e.g. coverage.py swaps the encodings module) may 
lose their entry point

For the former, I'm not sure there's a way around it.  We may consider the 
inconvenience worth it in order to get the performance benefits.

For the latter, the obvious solution is to introduce a startup hook (e.g. on 
the CLI) like we've talked about doing for years.  (I wasn't able to find 
previous discussions on that topic after a quick search.)

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


Eric Snow  added the comment:

FYI, with my branch I'm getting a 15% improvement to startup for "./python -c 
pass".

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


New submission from Eric Snow :

Currently we freeze the 3 main import-related modules into the python binary 
(along with one test module).  This allows us to bootstrap the import machinery 
from Python modules.  It also means we get better performance importing those 
modules.

If we freeze modules that are likely to be used during execution then we get 
even better startup times.  I'll be putting up a PR that does so, freezing all 
the modules that are imported during startup.  This could also be done for any 
stdlib modules that are commonly imported.

(also see #45019 and https://github.com/faster-cpython/ideas/issues/82)

--
assignee: eric.snow
components: Build
messages: 400370
nosy: brett.cannon, eric.snow, gvanrossum, nedbat
priority: normal
severity: normal
stage: needs patch
status: open
title: Freeze all modules imported during startup.
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



[issue45019] Freezing modules has manual steps but could be automated.

2021-08-26 Thread Eric Snow


Change by Eric Snow :


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

___
Python tracker 

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



[issue45019] Freezing modules has manual steps but could be automated.

2021-08-26 Thread Eric Snow


New submission from Eric Snow :

Currently we freeze the 3 main import-related modules, as well as one module 
for testing.  Adding more modules or otherwise making any adjustments requires 
manually editing several files (frozen.c, Makefile.pre.in, ...).  Those files 
aren't particularly obvious and it's easy to miss one.  So it would be helpful 
to have a tool that generates the necessary lines in the relevant files, to 
avoid manual editing.

I'll be putting up a PR shortly.

--
assignee: eric.snow
components: Build
messages: 400369
nosy: brett.cannon, eric.snow, gvanrossum
priority: normal
severity: normal
stage: needs patch
status: open
title: Freezing modules has manual steps but could be automated.
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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
keywords: +patch
pull_requests: +26427
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/27979

___
Python tracker 

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



[issue44933] python3.9-intel64 hardened runtime not enabled

2021-08-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@ned: the "reliable way to run under rosetta" is using "arch -x86_64 python3". 
I don't particularly like having another executable to accomplish the same goal.

--

___
Python tracker 

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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Thanks, Ronald, that's a nice improvement. I'll create a PR for it.

--

___
Python tracker 

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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Note that sqlite3_enable_load_extension was unavailable way before macOS 
11.5.1, the symbol is not present on 10.15 (I used 'nm 
/usr/lib/libsqlite3.dylib' to check for symbol availability).

Just checking for MACOS and a system include directory should do the trick for 
giving a nicer error message, something like:

diff --git a/setup.py b/setup.py
index bc2ea16089..ae5d827339 100644
--- a/setup.py
+++ b/setup.py
@@ -1601,6 +1601,9 @@ def detect_sqlite(self):
 if '--enable-loadable-sqlite-extensions' not in 
sysconfig.get_config_var("CONFIG_ARGS"):
 sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))
 
+elif MACOS and sqlite_incdir == os.path.join(MACOS_SDK_ROOT, 
'usr/include'): 
+raise DistutilsError("System version of SQLite3 does not 
support loadable extensions") 
+
 if MACOS:
 # In every directory on the search path search for a dynamic
 # library and then a static library, instead of first looking

With this patch I get a nice error message when trying to build with loadable 
sqlite extensions:

make

  (main)cpython
 CC='gcc' LDSHARED='gcc -bundle -undefined dynamic_lookup' OPT='-DNDEBUG -g 
-fwrapv -O3 -Wall'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''   ./python.exe -E 
../setup.py  build
running build
running build_ext
error: System version of SQLite3 does not support loadable extensions
make: *** [sharedmods] Error 1


My clone of the CPython repository is a bit of a mess at the moment, otherwise 
I'd have created a PR for this. Feel free to run with this.

--

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26426
pull_request: https://github.com/python/cpython/pull/27978

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset fdcb675eed47b1f6054fae381af4388b16a6fff4 by andrei kulakov in 
branch 'main':
bpo-40635: Fix getfqdn() docstring and docs (GH-27971)
https://github.com/python/cpython/commit/fdcb675eed47b1f6054fae381af4388b16a6fff4


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45010] Remove support of special method __div__ in unittest.mock

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:

Agreed, let's get rid of it. Thanks!

I grepped for this and there's still one left-over here:

https://github.com/python/cpython/blob/f9cd40f5e242d3c64cc20a5064500f5fe864f91f/Lib/importlib/metadata/_meta.py#L40-L41

Fortunately, this was already fixed upstream:

https://github.com/python/importlib_metadata/issues/334

Next time Jason syncs importlib.metadata with upstream this will be solved as 
well. Currently we're synced with 4.6.0 while the fix went in in 4.6.4.

Also fortunately, this is low-pri since this is only in type annotations.

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



[issue30274] Rename 'name' to 'fullname' argument to ExtensionFileLoader

2021-08-26 Thread Diana Van Straaten


Diana Van Straaten  added the comment:

I want to work on it.

--
nosy: +zemlya3018

___
Python tracker 

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



[issue45010] Remove support of special method __div__ in unittest.mock

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f9cd40f5e242d3c64cc20a5064500f5fe864f91f by Serhiy Storchaka in 
branch 'main':
bpo-45010: Remove support of special method __div__ in unittest.mock (GH-27965)
https://github.com/python/cpython/commit/f9cd40f5e242d3c64cc20a5064500f5fe864f91f


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 970533e65c1a1129dfc1cc1867f6ad075f7f5bf6 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) 
(GH-27970)
https://github.com/python/cpython/commit/970533e65c1a1129dfc1cc1867f6ad075f7f5bf6


--

___
Python tracker 

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



[issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index

2021-08-26 Thread Jordan Limor


Change by Jordan Limor :


--
keywords: +patch
nosy: +chilaxan
nosy_count: 1.0 -> 2.0
pull_requests: +26424
pull_request: https://github.com/python/cpython/pull/27938

___
Python tracker 

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



[issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index

2021-08-26 Thread Łukasz Langa

New submission from Łukasz Langa :

Consider the following:

>>> it = iter(range(2**32 + 2))
>>> for _ in range(2**32):
...   _ = next(it)
>>> it2 = pickle.loads(
...   pickle.dumps(it)
... )
>>> assert next(it) == next(it2)

This assert currently fails because the reduce method for range iterator 
objects serializes to `int` instead of `long`.

(note that running this example might take tens of minutes on your box)

--
messages: 400360
nosy: lukasz.langa
priority: normal
severity: normal
stage: patch review
status: open
title: Pickling a range iterator with an index of over sizeof(int) stores an 
invalid index
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array

2021-08-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> what it's correcting for is an inaccurate value of "c" [...]

I'll leave the logic as-is and just add a note about what is being corrected.

> Numerically, it's probably not helpful.

To make a difference, the mean would have to have huge magnitude relative to 
the variance; otherwise, squaring the error would drown it out to zero.

The mean() should already be accurate to within a 1/2 ulp.  The summation and 
division are exact.  There is only a single rounding when the result converts 
from Fraction to a float or decimal.

--

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread Łukasz Langa

Change by Łukasz Langa :


--
versions: +Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 81148c6f91092c3aa207a53b657b2548a20b230c by Miss Islington (bot) 
in branch '3.8':
bpo-45001: Make email date parsing more robust against malformed input 
(GH-27946) (GH-27974)
https://github.com/python/cpython/commit/81148c6f91092c3aa207a53b657b2548a20b230c


--

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 2cdbd3b8b2bb4fa0dbcc04ce305fbafaeedd9e67 by Miss Islington (bot) 
in branch '3.9':
bpo-45001: Make email date parsing more robust against malformed input 
(GH-27946) (GH-27973)
https://github.com/python/cpython/commit/2cdbd3b8b2bb4fa0dbcc04ce305fbafaeedd9e67


--

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


miss-islington  added the comment:


New changeset 9a79242567d79f42ad1a953cce2b1c4a94df23ea by Miss Islington (bot) 
in branch '3.10':
bpo-45001: Make email date parsing more robust against malformed input 
(GH-27946)
https://github.com/python/cpython/commit/9a79242567d79f42ad1a953cce2b1c4a94df23ea


--

___
Python tracker 

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



[issue45017] move opcode-related logic from modulefinder to dis

2021-08-26 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue45017] move opcode-related logic from modulefinder to dis

2021-08-26 Thread Irit Katriel


New submission from Irit Katriel :

The modulefinder library module has logic that understands particular opcodes 
(such as the scan_opcodes method). This should be encapsulated in the dis 
module, and modulefinder should not process opcodes directly.

--
components: Library (Lib)
messages: 400355
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: move opcode-related logic from modulefinder to dis
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



[issue45016] Multiprocessing freeze support unclear

2021-08-26 Thread Ronald Oussoren


New submission from Ronald Oussoren :

The requirements on a freezing tool to work with the freeze support in the 
multiprocessing library are unclear.

In particular, I'm trying to support multiprocessing in py2app and cannot rely 
on the documentation to implement that support.

The particular issue I run into:
- With py2app "sys.executable" points to a regular interpreter
- py2app sets sys.frozen to "macosx_app" or "macosx_plugin"
- Multiprocessing.spawn.get_command_line() assumes that a special command-line 
should be used when "sys.frozen" is set and there is no way to disable this.

The easiest way for me to fix this issue is to drop setting sys.frozen in 
py2app, although I have no idea what other code this might break.

--
components: Library (Lib)
messages: 400354
nosy: ronaldoussoren
priority: normal
severity: normal
status: open
title: Multiprocessing freeze support unclear
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-26 Thread Mark Shannon


Change by Mark Shannon :


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



[issue44990] Change layout of frames back to specials-locals-stack (from locals-specials-stack)

2021-08-26 Thread Mark Shannon


Change by Mark Shannon :


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



[issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows

2021-08-26 Thread Eryk Sun


Eryk Sun  added the comment:

The legacy maximum buffer size is 260 characters, but remember that strings in 
C are terminated by a null character (i.e. "\0"). So the maximum path length is 
actually 259 characters when opening files. 

In Windows 10 with Python 3.6+, you can enable the `LongPathsEnabled` system 
setting to extend the limit up to about 32760 characters. In many cases you can 
also use the "?\\" extended-path prefix to access a long path (e.g. 
r"\\?\C:\some\long\path"), but the path has to be fully qualified and can only 
use backslash as the separator, not forward slash.

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue40772] module 'resource' has no attribute 'RLIMIT_VMEM'

2021-08-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

According to https://man7.org/linux/man-pages/man2/getrlimit.2.html there is no 
RLIMIT_VMEM on linux, RLIMIT_AS is the closest equivalent.

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26423
pull_request: https://github.com/python/cpython/pull/27976

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26422
pull_request: https://github.com/python/cpython/pull/27975

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26421
pull_request: https://github.com/python/cpython/pull/27974

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 989f6a3800f06b2bd31cfef7c3269a443ad94fac by wouter bolsterlee in 
branch 'main':
bpo-45001: Make email date parsing more robust against malformed input 
(GH-27946)
https://github.com/python/cpython/commit/989f6a3800f06b2bd31cfef7c3269a443ad94fac


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26420
pull_request: https://github.com/python/cpython/pull/27973

___
Python tracker 

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



[issue45009] Get last modified date of Folders and Files using os.path module

2021-08-26 Thread Gopesh Singh


Gopesh Singh  added the comment:

Thanks Vedram for the response. Changed the title.

But I get the same issue with Path.stat().

When I put a sleep time for each iteration, it works fine. Else, it gives 
current date as modified date.

--

___
Python tracker 

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



[issue45009] Get last modified date of Folders and Files using os.path module

2021-08-26 Thread Gopesh Singh


Gopesh Singh  added the comment:

Updated title. As I used getmtime of os.path module.

--
title: Get last modified date of Folders and Files using pathlib module -> Get 
last modified date of Folders and Files using os.path module

___
Python tracker 

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



[issue33092] The bytecode for f-string formatting is inefficient.

2021-08-26 Thread Mark Shannon


Mark Shannon  added the comment:

No significant change in performance 
https://gist.github.com/markshannon/34a780d65e69b5a573a83f3fdb0139aa

I think this merely indicates that there are little to no f-strings in the 
pyperformance benchmark suite.

--

___
Python tracker 

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



[issue45009] Get last modified date of Folders and Files using pathlib module

2021-08-26 Thread Vedran Čačić

Vedran Čačić  added the comment:

It probably has nothing to do with your bug, but your title is wrong. You are 
_not_ getting mtime using pathlib (but using os.path instead). That is done 
like using this approach: 
https://docs.python.org/3/library/pathlib.html#pathlib.Path.stat

Just to eliminate irrelevant details, could you try _actually_ implement the 
algorithm using the above, and see if the results differ?

--
nosy: +veky

___
Python tracker 

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



[issue45015] Language Reference failing to describe the treatment of starred expressions

2021-08-26 Thread Takuo Matsuoka


New submission from Takuo Matsuoka :

The issue is described as Issue (1) here:

https://mail.python.org/archives/list/python-id...@python.org/message/BEGGQEU6MG7RYIY7HB4I6VQ23L6TXB6H/

Please look at "Note" just before "Issues treated" there as
well. What's mentioned in this note is also filed in this issue tracker
with ID 44983

https://bugs.python.org/issue44983


Coming back to Issue (1), the discrepancy is in the definitions of
yield_expression, return_stmt, augmented_assignment_stmt, and
for_stmt. (That is, the only exception is the definition of
subscription

https://docs.python.org/3/reference/expressions.html#subscriptions

making the exception look inconsistent and confusing.)

https://docs.python.org/3/reference/expressions.html#yield-expressions
https://docs.python.org/3/reference/simple_stmts.html#the-return-statement
https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements
https://docs.python.org/3/reference/compound_stmts.html#the-for-statement

(In case someone is interested in what are proposed over there, a
summary of the proposal can also be found at

https://mail.python.org/archives/list/python-id...@python.org/message/KF37FMD5K5M2ZVTJO6IS3J6M7HHE4VRU/
)

--
assignee: docs@python
components: Documentation
messages: 400346
nosy: Takuo Matsuoka, docs@python
priority: normal
severity: normal
status: open
title: Language Reference failing to describe the treatment of starred 
expressions
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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread miss-islington


miss-islington  added the comment:


New changeset 9f814beadb3ee2c7b37e949a2acf72117a449ffd by Miss Islington (bot) 
in branch '3.10':
bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)
https://github.com/python/cpython/commit/9f814beadb3ee2c7b37e949a2acf72117a449ffd


--

___
Python tracker 

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



[issue45014] SyntaxError describing the error using a wrong term

2021-08-26 Thread Takuo Matsuoka


New submission from Takuo Matsuoka :

The error is this:

>>> *()
  File "", line 1
SyntaxError: can't use starred expression here


I think it's right SyntaxError is raised here, but the message is
incorrect. Indeed, many starred expressions are actually allowed
there. E.g.,

>>> *(),
()


I happen to have filed in this issue tracker the problem that the
definition of a starred expression given in the Language Reference is
incorrect.

https://bugs.python.org/issue44983

It appears all correct starred expressions and only them are allowed
at the point of the error. Thus the error appears to
be one because "*()" is not a starred expression in the correct
sense. I think the wording in the message should be corrected.

--
components: Interpreter Core
messages: 400344
nosy: Takuo Matsuoka
priority: normal
severity: normal
status: open
title: SyntaxError describing the error using a wrong term
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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 3.0 -> 4.0
pull_requests: +26418
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27971

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +26416
pull_request: https://github.com/python/cpython/pull/27969

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 7dc505b8655b3e48b93a4274dfd26e5856d9c64f by Serhiy Storchaka in 
branch 'main':
bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)
https://github.com/python/cpython/commit/7dc505b8655b3e48b93a4274dfd26e5856d9c64f


--

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26417
pull_request: https://github.com/python/cpython/pull/27970

___
Python tracker 

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



[issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows

2021-08-26 Thread Luke Rossi


Luke Rossi  added the comment:

I saw 33105, but believe this to be a different issue as path length 260 is 
valid.

I did testing by crafting a path that is exactly 260 by hand - A path 259 in 
length reports .isfile() as True.

The Stack Error:
[WinError 3] The system cannot find the path specified

--

___
Python tracker 

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



[issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows

2021-08-26 Thread Luke Rossi


New submission from Luke Rossi :

I saw 33105, but believe this to be a different issue as path length 260 is 
valid.

I did testing by crafting a path that is exactly 260 by hand - A path 259 in 
length reports .isfile() as True.

--
components: Library (Lib)
messages: 400341
nosy: serhiy.storchaka, ubermidget2
priority: normal
severity: normal
status: open
title: os.path.isfile fails on path exactly 260 Chars long in Windows
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



[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks for the report and fix, Gregory! ✨  ✨

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



[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8868d48712aee2b490efaf60bed8dfe9fb14d6b7 by Gregory Anders in 
branch 'main':
bpo-44967: pydoc: return non-zero exit code when query is not found (GH-27868)
https://github.com/python/cpython/commit/8868d48712aee2b490efaf60bed8dfe9fb14d6b7


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue25867] os.stat raises exception when using unicode and no locale is set

2021-08-26 Thread Eryk Sun


Eryk Sun  added the comment:

> It's doing this now, so seems like it has been fixed

Yes. In POSIX systems since Python 3.7, if the LC_CTYPE locale is the legacy 
"C" or "POSIX" locale, by default it tries to coerce LC_CTYPE to "C.UTF-8", 
"C.utf8", or "UTF-8". If coercion fails or is disabled (e.g. by defining 
LC_ALL), the interpreter will still use UTF-8 for the filesystem encoding if 
UTF-8 mode isn't disabled. If UTF-8 mode is also disabled, then ASCII is used. 
For example:

$ LC_CTYPE=C PYTHONCOERCECLOCALE= PYTHONUTF8= python -c 'import sys; 
print(sys.getfilesystemencoding())'
utf-8
$ LC_CTYPE=C PYTHONCOERCECLOCALE=0 PYTHONUTF8= python -c 'import sys; 
print(sys.getfilesystemencoding())'
utf-8
$ LC_CTYPE=C PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 python -c 'import sys; 
print(sys.getfilesystemencoding())'
ascii

--
nosy: +eryksun
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue45012] DirEntry.stat method should release GIL

2021-08-26 Thread Uosiu

New submission from Stanisław Skonieczny (Uosiu) 
:

We have an application that crawls filesystem using `os.scandir`. It uses 
multiple threads for various things. Application is used on variety of 
filesystems, some of them might be slow or occasionally unresponsive.

We have found out that sometimes whole crawling process is stuck and no thread 
makes any progress, even threads that are really simple, makes no IO and do not 
hold any locks. After running py-spy on process that was stuck we saw that one 
of the threads has entered `dentry.stat(follow_symlinks=False)` line and still 
holds the GIL. Other threads are stuck, because they are waiting for the GIL. 
This situation can take a long time.

I think that `DirEntry` should release GIL when stat cache is empty and syscall 
is performed.

This bug has already been fixed in `scandir` module. See: 
https://github.com/benhoyt/scandir/issues/131

--
components: Library (Lib)
messages: 400337
nosy: Stanisław Skonieczny (Uosiu)
priority: normal
severity: normal
status: open
title: DirEntry.stat method should release GIL
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue36073] sqlite crashes with converters mutating cursor

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Er, a little bit too fast there. There is still a crash, but it is of course 
postponed bco. bpo-44976. New reproducer:

import sqlite3 as sqlite
con = sqlite.connect(':memory:', detect_types=sqlite.PARSE_COLNAMES)
cur = con.cursor()
sqlite.converters['CURSOR_INIT'] = lambda x: cur.__init__(con)

cur.execute('create table test(x foo)')
cur.execute('insert into test(x) values (?)', ('foo',))
for row in cur.execute('select x as "x [CURSOR_INIT]", x from test'):
print(row)

--

___
Python tracker 

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



[issue36073] sqlite crashes with converters mutating cursor

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

After GH-27884 (bpo-44976) there is no longer a segfault.

I suggest to expand the test suite with the reproducer Sergey provided.

--

___
Python tracker 

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



[issue36073] sqlite crashes with converters mutating cursor

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
status: pending -> open
Removed message: https://bugs.python.org/msg400334

___
Python tracker 

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



[issue36073] sqlite crashes with converters mutating cursor

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

This issue was fixed by GH-27884 (bpo-44976). I suggest to expand the test 
suite with the reproducer Sergey provided before closing the issue.

--
status: open -> pending

___
Python tracker 

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



  1   2   >