[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-27 Thread jiahua wang


Change by jiahua wang :


--
nosy: +wangjiahua
nosy_count: 9.0 -> 10.0
pull_requests: +30229
pull_request: https://github.com/python/cpython/pull/32149

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-27 Thread Mariusz Felisiak


Change by Mariusz Felisiak :


--
pull_requests: +30228
pull_request: https://github.com/python/cpython/pull/32148

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-27 Thread Mariusz Felisiak


Change by Mariusz Felisiak :


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

___
Python tracker 

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



[issue47103] Copy pgort140.dll when building for PGO

2022-03-27 Thread neonene


Change by neonene :


--
nosy: +neonene
nosy_count: 4.0 -> 5.0
pull_requests: +30226
pull_request: https://github.com/python/cpython/pull/32146

___
Python tracker 

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



[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-03-27 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 86384cf83f96fcaec03e2ad6516e2e24f20d3b92 by vidhya in branch 
'main':
bpo-28516: document contextlib.ExitStack.__enter__ behavior (GH-31636)
https://github.com/python/cpython/commit/86384cf83f96fcaec03e2ad6516e2e24f20d3b92


--

___
Python tracker 

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



[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-03-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30225
pull_request: https://github.com/python/cpython/pull/32145

___
Python tracker 

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



[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-03-27 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-03-27 Thread Takuo Matsuoka


Takuo Matsuoka  added the comment:

Thank you for your response.

I think __name__ here is very different from __len__ .

(1) Even if you set __name__ to what should be the right value, e.g.,
when my class O will be a subclass of say 'type', and __name__ is an
appropriate thing for your purposes to override the attribute
'__name__' of 'type' objects (held as the entry '__name__' of
type.__dict__), the same value is going to be O.__dict__["__module__"]
as long as you let __prepare__ of the mataclass C provide it.


(2) Even if, in other cases, you do

del __name__

at the end of the body of the class O, the problem remains unless you
know O.__dict__["__module__"] will be changed anyway.


The behaviour is not documented as far as I could see.  I think such a
behaviour is problematic if it can't be expected from what's
documented.  If the value of __name__ can be read from the scope
outside, then that will erase this unexpected behaviour and I think it
would be a much safer thing to do.

Thanks.

--

___
Python tracker 

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



[issue45382] platform() is not able to detect windows 11

2022-03-27 Thread Evernow


Evernow  added the comment:

As mentioned wmic is deprecated ( 
https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmic ). 

I don't see why the wmi module ( https://pypi.org/project/WMI/ ) can't be used 
instead to get the information, I have a working implementation of this that 
simply does the following: 

current_major_version = 
wmi.WMI().Win32_OperatingSystem()[0].Caption.encode("ascii", "ignore").decode(
"utf-8")
if "8" in current_major_version:
pass
elif "7" in current_major_version:  
pass
elif "10" in current_major_version:  
pass
elif "11" in current_major_version:
pass

--
nosy: +Evernow

___
Python tracker 

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



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

2022-03-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I think this may fine as-is.  In general, virtiual classes only promise that an 
operation will work rather than promsing the presence of a particular method.

An object can be Iterable without defining __iter__ because iter() can use 
__getitem__ and __len__ to build a sequence iterator.  Likewise, an object can 
be a Container without defining __contains__ because the in-operator will work 
on any iterable.  An object can be Reversible without defining __reversed__ 
because reversed() will fall back to an implementation based on __getitem__ and 
__len__.

The docstring in numbers.Complex promises, "Complex defines the operations that 
work on the builtin complex type.  In short, those are: a conversion to 
complex, .real, .imag, +, -, *, /, **, abs(), .conjugate, ==, and !=."

In other words, the promise is that these work (which they do):

   >>> complex(0.0)
   0j
   >>> int(0.0)
   0

--
nosy: +rhettinger

___
Python tracker 

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



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-27 Thread ty


Change by ty :


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

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-27 Thread Ned Deily


Ned Deily  added the comment:

3.38.2 was released on 2022-03-26. Since the update to 3.38.1 hasn't yet been 
in a 3.11.0 alpha release, I'm re-open this issue.

https://sqlite.org/releaselog/3_38_2.html

--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
title: Update Windows and MacOS installer to SQLite 3.38.1 -> Update Windows 
and MacOS installer to SQLite 3.38.2

___
Python tracker 

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



[issue47137] MemoryError

2022-03-27 Thread qiu

qiu <1425166...@qq.com> added the comment:

hello,Did you get the E-mail about one random input I sent you?
one random input is
[O[m[[E[[[ly[[))
looking forward to your reply! thanks!

--原始邮件--
发件人:
"Python tracker"

https://bugs.python.org/issue47137;
___

--

___
Python tracker 

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



[issue47133] enhance unittest to show test name and docstring on one line

2022-03-27 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Rather than an option for this, it would be cleaner to deprecate the 
current output in 3.11, and fix it in 3.12 or 3.13.

Otherwise we have to maintain the old (bad?) output and the new output 
both forever.

--

___
Python tracker 

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



[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-03-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

So IIUC the "autosuper" idea is to assign a special instance of super to 
self.__super, so that you can write self.__super.method(...) to invoke a super 
method, using the magic of __private variables, instead of having to write 
super(classname, self).method(...).

That was perhaps a good idea 20 years ago, but nowadays you can use 
argument-less super(), so you can write super().method(...), and AFAICT that 
works for class methods too.

I don't think we need two ways to do it.

--

___
Python tracker 

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



[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-03-27 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> the programmer may use the variable __name__ for some other purposes

Dunder names like `__name__` are reserved for the use of the interpreter. If 
the programmer uses them for "other purposes", the programmer is responsible 
for any failures.

You wouldn't write:

class MyList(list):
__len__ = "Hello world!"

and then be surprised that MyList is broken. You shouldn't be surprised if 
setting `__name__` to an invalid value breaks things either.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30223
pull_request: https://github.com/python/cpython/pull/32141

___
Python tracker 

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



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-27 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset f6b3a07b7df60dc04d0260169ffef6e9796a2124 by ty in branch 'main':
bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)
https://github.com/python/cpython/commit/f6b3a07b7df60dc04d0260169ffef6e9796a2124


--

___
Python tracker 

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



[issue47127] Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS

2022-03-27 Thread Ken Jin


Ken Jin  added the comment:


New changeset 58448cbd96f77ebc6fca1f8030bedc7744eb66ef by Kumar Aditya in 
branch 'main':
bpo-47127: Specialize calls for fastcall c methods with keywords (GH-32125)
https://github.com/python/cpython/commit/58448cbd96f77ebc6fca1f8030bedc7744eb66ef


--
nosy: +kj

___
Python tracker 

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



[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2022-03-27 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue46429] Merge all deepfrozen files into one

2022-03-27 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 785cc6770588de087d09e89a69110af2542be208 by Kumar Aditya in 
branch 'main':
bpo-46429: tweak deepfreeze output (#32107)
https://github.com/python/cpython/commit/785cc6770588de087d09e89a69110af2542be208


--

___
Python tracker 

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



[issue45171] stacklevel handling in logging module is inconsistent

2022-03-27 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset c12ba6b2ff7908c8970b978f149d51ecd3fb195c by Jouke Witteveen in 
branch 'main':
bpo-45171: Remove tests of deprecated logger.warn(). (GH-32139)
https://github.com/python/cpython/commit/c12ba6b2ff7908c8970b978f149d51ecd3fb195c


--

___
Python tracker 

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



[issue47124] explore hashlib use of the Apple CryptoKit macOS

2022-03-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I only pointed to that API after a brief search without looking at details 
(Swift? oops!). If there is one available from C that'd also make sense to 
consider.

The only things I expect, relevant to hashlib, that would be accelerated by OS 
native APIs most platforms are SHA2, maybe SHA1, and sometimes HMAC using those.

I'm in no position to judge if there is value in using them, I'm just assuming 
there might be.  The irony is that builds without OpenSSL are rare, so unless 
the OS native APIs provide tangible benefits it may not matter.

(ex: the Linux APIs may allow for an efficient zero-copy variant of the new 
`hashlib.file_digest()` function)

--

___
Python tracker 

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



[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2022-03-27 Thread Marek Suscak


Marek Suscak  added the comment:

Based on the changelog, it seems that the fix for this issue has only landed in 
Python 3.10 but it's still affecting versions 3.7, 3.8 and 3.9. There are a few 
projects such as Apache Beam that have only recently added support for Python 
3.9 with no support for 3.10. Beautiful Soup is a popular tool that's affected 
by this bug and so my question is if backporting this bugfix to at least Python 
3.9 which is still an officially supported release is on the table?

--
message_count: 11.0 -> 12.0
nosy: +mareksuscak
nosy_count: 8.0 -> 9.0
pull_requests: +30221
pull_request: https://github.com/python/cpython/pull/8562

___
Python tracker 

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



[issue45171] stacklevel handling in logging module is inconsistent

2022-03-27 Thread Jouke Witteveen


Change by Jouke Witteveen :


--
pull_requests: +30220
pull_request: https://github.com/python/cpython/pull/32139

___
Python tracker 

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



[issue45171] stacklevel handling in logging module is inconsistent

2022-03-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The commit seems to emit a deprecation warning in test_logging. Probably the 
warning needs to be handled while setting trigger = self.logger.warn

PYTHONWARNINGS=always ./python -Wall -m test test_logging   
0:00:00 load avg: 1.63 Run tests sequentially
0:00:00 load avg: 1.63 [1/1] test_logging
/home/karthikeyan/stuff/python/cpython/Lib/test/test_logging.py:5056: 
DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
  trigger('test', stacklevel=the_level)

== Tests result: SUCCESS ==

1 test OK.

Total duration: 20.1 sec
Tests result: SUCCESS

--
nosy: +xtreak

___
Python tracker 

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



[issue47129] Improve errors messages in f-string syntax errors

2022-03-27 Thread Maciej Górski

Maciej Górski  added the comment:

I agree as well. I will change it to the new version :) Thanks for your input 
in this.

--

___
Python tracker 

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



[issue47129] Improve errors messages in f-string syntax errors

2022-03-27 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

I like the newest suggestion by @Jelle better as well.

--

___
Python tracker 

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



[issue4833] Explicit directories for zipfiles

2022-03-27 Thread Sam Ezeh


Sam Ezeh  added the comment:

I'm looking into adding ZipFile.mkdir

--

___
Python tracker 

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



[issue45171] stacklevel handling in logging module is inconsistent

2022-03-27 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 5ca6d7469be53960843df39bb900e9c3359f127f by Jouke Witteveen in 
branch 'main':
bpo-45171: Fix stacklevel handling in logging. (GH-28287)
https://github.com/python/cpython/commit/5ca6d7469be53960843df39bb900e9c3359f127f


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue4833] Explicit directories for zipfiles

2022-03-27 Thread Sam Ezeh


Change by Sam Ezeh :


--
nosy: +sam_ezeh

___
Python tracker 

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



[issue46799] ShareableList memory bloat and performance improvement

2022-03-27 Thread Ting-Che Lin


Ting-Che Lin  added the comment:

A gentle Ping to the multiprocessing lib maintainers. Is there anything else I 
can do to move this forward?

--
resolution:  -> remind

___
Python tracker 

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



[issue36643] Forward reference is not resolved by dataclasses.fields()

2022-03-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree with Jelle here: dataclasses shouldn't be calling get_type_hints().

--
resolution:  -> wont fix
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



[issue46992] If use textwrap.dedent with string formatting, may get unintended sentences.

2022-03-27 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 

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



[issue47137] MemoryError

2022-03-27 Thread qiu


qiu <1425166...@qq.com> added the comment:

9

--

___
Python tracker 

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



[issue47137] MemoryError

2022-03-27 Thread Jacob Nilsson


Jacob Nilsson  added the comment:

Python 3.6 reach end of life in December 2021, is this error reproducible in 
Python 3.7 and above?

If that is still the case, do you have an example of an exact input causing 
this crash? "random input" is not a lot to go by.

--
nosy: +ajoino

___
Python tracker 

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



[issue47137] MemoryError

2022-03-27 Thread qiu

New submission from qiu <1425166...@qq.com>:

Traceback (most recent call last):
  File "python_AFL.py", line 110, in runFuzzer
runtime = runApplication(input_path, mode)
  File "python_AFL.py", line 75, in runApplication
exec(f.read(), {'buff': input_data})
  File "", line 16, in 
  File "", line 10, in fuzz
  File "/usr/lib/python3.6/codeop.py", line 122, in compile_command
return _maybe_compile(_compile, source, filename, symbol)
  File "/usr/lib/python3.6/codeop.py", line 82, in _maybe_compile
code = compiler(source, filename, symbol)
  File "/usr/lib/python3.6/codeop.py", line 102, in _compile
return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT)
MemoryError

when I use codeop.compile_command( random input ), I get the error .
I wonder if I found the error with the Python codeop's library??
thanks!

--
messages: 416120
nosy: Leilei
priority: normal
severity: normal
status: open
title: MemoryError
type: crash

___
Python tracker 

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



[issue47072] Database corruption with the shelve module

2022-03-27 Thread qiu


Change by qiu <1425166...@qq.com>:


--
components: +Demos and Tools -FreeBSD, Library (Lib)

___
Python tracker 

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



[issue47072] Database corruption with the shelve module

2022-03-27 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 27.03.2022 09:56, Hubert Tournier wrote:
> 
> The storage format used under Windows is completely different from the one 
> used under Unix (or *BSD).

The shelve module uses the dbm module underneath and this will pick
its storage mechanism based on what's available on the platform:

https://docs.python.org/3/library/dbm.html
https://github.com/python/cpython/blob/3.10/Lib/dbm/__init__.py

It's likely that you'll get the dbm.dumb interface on Windows.
On Linux, you typically have one of gdbm or the Berkley DB installed.

dbm.whichdb() will tell you which type of dbm implementation your
files are likely using.

More on the differences of DBM style libs:
http://www.ccl.net/cca/software/UNIX/apache/apacheRH7.0/local-copies/dbm.html

Aside: You are probably better off using SQLite with a pickle
layer to store arbitrary objects. This is much more mature than
the dbm modules.

--
nosy: +lemburg

___
Python tracker 

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



[issue47079] Integral.denominator shouldn't return an int

2022-03-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> not a bug
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



[issue47136] Wrong value assigned automatically to the variable __module__ in the class body.

2022-03-27 Thread Takuo Matsuoka


New submission from Takuo Matsuoka :

In the creation of a class, it looks as if the value of the variable
__name__ gets assigned automatically to the variable __module__ in the
class body.  However, the correct name space where the value of
__name__ should be looked up is NOT the mapping object returned by the
method __prepare__
of the metaclass.  In the class body, the programmer may use the
variable __name__ for some other purposes, and might not notice
__module__ was messed up.  Here's a code which produces a problem.

```
class C(type):
@classmethod
def __prepare__(cls, /, *args, **kwargs):
return dict(__name__ = "whatever")

class O(metaclass=C):
print(__module__) # "whatever" printed
```

Consequently,

>>> O.__module__
'whatever'

The issue is different from but seems related to

https://bugs.python.org/issue28869

I haven't figured out the exact relation.

Thanks.

--
components: Interpreter Core
messages: 416118
nosy: Takuo Matsuoka
priority: normal
severity: normal
status: open
title: Wrong value assigned automatically to the variable __module__ in the 
class body.
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



[issue47079] Integral.denominator shouldn't return an int

2022-03-27 Thread Sergey B Kirpichev


Sergey B Kirpichev  added the comment:

> It does not satisfy your assumptions in msg416056.

Yes, but does it fits to assumptions of the numbers module?  To be fair, there 
is even no requirement, that numerator/denominator are Integral instances 
(#25619 address also this).

BTW, it seems, the numpy integer types break my guess that numerator and 
denominator must have same types (I doubt that anyone uses numbers.Integral 
defaults, there are no tests for them in the CPython itself):
>>> a = numpy.int8(2); a
2
>>> type(a)

>>> type(a.numerator)

>>> type(a.denominator)

>>> type(a + a.denominator)

>>> type(a.denominator + a)

>>> type(a + a)


If this is an expected behaviour for Integral types - feel free to close the 
bugreport.  Looks odd for me, however.

--

___
Python tracker 

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



[issue14265] Fully qualified test name in failure output

2022-03-27 Thread Sam Ezeh


Sam Ezeh  added the comment:

The provided patch wasn't entirely compatible with the current upstream code. I 
used the patch file to apply the changes to `Lib/unittest/case.py`, resolved 
the remaining conflicts with the patches to the test files and amended existing 
tests for the library.

I updated the documentation for unittest to reflect the changes in behaviour.

--

___
Python tracker 

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



[issue47135] Allow decimal.localcontext to accept keyword arguments to set context attributes

2022-03-27 Thread Steven D'Aprano


New submission from Steven D'Aprano :

Whenever I use decimal and need to change the context temporarily, without fail 
I try to write

with decimal.localcontext(prec=10):
...

or similar. Then I get surprised that it fails, and re-write it as

with decimal.localcontext() as ctx:
ctx.prec = 10
...

Let's make the first version work. localcontext should accept keyword arguments 
corresponding to the same arguments accepted by Context, and set them on the 
context given.

A proof-of-concept wrapper function:

def localcontext(ctx=None, **kwargs):
if ctx is None:
ctx = decimal.getcontext().copy()
for key, value in kwargs.items():
setattr(ctx, key, value)
return decimal.localcontext(ctx)

I think this would be a valuable, and useful, improvement to the decimal API.

--
components: Library (Lib)
messages: 416114
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: Allow decimal.localcontext to accept keyword arguments to set context 
attributes
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



[issue14265] Fully qualified test name in failure output

2022-03-27 Thread Sam Ezeh


Change by Sam Ezeh :


--
keywords: +patch
pull_requests: +30218
pull_request: https://github.com/python/cpython/pull/32138

___
Python tracker 

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



[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-27 Thread John Paul Adrian Glaubitz


John Paul Adrian Glaubitz  added the comment:

Awesome, thanks! I'll give it a try later today or tomorrow.

--

___
Python tracker 

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



[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I fixed all suspicious places for which I found reproducers in PR 32137.

--

___
Python tracker 

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



[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue47124] explore hashlib use of the Apple CryptoKit macOS

2022-03-27 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

A "problem" with CryptoKit is that it is a swift-only framework, which makes 
using those APIs harder from C code (not impossible).

The older Security framework also contains crypto APIs, but seems to have less 
support for modern algorithms (e.g. no support for Curve25519). 

TBH I'm not sure if it is worthwhile to look into this in CPython, or that we 
should rely on OpenSSL for any integration (similar to Christian Heimes opinion 
on using the system keystore in the ssl module).

--

___
Python tracker 

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



[issue47072] Database corruption with the shelve module

2022-03-27 Thread Hubert Tournier


Hubert Tournier  added the comment:

The storage format used under Windows is completely different from the one used 
under Unix (or *BSD).

Apart from the .dat datafile, there is a .dir index file with CSV lines such as 
"'key', (offset, length)".

Whereas under Unix (or *BSD), I have:

# file whois_cache.db
whois_cache.db: Berkeley DB 1.85 (Hash, version 2, native byte-order)

I'll make a test on a Linux Raspberry Pi, to see if the issue is *BSD 
specific...

--

___
Python tracker 

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



[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-27 Thread John Paul Adrian Glaubitz


John Paul Adrian Glaubitz  added the comment:

Hi Serhiy!

> The simple fix is to add UnicodeEncodeError to "except LookupError". But 
> there may be other places where we can get a similar error. They should be 
> fixed too.

I would be very interested to test this as this issue currently blocks my use 
of offlineimap.

Would you mind creating a proof-of-concept patch for me if it's not too much 
work?

Thanks!

--

___
Python tracker 

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



[issue14265] Fully qualified test name in failure output

2022-03-27 Thread Sam Ezeh


Change by Sam Ezeh :


--
nosy: +dignissimus

___
Python tracker 

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



[issue47072] Database corruption with the shelve module

2022-03-27 Thread Hubert Tournier


Hubert Tournier  added the comment:

Additional note: the test code WORKS under Windows 8.1 / Python 3.9.1 (though 
the data file is suffixed .dat instead of .db) resulting in a 4 MB database 
with 1065 records, some of them > 11 KB.

So maybe the bug is system dependent.

--
components: +FreeBSD
nosy: +koobs
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



[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry, I was puzzled by the exception type and missed details in a long 
traceback (I have issues with reading large texts). Thank you for your detailed 
report.

The simple fix is to add UnicodeEncodeError to "except LookupError". But there 
may be other places where we can get a similar error. They should be fixed too.

Alternatively we can do something when we get an invalid charset from the 
parsed data. I am not the email package expert, so I do not know what would be 
better in that context.

--
components: +Library (Lib)
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue47079] Integral.denominator shouldn't return an int

2022-03-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It does not satisfy your assumptions in msg416056. So you have either correct 
your assumptions, or change the implementation of __add__, or change the 
implementation of denominator in your code.

--

___
Python tracker 

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



[issue47133] enhance unittest to show test name and docstring on one line

2022-03-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is already the third (at least) issue asking for such feature. Many people 
have problems with the current output. I would prefer to have a full qualified 
name of the test which I can copy by a double click and insert in a command 
that reruns specified tests. And full path to the test's source which I can 
copy to run in editor. pytest output looks more user-friendly to me.

But it may break other's test output parsers so we perhaps need an option for 
this. Options for unittest and libregrtest. I am not sure that it is a task for 
an average new contributor.

--

___
Python tracker 

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



[issue47128] Enhance Argument Clinic's NoneType return converter to give `void`

2022-03-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is simpler and faster to return NULL than call PyErr_Occurred(). There is a 
special macro PY_RETURN_NONE, so there is no problem with returning None either.

I do not think it would make the code better.

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

___
Python tracker 

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