[issue45479] clean up Py_UniversalNewlineFgets

2021-10-14 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
pull_requests: +27255
pull_request: https://github.com/python/cpython/pull/28967

___
Python tracker 

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



[issue45479] clean up Py_UniversalNewlineFgets

2021-10-14 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 160c38df7fc7ba22dc687879c387bf643ffc3398 by Benjamin Peterson in 
branch 'main':
closes bpo-45479: Degunkify Py_UniversalNewlineFgets. (GH-28965)
https://github.com/python/cpython/commit/160c38df7fc7ba22dc687879c387bf643ffc3398


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



[issue45479] clean up Py_UniversalNewlineFgets

2021-10-14 Thread Benjamin Peterson


Change by Benjamin Peterson :


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

___
Python tracker 

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



[issue45479] clean up Py_UniversalNewlineFgets

2021-10-14 Thread Benjamin Peterson


New submission from Benjamin Peterson :

Py_UniversalNewlineFgets has a bunch of dead code and general gunk that should 
be removed.

--
assignee: benjamin.peterson
components: IO
messages: 403970
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: clean up Py_UniversalNewlineFgets
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



[issue45420] Python 3.10 final installation failure

2021-10-14 Thread wyz23x2

wyz23x2  added the comment:

 

--

___
Python tracker 

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



[issue45478] Send a patch to libexpat to solve _POSIX_C_SOURCE issue.

2021-10-14 Thread Dong-hee Na


New submission from Dong-hee Na :

Yesterday, I left an issue to libexpat project about what we solved yesterday 
to follow Christian suggestion.

https://github.com/libexpat/libexpat/issues/513

The maintainer suggests sending a patch with reordering all headers files 
related to expat_config.h.
I am now preparing the patch.

I would like to know if there are more issues that we have to solve except 
header ordering that I don't know yet :)

--
assignee: corona10
components: Build
messages: 403968
nosy: christian.heimes, corona10, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Send a patch to libexpat to solve _POSIX_C_SOURCE issue.
type: enhancement

___
Python tracker 

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



[issue45465] logging messages are needlessly reformatted for every handler

2021-10-14 Thread Ned Deily


Change by Ned Deily :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue45439] [C API] Move usage of tp_vectorcall_offset from public headers to the internal C API

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 77b24ba505744532d7cfd721b1c92d205e145180 by Victor Stinner in 
branch 'main':
bpo-35134: Move Include/cellobject.h to Include/cpython/ (GH-28964)
https://github.com/python/cpython/commit/77b24ba505744532d7cfd721b1c92d205e145180


--

___
Python tracker 

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



[issue45443] 'ThreadPoolExecutor' object has no attribute 'map'

2021-10-14 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
components: +Library (Lib)
status: open -> pending
type: crash -> behavior

___
Python tracker 

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



[issue45443] 'ThreadPoolExecutor' object has no attribute 'map'

2021-10-14 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I was also unable to replicate on any of 3.7-3.11, including 3.9.6. Is it 
possible that one of your Python stdlib source files was modified? Does this 
still happen with a fresh install of Python?

Does your problem still happen if you run the file using a python executable 
directly rather than using IPython/Jupyter? If it's just a problem with 
Jupyter, this bug report belongs there.

Can you run:

>>> from concurrent.futures import ThreadPoolExecutor as TPE
>>> TPE.__mro__
(, , )
>>> TPE.__mro__[1]

>>> dir(TPE.__mro__[1])
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__enter__', 
'__eq__', '__exit__', '__format__', '__ge__', '__getattribute__', '__gt__', 
'__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', 
'__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
'__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'map', 'shutdown', 
'submit']

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue45476] [C API] Convert "AS" functions, like PyFloat_AS_DOUBLE(), to static inline functions

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:

I searched for "PyFloat_AS_DOUBLE.*=" regex in the PyPI top 5000 projects. I 
couldn't find any project doing that.

I only found perfectly safe comparisons:

traits/ctraits.c:if (PyFloat_AS_DOUBLE(value) <= 
PyFloat_AS_DOUBLE(low)) {
traits/ctraits.c:if (PyFloat_AS_DOUBLE(value) >= 
PyFloat_AS_DOUBLE(high)) {
c/_cffi_backend.c:return PyFloat_AS_DOUBLE(ob) != 0.0;
pandas/_libs/src/klib/khash_python.h:   ( PyFloat_AS_DOUBLE(a) == 
PyFloat_AS_DOUBLE(b) );

--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27253
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/28964

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:

commit 37b1d607bf0f1a9c1e89b1715349efc24dc180e0 (upstream/main, main)
Author: Victor Stinner 
Date:   Fri Oct 15 01:50:28 2021 +0200

po-35134: Move Include/funcobject.h to Include/cpython/ (GH-28958)

Remove redundant "#ifndef Py_LIMITED_API" in funcobject.h.

--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7076bef8ba8836a19d5033f4ceb8eb9837de2301 by Victor Stinner in 
branch 'main':
bpo-45434: Remove useless space in includes (GH-28963)
https://github.com/python/cpython/commit/7076bef8ba8836a19d5033f4ceb8eb9837de2301


--

___
Python tracker 

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



[issue41710] threading.Lock.acquire(timeout) should use sem_clockwait(CLOCK_MONOTONIC)

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 03bbc6066ff40c62edd57612be9150dcf1b123c8 by Victor Stinner in 
branch 'main':
bpo-41710: Fix What's New Entry credit (GH-28962)
https://github.com/python/cpython/commit/03bbc6066ff40c62edd57612be9150dcf1b123c8


--

___
Python tracker 

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



[issue45476] [C API] Convert "AS" functions, like PyFloat_AS_DOUBLE(), to static inline functions

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:

Raymond:
> AFAICT, no one has ever has problems with these being macros.

This issue is about the API of PyFloat_AS_DOUBLE(). Implementing it as a macro 
or a static inline function is an implementation detail which doesn't matter. 
But I don't know how to disallow "PyFloat_AS_DOUBLE(obj) = value" if it is 
defined as a macro.

Have a look at the Facebook "nogil" project which is incompatible with 
accessing directly the PyObject.ob_refcnt member:
"Extensions must use Py_REFCNT and Py_SET_REFCNT instead of directly accessing 
reference count fields"
https://docs.google.com/document/d/18CXhDb1ygxg-YXNBJNzfzZsDFosB5e6BfnXLlejd9l0/edit

Raymond:
> You could simply document, "don't do that".

Documentation doesn't work. Developers easily fall into traps when it's 
possible to fall. See bpo-30459 for such trap with PyList_SET_ITEM() and 
PyCell_SET() macros. They were misused by two Python projects.


Raymond:
> We really don't have to go on thin ice converting to functions that might or 
> might not be inlined depending on compiler specific nuances.

Do you have a concrete example where a static inline function is not inlined, 
whereas it was inlined when it was a macro? So far, I'm not aware of any 
performance issue like that.

There were attempts to use __attribute__((always_inline)) (Py_ALWAYS_INLINE), 
but so far, using it was not a clear win.

--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27252
pull_request: https://github.com/python/cpython/pull/28963

___
Python tracker 

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



[issue41710] threading.Lock.acquire(timeout) should use sem_clockwait(CLOCK_MONOTONIC)

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27251
pull_request: https://github.com/python/cpython/pull/28962

___
Python tracker 

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



[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Aaron Koch


Aaron Koch  added the comment:

Are there any other names that you would contemplate besides `from_name` and 
`from_value`?  My reading of your response indicates that you are fundamentally 
opposed to the addition of class methods, since they would limit the space of 
possible instance methods/members.  Is that a fair reading?

If it is not, would you be open to different method names?

Do you agree with the fundamental issue that is identified: that the 
parenthesis/square bracket construction is difficult to read and makes 
implementation mistakes more likely?  That it would be good to have some what 
to make it more explicit at both read and write time whether the enum is being 
constructed using the name or the value.

One alternative to the class methods I might propose is to use a keyword 
argument in the __init__ function.
SomeEnum(name="foo")
SomeEnum(value="bar")

This would also solve the stated problem, but I suspect that messing with the 
init function introduces more limitations to the class than the classmethod 
solution.

--

___
Python tracker 

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



[issue45476] [C API] Convert "AS" functions, like PyFloat_AS_DOUBLE(), to static inline functions

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 284994762d820d8e09cc019f8f7c4bc501e37dd4 by Victor Stinner in 
branch 'main':
bpo-45434: Limited Python.h no longer includes stdio.h (GH-28960)
https://github.com/python/cpython/commit/284994762d820d8e09cc019f8f7c4bc501e37dd4


--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27249
pull_request: https://github.com/python/cpython/pull/28960

___
Python tracker 

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



[issue45474] [C API] marshal.h must not use FILE* type in the limited C API

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


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



[issue45442] Update `Virtual Environment` tutorial

2021-10-14 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +27248
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28959

___
Python tracker 

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



[issue45474] [C API] marshal.h must not use FILE* type in the limited C API

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset af1083e975b9627a5c97013d3a2b9aef0e4b333c by Victor Stinner in 
branch 'main':
bpo-45474: Fix the limited C API of marshal.h (GH-28956)
https://github.com/python/cpython/commit/af1083e975b9627a5c97013d3a2b9aef0e4b333c


--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -23644

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue since there is new activity on it :-)

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27247
pull_request: https://github.com/python/cpython/pull/28958

___
Python tracker 

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



[issue45476] [C API] Convert "AS" functions, like PyFloat_AS_DOUBLE(), to static inline functions

2021-10-14 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> These macros can be abused to be used as l-value

You could simply document, "don't do that".  Also if these is a need to make an 
assignment, you're now going to have to create a new setter function to fill 
the need.

We really don't have to go on thin ice converting to functions that might or 
might not be inlined depending on compiler specific nuances.

AFAICT, no one has ever has problems with these being macros.  There really 
isn't a problem to be solved and the "solution" may in fact introduce new 
problems that we didn't have before.

Put me down for a -1 on the these blanket macro-to-inline function rewrites.  
The premise is almost entirely a matter of option, "macros are bad, functions 
are good" and a naive assumption, "inline functions" always inline.

--
nosy: +lemburg, rhettinger

___
Python tracker 

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



[issue29595] Expose max_queue_size in ThreadPoolExecutor

2021-10-14 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0a883a76cda8205023c52211968bcf87bd47fd6e by Victor Stinner in 
branch 'main':
bpo-35134: Add Include/cpython/floatobject.h (GH-28957)
https://github.com/python/cpython/commit/0a883a76cda8205023c52211968bcf87bd47fd6e


--

___
Python tracker 

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



[issue21736] Add __file__ attribute to frozen modules

2021-10-14 Thread Eric Snow


Eric Snow  added the comment:

I've merged the change to add __file__ for frozen stdlib modules (when 
possible) and to set __path__ appropriately.  There are still a number of 
things to address though:

* set co_filename (for tracebacks)
* implement FrozenImporter.get_filename()
* implement FrozenImporter.get_source()

And then there's the question of supporting __file__, etc. for custom frozen 
modules.  Presumably all those things are still covered by this issue so I'm 
leaving it open.

--
stage: patch review -> needs patch
versions: +Python 3.11 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue21736] Add __file__ attribute to frozen modules

2021-10-14 Thread Eric Snow


Eric Snow  added the comment:


New changeset 79cf20e48d0b5d69d9fac2a0204b5ac2c366066a by Eric Snow in branch 
'main':
bpo-21736: Set __file__ on frozen stdlib modules. (gh-28656)
https://github.com/python/cpython/commit/79cf20e48d0b5d69d9fac2a0204b5ac2c366066a


--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-10-14 Thread Eric Snow


Eric Snow  added the comment:

Thanks, Victor!

--

___
Python tracker 

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



[issue45477] configure script cannot detect float word ordering on linux

2021-10-14 Thread Sourish Basu


New submission from Sourish Basu :

I am trying to compile Python 3.10.0 on a Red Hat linux system with intel C/C++ 
compilers. This is my configure command:

```
./configure --with-computed-gotos --without-gcc --with-ensurepip=install 
--enable-optimizations --with-libm=-limf --with-cxx-main=icpc --with-threads 
--enable-ipv6 --with-signal-module CC=icc CXX=icpc LD=xild AR=xiar 
LIBS='-lpthread -limf -lirc' CFLAGS='-O3 -fPIC -fp-model strict -fp-model 
source -axCORE-AVX512,CORE-AVX2 -xAVX -ipo -prec-div -prec-sqrt' LDFLAGS='-ipo' 
CPP='icc -E'
```

The failure comes as follows:

```
checking for --with-libm=STRING... set LIBM="-limf"
checking for --with-libc=STRING... default LIBC=""
checking for x64 gcc inline assembler... yes
checking whether float word ordering is bigendian... unknown
configure: error:

Unknown float word ordering. You need to manually preset
ax_cv_c_float_words_bigendian=no (or yes) according to your system.
```

I saw issue 38527 was fixed in 3.10. Perhaps fixing it on Solaris broke it on 
some other platforms?

--
components: Installation
messages: 403951
nosy: sourish.basu
priority: normal
severity: normal
status: open
title: configure script cannot detect float word ordering on linux
type: compile error
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



[issue45476] [C API] Convert "AS" functions, like PyFloat_AS_DOUBLE(), to static inline functions

2021-10-14 Thread STINNER Victor


New submission from STINNER Victor :

The Python C API provides "AS" functions to convert an object to another type, 
like PyFloat_AS_DOUBLE(). These macros can be abused to be used as l-value: 
"PyFloat_AS_DOUBLE(obj) = new_value;". It prevents to change the PyFloat 
implementation and makes life harder for Python implementations other than 
CPython.

I propose to convert these macros to static inline functions to disallow using 
them as l-value.

I made a similar change for Py_REFCNT(), Py_TYPE() and Py_SIZE(). For these 
functions, I added "SET" variants: Py_SET_REFCNT(), Py_SET_TYPE(), 
Py_SET_SIZE(). Here, I don't think that the l-value case is legit, and so I 
don't see the need to add a way to *set* a value.

For example, I don't think that PyFloat_SET_DOUBLE(obj, value) would make 
sense. A Python float object is supposed to be immutable.

--
components: C API
messages: 403950
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] Convert "AS" functions, like PyFloat_AS_DOUBLE(), to static 
inline functions
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



[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Ethan Furman


Ethan Furman  added the comment:

The problem with adding methods is that those names are then unavailable for 
member names -- at least not without possible confusion.

Also, unlike the `name` and `value` instance attributes which do not hide class 
attributes (aka members) of the same name, `from_name` is a class method so we 
couldn't have both a `from_name()` class method and a `from_name` class member 
at the same time.

If those are issues you know wouldn't a problem for you, you can create your 
own base Enum class with those methods defined, and then inherit from them:

class EasyEnum(Enum):
@classmethod
def from_name(cls, name):
return cls[name]
# etc

 class MyEnum(EasyEnum):
  RED = 1
  # etc.

On the other hand, if you want to use this with any enum, then you'll need to 
make your own helper functions:

def from_name(enum, name):
return enum[name]

enum_member = from_name(MyEnum, 'RED')

--

___
Python tracker 

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



[issue45475] gzip fails to read a gzipped file (ValueError: readline of closed file)

2021-10-14 Thread minstrelofc


New submission from minstrelofc :

Attempting to iterate over an opened gzip file raises a ValueError: readline of 
closed file

Behavior in Python 3.9.7:
Python 3.9.7 (default, Oct 13 2021, 09:08:19) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gzip
>>> ll = [l for l in gzip.GzipFile(filename='data/UTF-8-test_for_gzip.txt.gz')]
>>> len(ll)
300


Behavior in Python 3.10.0 (and 3.11.0a1 is the same):
Python 3.10.0 (default, Oct 13 2021, 08:53:15) [GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gzip
>>> ll = [l for l in gzip.GzipFile(filename='data/UTF-8-test_for_gzip.txt.gz')]
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
ValueError: readline of closed file


This only happens when iterating directly over the GzipFile object. Using a 
with: statement has the correct behaviour in both 3.10 and 3.11:
>>> with gzip.GzipFile(filename='UTF-8-test_for_gzip.txt.gz') as input_file:
... len(list(input_file))
... 
300

--
files: UTF-8-test_for_gzip.txt.gz
messages: 403948
nosy: minstrelofc
priority: normal
severity: normal
status: open
title: gzip fails to read a gzipped file (ValueError: readline of closed file)
type: behavior
versions: Python 3.10, Python 3.11
Added file: https://bugs.python.org/file50358/UTF-8-test_for_gzip.txt.gz

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27246
pull_request: https://github.com/python/cpython/pull/28957

___
Python tracker 

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



[issue45417] Enum creation non-linear in the number of values

2021-10-14 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset b2af211e229df941d9b404f69547a264115156b5 by Carl Friedrich 
Bolz-Tereick in branch 'main':
bpo-45417: [Enum] fix quadratic behavior during creation (GH-28907)
https://github.com/python/cpython/commit/b2af211e229df941d9b404f69547a264115156b5


--

___
Python tracker 

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



[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-14 Thread Eric Snow


Eric Snow  added the comment:

@MAL, what's the best way to make sure Tools/freeze is still working?  I don't 
see any tests for it in the test suite.  I tried running the test in 
Tools/freeze/test, but I can't get that to work on main (or on the 3.10 branch).

--

___
Python tracker 

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



[issue45468] Add support for preloading a Python script

2021-10-14 Thread Gabriele N Tornetta


Gabriele N Tornetta  added the comment:

That's totally fine. My aim is to have something in place that would make 
preloading some code less clunky than what it is just now.

--

___
Python tracker 

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



[issue45471] _Py_path_config.stdlib_dir should not be set in Py_SetPythonHome().

2021-10-14 Thread Eric Snow


Change by Eric Snow :


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



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-10-14 Thread Eric Snow


Eric Snow  added the comment:


New changeset 0bbea0723ee07f9d7ad9745f0e1875718ef38715 by Eric Snow in branch 
'main':
bpo-45471: Do not set PyConfig.stdlib_dir in Py_SetPythonHome(). (gh-28954)
https://github.com/python/cpython/commit/0bbea0723ee07f9d7ad9745f0e1875718ef38715


--

___
Python tracker 

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



[issue45471] _Py_path_config.stdlib_dir should not be set in Py_SetPythonHome().

2021-10-14 Thread Eric Snow


Eric Snow  added the comment:


New changeset 0bbea0723ee07f9d7ad9745f0e1875718ef38715 by Eric Snow in branch 
'main':
bpo-45471: Do not set PyConfig.stdlib_dir in Py_SetPythonHome(). (gh-28954)
https://github.com/python/cpython/commit/0bbea0723ee07f9d7ad9745f0e1875718ef38715


--

___
Python tracker 

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



[issue45468] Add support for preloading a Python script

2021-10-14 Thread Christian Heimes


Christian Heimes  added the comment:

We generally prefer to have only way way to accomplish a goal. If PEP 648 gets 
accepted then your proposal won't be accepted. In case the PEP is rejected, 
then your proposal may still be rejected or may require a new PEP. Preloading 
has some complicated edge cases, e.g. how it behaves in regards of import 
errors, subinterpreters, various security flags and startup options.

--

___
Python tracker 

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



[issue45474] [C API] marshal.h must not use FILE* type in the limited C API

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue45474] [C API] marshal.h must not use FILE* type in the limited C API

2021-10-14 Thread STINNER Victor


New submission from STINNER Victor :

Include/marshal.h defines 2 functions with FILE* argument in the limited C API, 
whereas the PEP 384 disallows that:

"In addition, functions expecting FILE* are not part of the ABI, to avoid 
depending on a specific version of the Microsoft C runtime DLL on Windows."
https://www.python.org/dev/peps/pep-0384/

PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int);
PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int);

I propose to exclude these functions from the limited C API.

Hopefully, they are not part of the documented stable ABI.

--
components: C API
messages: 403941
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] marshal.h must not use FILE* type in the limited C API
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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:

I tried to remove the  include from Python.h:

-#include// memcpy()

... but it required me to modify 100+ files. I don't know the exact number, I 
gave up after 100 files. I was near half of C extensions built by setup.py, so 
the number total may be around 150 files which should include explicitly 
.

"#include " can now be removed from Python.h, but I'm not sure if it's 
a good idea. I started by removing  and my plan is to see if it 
breaks third party C extensions. Right now, Cython is broken which prevents me 
to use my https://github.com/vstinner/pythonci tool :-(

--

___
Python tracker 

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



[issue45439] [C API] Move usage of tp_vectorcall_offset from public headers to the internal C API

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:

I decided to merge my PR to address https://bugs.python.org/issue45439 initial 
issue: "[C API] Move usage of **tp_vectorcall_offset** from public headers to 
the internal C API".

Last years, I added `tstate` parameters to internal C functions. The agreement 
was that only internal functions should use it, and indirectly that this 
`tstate` parameter should be hidden. I'm now sure exactly, but `tstate` started 
to pop up in `Include/cpython/abstract.h` around "call" functions. This PR fix 
this issue.

About the impact on performances: well, it's really hard to draw a clear 
conclusion. Inlining, LTO and PGO give different results on runtime performance 
and stack memory usage.

IMO the fact that public C API functions are now regular functions should not 
prevent us to continue (micro) optimizing Python. We can always add a variant 
to the internal C API using an API a little bit different (e.g. add `tstate` 
parameter) or defined as a static inline function, rather than a regular 
function.

The unclear part is if PyObject_CallOneArg() (regular function call) is faster 
than _PyObject_CallOneArg() (static inline function, inlined). The performance 
may depend if it's called in the Python executable or in a dynamic library (PLT 
indirection which may be avoided by `gcc -fno-semantic-interposition`).

Well, happy hacking and let's continue *continuous* benchmarking Python!

--

___
Python tracker 

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



[issue45468] Add support for preloading a Python script

2021-10-14 Thread Gabriele N Tornetta


Gabriele N Tornetta  added the comment:

@christian.heimes thanks for bringing PEP 648 to my attention. The solution 
proposed there would work for me, although it actually does a bit more with 
some extra complexity. Not a big issue though.

@eric.smith I think that, as argued in PEP 648, pth files are not meant to be 
used to inject arbitrary code. Besides, the way to exploit pth files wouldn't 
be much more different than what I described in the issue body.

--

___
Python tracker 

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



[issue45439] [C API] Move usage of tp_vectorcall_offset from public headers to the internal C API

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3cc56c828d2d8f8659ea49447234bf0d2b87cd64 by Victor Stinner in 
branch 'main':
bpo-45439: Move _PyObject_VectorcallTstate() to pycore_call.h (GH-28893)
https://github.com/python/cpython/commit/3cc56c828d2d8f8659ea49447234bf0d2b87cd64


--

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
nosy: +ethan.furman
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



[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Aaron Koch


New submission from Aaron Koch :

Documentation: https://docs.python.org/3/library/enum.html#creating-an-enum

Current behavior:

SomeEnum[name] is used to construct an enum by name
SomeEnum(value) is used to construct an enum by value

Problem:

As a user of enums, it is difficult to remember the mapping between 
parenthesis/square brackets and construct from name/construct from value.

Suggestion: Add two class methods to Enum

@classmethod
def from_name(cls, name):
return cls[name]

@classmethod
def from_value(cls, value):
return cls(value)


Benefits:

This is an additive change only, it doesn't change any behavior of the Enum 
class, so there are no backwards compatibility issues.  Adding these aliases to 
the Enum class would allow readers and writers of enums to interact with them 
more fluently and with less trips to the documentation.  Using these aliases 
would make it easier to write the code you intended and to spot bugs that might 
arise from the incorrect use of from_name or from_value.

--
messages: 403936
nosy: aekoch
priority: normal
severity: normal
status: open
title: Enum add "from_name" and "from_value" class methods
type: enhancement

___
Python tracker 

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



[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy: I suppose that this issue can now be closed?

--

___
Python tracker 

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



[issue45472] Add public C API for partial "unicode-escape" and "raw-unicode-escape" decoding

2021-10-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45468] Add support for preloading a Python script

2021-10-14 Thread Christian Heimes


Christian Heimes  added the comment:

There is also https://www.python.org/dev/peps/pep-0648/

--
nosy: +christian.heimes

___
Python tracker 

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



[issue45404] Undefined I_* macros of stropts.h when building Python 3.10 on Ubuntu: fail to build the fcntl module

2021-10-14 Thread Christian Heimes


Christian Heimes  added the comment:

I'm glad you figured out the problem and fixed your system.

Python uses autoconf (configure) to detect the presence of features. It's a 
standard approach. Since you had a stropts.h in your include directory, 
configure declared HAVE_STROPTS_H. The system can't deal with incompatible 
stropts.h.

We could add more checks and workaround. IMHO it's not worth the effort and 
time. We assume standard behavior and APIs in lots of places.

--
nosy: +christian.heimes
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



[issue45472] Add public C API for partial "unicode-escape" and "raw-unicode-escape" decoding

2021-10-14 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR adds C API functions PyUnicode_DecodeUnicodeEscapeStateful() 
and PyUnicode_DecodeRawUnicodeEscapeStateful() for partially decoding with 
"unicode-escape" and "raw-unicode-escape" encodings. It were the only multibyte 
text codecs which did not provide such interface.

They are neccessary for correct implementation of increment decoders and stream 
 readers (see issue45461 and issue45467).

--
components: Unicode
messages: 403932
nosy: ezio.melotti, lemburg, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Add public C API for partial "unicode-escape" and "raw-unicode-escape" 
decoding
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



[issue45404] Undefined I_* macros of stropts.h when building Python 3.10 on Ubuntu: fail to build the fcntl module

2021-10-14 Thread Diego Alonso


Diego Alonso  added the comment:

I had an empty stropts.h lying around somewhere in /usr/* (can't remember 
where) because some programs don't compile if they don't see that file (even an 
empty one suffices). But Python doesn't compile if it sees it... So I deleted 
stropts.h and then ran ./configure again, compiled, and it worked.

The Python build code should be modified to set HAVE_STROPTS_H to 0 on 
platforms (like Linux) that don't support stropts.h

--

___
Python tracker 

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



[issue45384] Accept Final as indicating ClassVar for dataclass

2021-10-14 Thread Gregory Beauregard


Gregory Beauregard  added the comment:

Hi Michael,

Thanks for taking the time to look into this.

I don't feel strongly enough about following the existing PEP wording to desire 
creating a situation where instance vars can't be marked Final if we can 
instead make a workaround with ClassVar[Final[...]]. Plus, I can appreciate the 
argument that dataclasses are their own thing that should be treated specially 
in the PEP.

If you know what's involved in formally proposing and enacting a PEP amendment 
I can get behind that.

--

___
Python tracker 

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



[issue45468] Add support for preloading a Python script

2021-10-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

Can you accomplish what you want with .pth files?

--
nosy: +eric.smith

___
Python tracker 

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



[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 684860280687561f6312e206c4ccfbe4baa17e89 by Serhiy Storchaka in 
branch '3.9':
bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" 
codec (GH-28944) (GH-28953)
https://github.com/python/cpython/commit/684860280687561f6312e206c4ccfbe4baa17e89


--

___
Python tracker 

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



[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4641afef661e6a22bc64194bd334b161c95edfe2 by Serhiy Storchaka in 
branch '3.10':
[3.10] bpo-45467: Fix IncrementalDecoder and StreamReader in the 
"raw-unicode-escape" codec (GH-28944) (GH-28952)
https://github.com/python/cpython/commit/4641afef661e6a22bc64194bd334b161c95edfe2


--

___
Python tracker 

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



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-10-14 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +27243
pull_request: https://github.com/python/cpython/pull/28954

___
Python tracker 

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



[issue45471] _Py_path_config.stdlib_dir should not be set in Py_SetPythonHome().

2021-10-14 Thread Eric Snow


Change by Eric Snow :


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

___
Python tracker 

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



[issue45471] _Py_path_config.stdlib_dir should not be set in Py_SetPythonHome().

2021-10-14 Thread Eric Snow


New submission from Eric Snow :

(This follows bpo-45211.)

In gh-28586 I added the code in Py_SetPythonHome() to set 
_Py_path_config.stdlib_dir to the provided directory.  However, this is the 
wrong value.  Furthermore, the relationship between _Py_path_config.home and 
_Py_path_config.stdlib_dir is meant to managed in Modules/getpath.c (and 
PC/getpathp.c).  So the code setting _Py_path_config.stdlib_dir in 
Py_SetPythonHome() should be dropped.

--
assignee: eric.snow
components: Interpreter Core
messages: 403926
nosy: eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: _Py_path_config.stdlib_dir should not be set in Py_SetPythonHome().
type: behavior
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



[issue45462] Speed up re.match with pre-compiled patterns

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Calling re.math() with a pre-compiled pattern is an uncommon case. Common cases 
are calling re.math() with a string pattern and calling the math() method of a 
pre-compiled pattern.

Your change speeds up an uncommon case but slows down a common case.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Examples of using the new feature.

--

___
Python tracker 

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



[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +27241
pull_request: https://github.com/python/cpython/pull/28953

___
Python tracker 

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



[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +27240
pull_request: https://github.com/python/cpython/pull/28952

___
Python tracker 

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



[issue45448] PIP package installation failure for multiple packages

2021-10-14 Thread Zayden Micheal James


Zayden Micheal James  added the comment:

Oh so the problem will resolve itself when they, support Python 3.10 PIP 21.2.4.

Sorry for the inconvenience. Can't wait for the libraries to be resolved and 
optimized

--

___
Python tracker 

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



[issue45470] possible bug in datetime.timestamp()

2021-10-14 Thread Stefan


Stefan  added the comment:

sorry it's resolved. it was a timezone issue:

In [2]: d0 = datet.datetime(2016,3,27,tzinfo=datet.timezone.utc)

In [3]: d1 = datet.datetime(2016,3,28,tzinfo=datet.timezone.utc)

In [4]: (d1-d0).total_seconds()/3600
Out[4]: 24.0

In [5]: (d1.timestamp()-d0.timestamp())/3600
Out[5]: 24.0

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



[issue45470] possible bug in datetime.timestamp()

2021-10-14 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 39aa98346d5dd8ac591a7cafb467af21c53f1e5d by Serhiy Storchaka in 
branch 'main':
bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" 
codec (GH-28944)
https://github.com/python/cpython/commit/39aa98346d5dd8ac591a7cafb467af21c53f1e5d


--

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7c722e32bf582108680f49983cf01eaed710ddb9 by Serhiy Storchaka in 
branch '3.9':
[3.9] bpo-45461: Fix IncrementalDecoder and StreamReader in the 
"unicode-escape" codec (GH-28939) (GH-28945)
https://github.com/python/cpython/commit/7c722e32bf582108680f49983cf01eaed710ddb9


--

___
Python tracker 

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



[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 0bff4ccbfd3297b0adf690655d3e9ddb0033bc69 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-45461: Fix IncrementalDecoder and StreamReader in the 
"unicode-escape" codec (GH-28939) (GH-28943)
https://github.com/python/cpython/commit/0bff4ccbfd3297b0adf690655d3e9ddb0033bc69


--

___
Python tracker 

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



[issue45464] TypeError when inheriting from both OSError and AttributeError

2021-10-14 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Also, just to clarify something: there is no guarantee that multiple build-in, 
unrelated exceptions can be inherited and this is not supported. And this is 
not unique to this case. For example:

>>> class A(StopIteration, OSError):
......
...
Traceback (most recent call last):
  File "", line 1, in 
TypeError: multiple bases have instance lay-out conflict

>>> class A(SyntaxError, OSError):
...pass
...
Traceback (most recent call last):
  File "", line 1, in 
TypeError: multiple bases have instance lay-out conflict
>>> class A(ModuleNotFoundError, OSError):
......
...
Traceback (most recent call last):
  File "", line 1, in 
TypeError: multiple bases have instance lay-out conflict

--

___
Python tracker 

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



[issue45470] possible bug in datetime.timestamp()

2021-10-14 Thread Stefan


New submission from Stefan :

I noticed that there is a difference between intervals when computed from 
timedeltas vs timestamps. Is this a bug? Thanks!

In [2]: import datetime as datet
In [3]: d0 = datet.datetime(2016,3,27)
In [4]: d1 = datet.datetime(2016,3,28)
In [5]: (d1-d0).total_seconds()/3600
Out[5]: 24.0
In [6]: (d1.timestamp()-d0.timestamp())/3600
Out[6]: 23.0

--
messages: 403917
nosy: stef
priority: normal
severity: normal
status: open
title: possible bug in datetime.timestamp()
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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Dong-hee Na


Dong-hee Na  added the comment:

> Please show examples.

Sorry, I don't understand, do you mean caching example or recovery example?
When we use rocksdb, we can get checkpoints files under local file system.
And we can recover the database by using them.
http://rocksdb.org/blog/2015/11/10/use-checkpoints-for-efficient-snapshots.html

If we provide gdbm for similar things, users can recover the database when the 
accident happens, I believe that it sometimes happens.(Power out, hardware 
fault etc..)
The recovering tool itself does not need to be Python, but python client needs 
to have a option to save snapshot, but currently not.

Please read how to recover the database if they have snapshots for gdbm.
https://www.gnu.org.ua/software/gdbm/manual/Crash-recovery.html

--

___
Python tracker 

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



[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-14 Thread Alex Waygood


Alex Waygood  added the comment:

Have posted my PR. I've tested it manually and run the IDLE test suite on it 
with the `-u all` setting; it seems fine. The new tests I've written are a bit 
thin on the ground right now, though. I may need some guidance/help if more 
extensive tests are needed -- I'm a little new to unittest.

One other thing I'm not sure on: the docstring at the top of `browser.py` 
includes the line "- finish removing limitation to x.py files 
(ModuleBrowserTreeItem)" in the TODO items. Can this be removed now?

--

___
Python tracker 

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



[issue45464] TypeError when inheriting from both OSError and AttributeError

2021-10-14 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Unfortunately there isn't much we can do here other than document this :(

--

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Please show examples.

--

___
Python tracker 

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



[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-14 Thread Alex Waygood


Change by Alex Waygood :


--
keywords: +patch
pull_requests: +27239
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/28950

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Dong-hee Na


Dong-hee Na  added the comment:

Yeah, I agree with gdbm_latest_snapshot(), this API might be too low-level.
But as I am one of the rocksdb user who directly uses rocksdb API for the 
production platform as caching purposes.
so when I think about my and my team's rocksdb usage, gdbm_failure_atomic() 
itself can be useful if the user needs snapshots if they need to recover for 
the special situation.

--

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am interesting how these gdbm_failure_atomic() and gdbm_latest_snapshot() can 
be used in user code. Some real world examples. They look very low-level and 
requiring an additional boilerplate code to be useful if I understand it 
correctly.

--

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Dong-hee Na


Dong-hee Na  added the comment:

dbm.gdbm_failure_atomic('snapshot_path0', 'snapshot_path1')

-> db.gdbm_failure_atomic('snapshot_path0', 'snapshot_path1')

--

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Dong-hee Na


Dong-hee Na  added the comment:

Sorry, I don't know my answer is enough.
Or do you have any ideas or the opposite ideas?

--

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Dong-hee Na


Dong-hee Na  added the comment:

> And what's next?

I may introduce following API which only available to use extension format.
(I am PoC with this)

> dbm.gdbm_failure_atomic('snapshot_path0', 'snapshot_path1')


About gdbm_latest_snapshot(), I am still curious that Python module should 
provide this API so I am still communicating with original authors about this.

--

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

And what's next?

--

___
Python tracker 

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



[issue45464] TypeError when inheriting from both OSError and AttributeError

2021-10-14 Thread Christian Heimes


Christian Heimes  added the comment:

You are correct. To be more precise, it's caused by GH-16856. The commit 
introduced PyAttributeErrorObject struct. Since AttributeError and OSError now 
have an incompatible memory layout, it is no longer possible to create a 
subclass that has AttributeError and OSError as parent classes.

--
keywords: +3.10regression
nosy: +christian.heimes
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



[issue45367] Specialize BINARY_MULTIPLY

2021-10-14 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 3b3d30e8f78271a488965c9cd11136e1aa890757 by Dennis Sweeney in 
branch 'main':
bpo-45367: Specialize BINARY_MULTIPLY (GH-28727)
https://github.com/python/cpython/commit/3b3d30e8f78271a488965c9cd11136e1aa890757


--

___
Python tracker 

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



[issue45464] TypeError when inheriting from both OSError and AttributeError

2021-10-14 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +pablogsal

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Dong-hee Na


Dong-hee Na  added the comment:

> How would it be used from Python? What are scenarios?

I am preparing PoC, I will share you once done.

>From gdbm 1.21, gdbm provides 2 kinds of format. (Standard format / Extended 
>format.)
To create a gdm format with the extended option, GDBM_NUMSYNC flag needs to be 
supported.
Without this, there is no way to create a database file with extension option 
from Python module.

I am thinking about the following usage.

import dbm.gnu as dbm
db = dbm.open('x.db', 'nx')

--

___
Python tracker 

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



[issue34897] distutils test errors when CXX is not set

2021-10-14 Thread Jan Pieczkowski


Jan Pieczkowski  added the comment:

This issue also still affects Python versions 3.6.15 and 3.7.12

IMHO it would make sense to backport this patch to the 3.6 and 3.7 branches, 
especially as it only affects one line of code and doesn't seem to affect 
anything else, but solves the same issue for prior python versions as the 
merged patch did for 3.8+

--
nosy: +physicalist

___
Python tracker 

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2021-10-14 Thread Lincoln Puzey


Change by Lincoln Puzey :


--
nosy: +LincolnPuzey
nosy_count: 10.0 -> 11.0
pull_requests: +27238
pull_request: https://github.com/python/cpython/pull/28947

___
Python tracker 

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



  1   2   >