[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread Mark Dickinson


Mark Dickinson  added the comment:

I'd also really like to avoid a system-dependent default. The danger is that 
code of the form

some_externally_supplied_integer.to_bytes(length=4)

can be written and thoroughly tested, only to fail unexpectedly some time later 
when that code happens to meet a big-endian machine. In most real-world cases 
with input length >= 1, it's unlikely that the system byteorder is the right 
thing, especially for from_bytes: what you need to know is what endianness the 
integer was encoded with, and that's not likely to be well correlated with the 
endianness that the machine you're running on right now happens to be using. 
(The choice of default obviously doesn't matter in cases where you're encoding 
and decoding on the same system, but there are going to be plenty of cases 
where that's not true.)

This is essentially the same issue that PEP 597 starts to address with 
`open(filename)` with no encoding specified. That system-specific default 
encoding has caused us real issues in production code.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue45160] ttk.OptionMenu radiobuttons change variable value twice

2021-09-10 Thread fhdrsdg


New submission from fhdrsdg :

Found when trying to answer this SO question: 
https://stackoverflow.com/questions/53171384/tkinter-function-repeats-itself-twice-when-ttk-widgets-are-engaged

The ttk.OptionMenu uses radiobuttons for the dropdown menu, whereas the 
tkinter.OptionMenu uses commands. Both of them use `_setit` as command, 
presumably first used for tkinter and then copied to the ttk implementation. 
The `_setit` does two things: changing the associated `variable` and calling 
the associated callback function. This is needed for the tkinter.OptionMenu 
since commands don't support changing a `variable`.

However, for the ttk.OptionMenu an additional reference to the variable was 
added to the radiobutton following this issue: 
https://bugs.python.org/issue25684. This was needed to group radiobuttons, but 
now leads to the variable being changed twice: once by the radiobutton and once 
through `_setit`. When tracing the variable this leads to the tracing callback 
being called twice on only one change of the OptionMenu.

The solution is to not use `_setit` for the radiobutton command but instead 
just use `command=self._callback`

--
components: Tkinter
messages: 401557
nosy: fhdrsdg
priority: normal
severity: normal
status: open
title: ttk.OptionMenu radiobuttons change variable value twice
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2021-09-10 Thread Inada Naoki


Inada Naoki  added the comment:

I think pydantic approach is the best practice.
See https://pydantic-docs.helpmanual.io/usage/postponed_annotations/

--
nosy: +methane

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

>From my experience, the largest cost in importing module (after I/O) is for 
>creating classes, especially classes with complex creation code: enums and 
>dataclasses (and namedtuples in past, but they were significanly optimized 
>since).

For I/O, would using zipimport or any other container help? It should reduce 
the number of stats and opens and allow to use compression.

As for increasing performance of demarshallization, it is already very fast 
(all is read from memory buffers, all repeated objects are cached). Switching 
to "wordcode" (32- or 64- bit instructions) and aligning all objects at the 
boundary of 4-8 bytes can marginally increase decoding speed, but it needs 
testing. Also more optimal using of references (like pickletools.optimize()) 
can reduce unmarshalling time at the cost of increasing marshalling time and 
memory consumption. It can also help with deterministic marshalling.

--

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread Petr Viktorin


Petr Viktorin  added the comment:

Exactly, a platform-dependent default is a bad idea. A default allows using the 
function without the code author & reviewer even being *aware* that there is a 
choice, and that is dangerous.

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__

2021-09-10 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Updated title to include sqlite3.Cursor as well, since cursors and connections 
are very much entwined.

--
title: [sqlite3] cleanup and harden connection init -> [sqlite3] cleanup and 
harden Connection and Cursor __init__

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

> (b) the allocation and initialization of a large number of objects

Yes, when I profiled import GC showed up as 20-30%.

--

___
Python tracker 

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



[issue44452] Allow paths to be joined without worrying about a leading slash

2021-09-10 Thread Sylvain Marie


Sylvain Marie  added the comment:

+1 on this, I am totally in line with the original post.

The / operator semantics should not imply any notion of drive or of "cd" 
command on a shell. It should simply stick to "concatenate", i.e. "create child 
path" (and actually this is what the doc states 
https://docs.python.org/3/library/pathlib.html#operators ) 

Thanks Zbyszek for putting this on the table !

--
nosy: +smarie

___
Python tracker 

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



[issue45161] _Py_DecodeUTF8_surrogateescape not exported from 3.10 framework build

2021-09-10 Thread Ronald Oussoren


New submission from Ronald Oussoren :

The symbol _Py_DecodeUTF8_surrogateescape is not exported from Python.framework 
on macOS in Python 3.10.  The symbol was exported in earlier versions of 3.x.

I'm not sure if this was intentional, so far I haven't been able to find when 
this was changed.

This change breaks py2app which uses _Py_DecodeUTF8_surrogateescape to convert 
the C argv array to an array of 'wchar_t*' for use with Python's C API.

--
components: C API, macOS
messages: 401564
nosy: ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: _Py_DecodeUTF8_surrogateescape not exported from 3.10 framework build
versions: Python 3.10

___
Python tracker 

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



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

2021-09-10 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Serhiy, I believe I've addressed your review remarks on PR 27642. Would you 
mind taking a look at it again if you have time?

--

___
Python tracker 

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



[issue45161] _Py_DecodeUTF8_surrogateescape not exported from 3.10 framework build

2021-09-10 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I've switched py2app to Py_DecodeLocale, which is a public API introduced in 
3.5 to accomplish the same task. 

I'm leaving the issue open in case hiding the symbol is unintentional.

--

___
Python tracker 

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



[issue45160] ttk.OptionMenu radiobuttons change variable value twice

2021-09-10 Thread E. Paine


E. Paine  added the comment:

Thank you for reporting this issue (and doing your research!). I don't think we 
could use `command=self._callback` since this wouldn't pass the new value, but 
something like `command=lambda val=val: self._callback(val)` would work 
perfectly. Would you like to open a pull request for this (with accompanying 
news entry and test), or would you rather I did it?

--
nosy: +epaine, serhiy.storchaka

___
Python tracker 

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



[issue45162] Remove old deprecated unittest features

2021-09-10 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR removes the following unittest features:

* "fail*" and "assert*" aliases of TestCase methods.
* Broken from start TestCase method assertDictContainsSubset().
* Ignored TestLoader.loadTestsFromModule() parameter use_load_tests.
* Old alias _TextTestResult of TextTestResult.

Most features were deprecated in 3.2, "fail*" methods in 3.1, 
assertNotRegexpMatches in 3.5. They were kept mostly for compatibility with 2.7 
(although some of them were new in Python 3 and not compatible with 2.7).

Using deprecated assertEquals instead of assertEqual is a common error which we 
need to fix regularly, so removing deprecated features will not only make the 
current code clearer, but save as from future errors.

--
components: Library (Lib)
messages: 401568
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Remove old deprecated unittest features
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



[issue45162] Remove old deprecated unittest features

2021-09-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +ezio.melotti, michael.foord, rbcollins

___
Python tracker 

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



[issue45162] Remove old deprecated unittest features

2021-09-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue16591] RUNSHARED wrong for OSX no framework

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> many distutils tests fail when run from the installed location

___
Python tracker 

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



[issue21658] __m128, can't build 3.4.1 with intel 14.0.0

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
superseder:  -> Intel icc 9.1 does not support __int128_t used by ctypes

___
Python tracker 

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



[issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe()

2021-09-10 Thread STINNER Victor


STINNER Victor  added the comment:

FYI the test is still failing with the same error on the billenstein-macos 
builder worker, x86-64 macOS 3.10:
https://buildbot.python.org/all/#/builders/681/builds/370

"OSError: [Errno 24] Too many open files"

--

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread STINNER Victor


STINNER Victor  added the comment:

I dislike the idea of adding a default length to int.to_bytes(). The length 
changes the meaning of the output:

>>> (1).to_bytes(2, 'big')
b'\x00\x01'
>>> (1).to_bytes(1, 'big')
b'\x01'

If the intent is to "magically cast an integer to a byte strings", having a 
fixed length of 1 doesn't help:

>>> (1000).to_bytes(1, "big")
OverflowError: int too big to convert

If the intent is to create a bytes string of length 1, I'm not sure that 
"re-using" this existing API for that is a good idea.

--
nosy: +vstinner

___
Python tracker 

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



[issue45163] Haiku build fix

2021-09-10 Thread David CARLIER


Change by David CARLIER :


--
components: Library (Lib)
nosy: devnexen
priority: normal
pull_requests: 26689
severity: normal
status: open
title: Haiku build fix
type: compile error
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



[issue45164] int.to_bytes()

2021-09-10 Thread daniel capelle


New submission from daniel capelle :

for example check:
(6500).to_bytes(2, 'big')
result is:
b'\x19d'
but was expected to be:
b'\x1964'
since 
ord('d') is 100 = 0x64 there seems to be hex and char representation mixed up.

--
messages: 401571
nosy: hypnoticum
priority: normal
severity: normal
status: open
title: int.to_bytes()
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



[issue45164] int.to_bytes()

2021-09-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

b'\x1964' is a 3-bytes bytes object.

>>> b = b'\x1964'
>>> len(b)
3
>>> b[0], b[1], b[2]
(25, 54, 52)

What you what to get is b'\x19\x64'. And it is a different writing of b'\x19d', 
because b'\x64' is the same as b'd'.

>>> b'\x19\x64'
b'\x19d'

--
nosy: +serhiy.storchaka
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



[issue45164] int.to_bytes()

2021-09-10 Thread daniel capelle


daniel capelle  added the comment:

for example check:
(6500).to_bytes(2, 'big')
result is:
b'\x19d'
but was expected to be:
b'\x19\x64'
since 
ord('d') is 100 = 0x64 there seems to be hex and char representation mixed up.

--

___
Python tracker 

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



[issue45164] int.to_bytes()

2021-09-10 Thread daniel capelle


daniel capelle  added the comment:

An ASCII representation is shown instead of the hexadecimal value, if there is 
any. 
I was not aware this is an intended behaviour.

--

___
Python tracker 

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



[issue45132] Remove deprecated __getitem__ methods

2021-09-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +26690
pull_request: https://github.com/python/cpython/pull/28270

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2021-09-10 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 707137b8637feef37b2e06a851fdca9d1b945861 by Henry-Joseph Audéoud 
in branch 'main':
bpo-40563: Support pathlike objects on dbm/shelve (GH-21849)
https://github.com/python/cpython/commit/707137b8637feef37b2e06a851fdca9d1b945861


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40563] Support pathlike objects on dbm/shelve

2021-09-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution, Hakan, Henry-Joseph.

Sorry, David, there was already a PR, and it was not dead, it just waited for a 
coredev review.

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



[issue45132] Remove deprecated __getitem__ methods

2021-09-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 17a1b3e63a5db4e581c0ef52751df2314f7249fa by Serhiy Storchaka in 
branch 'main':
bpo-45132: Fix the reStructuredText markup error. (GH-28270)
https://github.com/python/cpython/commit/17a1b3e63a5db4e581c0ef52751df2314f7249fa


--

___
Python tracker 

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



[issue21658] __m128, can't build 3.4.1 with intel 14.0.0

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


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



[issue23575] MIPS64 needs ffi's n32.S

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

The code has changed since this issue was created - I can't find the file that 
the patch modifies nor the code it contains (I searched for ffi_platforms and 
MIPS_LINUX). 

Please create a new issue if you are seeing issues like this on a current 
python version (>= 3.9).

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



[issue27491] Errors when building with UNICODE character set

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

I compared the patch with the current codebase and most of it is out of date.

Minmin, are you still seeing these problems on a current version (>= 3.9)?  If 
so, please report:

1. Exactly what you did, and which system/compiler you are using
2. What the output was
3. If you can, the patch to fix the issue

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue25625] "chdir" Contex manager for pathlib

2021-09-10 Thread Filipe Laíns

Change by Filipe Laíns :


--
pull_requests: +26691
pull_request: https://github.com/python/cpython/pull/28271

___
Python tracker 

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



[issue27509] Some tests breaks PGO build on Windows

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

Python 3.5 is no longer in maintenance. Please create a new issue if you are 
still seeing this problem on a current version (>= 3.9).

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue877121] configure detects incorrect compiler optimization

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue33347] zlibmodule undefined reference

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

The report only shows output for 2.7. Is this issue really relevant to 3.x?

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue42119] Error when debugging logging.FileHandler subclass __init__ method

2021-09-10 Thread Andrei Kulakov


Change by Andrei Kulakov :


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



[issue45165] alighment format for nullable values

2021-09-10 Thread Anthony Sottile


New submission from Anthony Sottile :

currently this works correctly:

```
>>> '%8s %8s' % (None, 1)
'None1'
```

but conversion to f-string fails:

```
>>> f'{None:>8} {1:>8}'
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported format string passed to NoneType.__format__
```

my proposal is to implement alignment `__format__` for `None` following the 
same as for `str` for alignment specifiers

--
components: Interpreter Core
messages: 401582
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: alighment format for nullable values
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue45165] alighment format for nullable values

2021-09-10 Thread Eric V. Smith


Eric V. Smith  added the comment:

Why would you only want alignment, and not all string formatting options?

And if that's the case, just convert it to a string: 

>>> f'{None!s:>8} {1:>8}'
'None1'

--
nosy: +eric.smith

___
Python tracker 

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



[issue45165] alighment format for nullable values

2021-09-10 Thread Eric V. Smith


Change by Eric V. Smith :


--
type: behavior -> enhancement
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



[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 296b7100705ef52aece3378b0ae42c33a58526e1 by Łukasz Langa in 
branch 'main':
bpo-44219: Mention GH-28250 is a deadlock bugfix (GH-28261)
https://github.com/python/cpython/commit/296b7100705ef52aece3378b0ae42c33a58526e1


--

___
Python tracker 

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



[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-09-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26693
pull_request: https://github.com/python/cpython/pull/28275

___
Python tracker 

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



[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-09-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26692
pull_request: https://github.com/python/cpython/pull/28274

___
Python tracker 

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



[issue44964] Semantics of PyCode_Addr2Line() changed

2021-09-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26694
pull_request: https://github.com/python/cpython/pull/28276

___
Python tracker 

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



[issue44964] Semantics of PyCode_Addr2Line() changed

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset ab327f2929589407595a3de95727c8ab34ddd4af by Pablo Galindo Salgado 
in branch 'main':
bpo-44964: Correct the note about the f_lasti field (GH-28208)
https://github.com/python/cpython/commit/ab327f2929589407595a3de95727c8ab34ddd4af


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue25894] unittest subTest failure causes result to be omitted from listing

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f0f29f328d8b4568e8c0d4c55c7d120d96f80911 by Serhiy Storchaka in 
branch 'main':
bpo-25894: Always report skipped and failed subtests separately (GH-28082)
https://github.com/python/cpython/commit/f0f29f328d8b4568e8c0d4c55c7d120d96f80911


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue25894] unittest subTest failure causes result to be omitted from listing

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:

> Any suggestions for the format of output? Currently PR 28082 formats lines 
> for subtest skipping, failure or error with a 2-space identation. Lines for 
> skipping, failure or error in tearDown() or functions registered with 
> addCallback() do not differ from a line skipping, failure or error in the 
> test method itself.

I'm fine with that. Ultimately I don't think differentiating subtest status 
from method status is that important.

> I am not sure about backporting this change.

Since we're too late for 3.10.0 and it isn't a trivially small change that 
changes test output, I think we shouldn't be backporting it. There are tools 
that parse this output in editors. I'm afraid that it's too risky since we 
haven't given the community enough time to test for output difference.

I'm marking this as resolved. Thanks for your patch, Serhiy! If you feel 
strongly about backporting, we'd have to reopen and mark this as release 
blocker.

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



[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 60ddf499e14cc7daba3804e5a3460e4224dacc5c by Miss Islington (bot) 
in branch '3.10':
bpo-44219: Mention GH-28250 is a deadlock bugfix (GH-28261) (GH-28274)
https://github.com/python/cpython/commit/60ddf499e14cc7daba3804e5a3460e4224dacc5c


--

___
Python tracker 

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



[issue44964] Semantics of PyCode_Addr2Line() changed

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset b045174a6dbf1060f092265853f0c78f0704a21a by Miss Islington (bot) 
in branch '3.10':
bpo-44964: Correct the note about the f_lasti field (GH-28208) (GH-28276)
https://github.com/python/cpython/commit/b045174a6dbf1060f092265853f0c78f0704a21a


--

___
Python tracker 

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



[issue45166] get_type_hints + Final + future annotations = TypeError

2021-09-10 Thread Timothee Mazzucotelli


New submission from Timothee Mazzucotelli :

This is my first issue on bugs.python.org, let me know if I can improve it in 
any way.

---

Originally reported and investigated here: 
https://github.com/mkdocstrings/mkdocstrings/issues/314

```
# final.py
from __future__ import annotations

from typing import Final, get_type_hints

name: Final[str] = "final"

class Class:
value: Final = 3000

get_type_hints(Class)
```

Run `python final.py`, and you'll get this traceback:

```
Traceback (most recent call last):
  File "final.py", line 11, in 
get_type_hints(Class)
  File "/.../lib/python3.8/typing.py", line 1232, in get_type_hints
value = _eval_type(value, base_globals, localns)
  File "/.../lib/python3.8/typing.py", line 270, in _eval_type
return t._evaluate(globalns, localns)
  File "/.../lib/python3.8/typing.py", line 517, in _evaluate
self.__forward_value__ = _type_check(
  File "/.../lib/python3.8/typing.py", line 145, in _type_check
raise TypeError(f"Plain {arg} is not valid as type argument")
TypeError: Plain typing.Final is not valid as type argument
```

Now comment the `get_type_hints` call, launch a Python interpreter, and enter 
these commands:

>>> import final
>>> from typing import get_type_hints
>>> get_type_hints(final)

And you'll get this traceback:

```
Traceback (most recent call last):
  File "", line 1, in 
  File "/.../lib/python3.9/typing.py", line 1449, in get_type_hints
value = _eval_type(value, globalns, localns)
  File "/.../lib/python3.9/typing.py", line 283, in _eval_type
return t._evaluate(globalns, localns, recursive_guard)
  File "/.../lib/python3.9/typing.py", line 538, in _evaluate
type_ =_type_check(
  File "/.../lib/python3.9/typing.py", line 149, in _type_check
raise TypeError(f"{arg} is not valid as type argument")
TypeError: typing.Final[str] is not valid as type argument
```

I was able to replicate in 3.8, 3.9 and 3.10. The annotations future is not 
available in 3.7 or lower. Didn't try on 3.11.

--
messages: 401590
nosy: pawamoy
priority: normal
severity: normal
status: open
title: get_type_hints + Final + future annotations = TypeError
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue44219] Opening a file holds the GIL when it calls "isatty()"

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 314de5326f8b687a3fa7b19ea8faaa449f59b8fe by Miss Islington (bot) 
in branch '3.9':
bpo-44219: Mention GH-28250 is a deadlock bugfix (GH-28261) (GH-28275)
https://github.com/python/cpython/commit/314de5326f8b687a3fa7b19ea8faaa449f59b8fe


--

___
Python tracker 

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



[issue45166] get_type_hints + Final + future annotations = TypeError

2021-09-10 Thread Timothee Mazzucotelli


Timothee Mazzucotelli  added the comment:

Just tried on 3.11-dev, it's affected as well.

This issue seems related to https://bugs.python.org/issue41249.

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26696
pull_request: https://github.com/python/cpython/pull/28278

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e86bcfa58080f152f242c756f625f4015671f168 by Irit Katriel in 
branch 'main':
bpo-9811: [doc] strftime handling of unsupported format specifiers is platform 
dependent (GH-28264)
https://github.com/python/cpython/commit/e86bcfa58080f152f242c756f625f4015671f168


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-10 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 10.0 -> 11.0
pull_requests: +26695
pull_request: https://github.com/python/cpython/pull/28277

___
Python tracker 

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



[issue45166] get_type_hints + Final + future annotations = TypeError

2021-09-10 Thread Timothee Mazzucotelli


Timothee Mazzucotelli  added the comment:

Oh, I see now that there is a python/typing/ repository on GitHub. Let me know 
if I should open there instead.

--

___
Python tracker 

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



[issue45144] Use subtests in test_peepholer

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f8d624d6a571d6e773f53ad80aa93face7e8395b by Irit Katriel in 
branch 'main':
bpo-45144: use subTests in test_peepholer (GH-28247)
https://github.com/python/cpython/commit/f8d624d6a571d6e773f53ad80aa93face7e8395b


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45144] Use subtests in test_peepholer

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:

We can refactor the tests to your new functionality once it's ready, Serhiy. In 
the mean time, this is fixed!

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Just to point out, struct module also uses “native” (i.e. system) byte order by 
default.  Any choice other than that for to_bytes() seems both arbitrary and 
inconsistent.

> On Sep 10, 2021, at 00:48, Petr Viktorin  wrote:
> 
> Exactly, a platform-dependent default is a bad idea. A default allows using 
> the function without the code author & reviewer even being *aware* that there 
> is a choice, and that is dangerous.

--

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

On Sep 10, 2021, at 04:06, STINNER Victor  wrote:
> 
> If the intent is to create a bytes string of length 1, I'm not sure that 
> "re-using" this existing API for that is a good idea.

Why not?  It seems an obvious and simple convenience.

--

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Petr Viktorin  added the comment:
> 
> Exactly, a platform-dependent default is a bad idea. A default allows using 
> the function without the code author & reviewer even being *aware* that there 
> is a choice, and that is dangerous.

I’m not convinced.  I’m more concerned with the obscurity of the API.  If I saw 
its use in some code I was reviewing, I’d look it up, and then I’d know exactly 
what it was doing.

--

___
Python tracker 

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



[issue45165] alighment format for nullable values

2021-09-10 Thread Anthony Sottile


Anthony Sottile  added the comment:

alignment was the only one I found which was applicable and didn't work

`!s` "works" but it's kind of a hack (of course I want string formatting, I'm 
making a string!) -- then I would want to write `!s` everywhere which is 
cumbersome and ugly

--

___
Python tracker 

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



[issue45167] deepcopy of GenericAlias with __deepcopy__ method is broken

2021-09-10 Thread Jacob Hayes


New submission from Jacob Hayes :

When deepcopying a parametrized types.GenericAlias (eg: a dict subclass) that 
has a __deepcopy__ method, the copy module doesn't detect the GenericAlias as a 
type and instead tries to call cls.__deepcopy__, passing `memo` inplace of 
self. This doesn't seem to happen with `typing.Generic` however.

Example:
```
from copy import deepcopy


class X(dict):
def __deepcopy__(self, memo):
return self


print(deepcopy(X()))
print(deepcopy(X))

print(type(X[str, int]))
print(deepcopy(X[str, int]()))
print(deepcopy(X[str, int]))
```
shows
```
{}


{}
Traceback (most recent call last):
  File "/tmp/demo.py", line 14, in 
print(deepcopy(X[str, int]))
  File "/Users/jacobhayes/.pyenv/versions/3.9.6/lib/python3.9/copy.py", line 
153, in deepcopy
y = copier(memo)
TypeError: __deepcopy__() missing 1 required positional argument: 'memo'
```

I don't know if it's better to update `copy.deepcopy` here or perhaps narrow 
the `__getattr__` for `types.GenericAlias` (as `typing. _BaseGenericAlias` 
seems to).

--
components: Library (Lib)
messages: 401601
nosy: JacobHayes
priority: normal
severity: normal
status: open
title: deepcopy of GenericAlias with __deepcopy__ method is broken
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



[issue17913] stat.filemode returns "-" for sockets and unknown types

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

I think this is fixed now

>>> s = os.stat('/var/run/vpncontrol.sock')
>>> stat.filemode(s.st_mode)
'srw---'


iritkatriel@Irits-MBP cpython % ls -l /var/run/vpncontrol.sock 
srw---  1 root  daemon  0 19 Aug 11:15 /var/run/vpncontrol.sock

--
nosy: +iritkatriel

___
Python tracker 

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



[issue18712] Pure Python operator.index doesn't match the C version.

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11.

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4

___
Python tracker 

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



[issue18715] Tests fail when run with coverage

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

This is about 8 years old, so closing. Let's open new issues for current 
failures when we see them.

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

The patch needs to be converted to a GitHub PR.

Reproduced on 3.11: 

>>> import _csv
>>> import csv
>>> _csv.Dialect(quotechar=b'+')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: "quotechar" must be string, not bytes
>>> _csv.Dialect(quotechar=None)
<_csv.Dialect object at 0x105acfe40>
>>> _csv.Dialect(quotechar="cutecat")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: "quotechar" must be a 1-character string
>>> _csv.Dialect(quotechar="", quoting=csv.QUOTE_NONE)
<_csv.Dialect object at 0x105948c80>

--
keywords: +easy -patch
nosy: +iritkatriel
title: Confusing error message when giving invalid quotechar in initializing 
csv dialect -> csv: Confusing error message when giving invalid quotechar in 
initializing dialect
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 
3.4

___
Python tracker 

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



[issue20524] format error messages should provide context information

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11:

>>> dd = {'length': 12, 'id': 4, 'title': "t", 'run_time': datetime.time()}
>>> '{run_time:%H:%M:%S}, 
>>> ,COM,DA{id},"{title:.43}",{id},{length:%M:%S}'.format(**dd)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Invalid format specifier

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



[issue19463] assertGdbRepr depends on hash randomization / endianess

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue22886] TestProgram leaves defaultTestLoader.errors dirty

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23041] csv needs more quoting rules

2021-09-10 Thread Miha Šetina

Miha Šetina  added the comment:

The MS Synapse has a CSV support in its COPY command that would benefit from 
the proposed csv.QUOTE_NOTNULL as it can be used when preparing data for 
import. As they reference the same RFC the CSV modul should support, both the 
proposed modifications would extend the RFC functionality with support for 
NULL/None values in the data.
The csv.QUOTE_STRINGS would enable a smaller file size.
Our case is that we are moving data into Synapse and have to resort to risk 
prone string replace functionality to provide the MS Synapse COPY a proper 
support for empty string and NULL

--
nosy: +msetina
versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue22843] doc error: 6.2.4. Match Objects

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


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



[issue23041] csv needs more quoting rules

2021-09-10 Thread Skip Montanaro


Skip Montanaro  added the comment:

Update version - too late for anything older than 3.11.

--
versions:  -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue45166] get_type_hints + Final + future annotations = TypeError

2021-09-10 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
keywords: +patch
nosy: +sobolevn
nosy_count: 1.0 -> 2.0
pull_requests: +26697
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28279

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

We're not (yet) trying to optimize the code being executed (we should perhaps 
add an issue about class creation to https://github.com/faster-cpython/ideas).

I agree that marshal is very fast already; I doubt the extra cost of wordcode 
would pay off since it would increase the size. This could be tested but it 
would be a big experiment.

I'm not sure that compression will really help, since a typical decompressor 
delivers its output in some memory buffer. But this needs to be tested, and it 
might be a simpler experiment.

I'm pretty sure zipimport will improve things -- the main problem with it (as 
always) is that not all tooling understands it, since resource loading is 
different.

--

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 897e5aae748180acf8d546d14aeacaf02600fff9 by Miss Islington (bot) 
in branch '3.10':
bpo-9811: [doc] strftime handling of unsupported format specifiers is platform 
dependent (GH-28264) (GH-28277)
https://github.com/python/cpython/commit/897e5aae748180acf8d546d14aeacaf02600fff9


--

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset baeaaecb8a97033bc2d07d51442cc8b1f89d410d by Miss Islington (bot) 
in branch '3.9':
bpo-9811: [doc] strftime handling of unsupported format specifiers is platform 
dependent (GH-28264) (GH-28278)
https://github.com/python/cpython/commit/baeaaecb8a97033bc2d07d51442cc8b1f89d410d


--

___
Python tracker 

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



[issue45101] Small inconsistency in usage message between the python and shell script versions of python-config

2021-09-10 Thread Éric Araujo

Éric Araujo  added the comment:

I think python-config is modelled after pkg-config: what does the latter do?

Also, I’m not sure it would be appropriate to change behaviour in existing 
releases.

--
nosy: +eric.araujo
versions:  -Python 3.10, Python 3.9

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-10 Thread Łukasz Langa

Change by Łukasz Langa :


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

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-10 Thread Łukasz Langa

Łukasz Langa  added the comment:

Is there anything else you wanted to do here, Irit?

--

___
Python tracker 

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



[issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2021-09-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This failure in required Ubuntu test is blocking me from merging a totally 
unrelated change in IDLE.  PR-28228.  Please disable the phony failing test.

--
nosy: +lukasz.langa, terry.reedy

___
Python tracker 

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



[issue34602] python3 resource.setrlimit strange behaviour under macOS

2021-09-10 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +26698
pull_request: https://github.com/python/cpython/pull/28280

___
Python tracker 

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



[issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2021-09-10 Thread Giovanni Wijaya


Change by Giovanni Wijaya :


--
nosy: +giovanniwijaya
nosy_count: 7.0 -> 8.0
pull_requests: +26699
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28228

___
Python tracker 

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



[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-10 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue9811] strftime strips '%' from unknown format codes on OS X

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

No, I think we're good. Thanks.

--

___
Python tracker 

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



[issue22147] PosixPath() constructor should not accept strings with embedded NUL bytes

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

If we do this then there are tests tha break, for instance test_is_symlink has 
this:

self.assertIs((P / 'fileA\x00').is_file(), False)

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



[issue45105] Incorrect handling of unicode character \U00010900

2021-09-10 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45109] pipes seems designed for bytes but is str-only

2021-09-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

guido, you seem to be the only active contributor to the pipes module.  What do 
you think?

--
nosy: +gvanrossum, terry.reedy

___
Python tracker 

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



[issue18376] show the effective count of process when running the testsuite

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy -patch
versions: +Python 3.11 -Python 3.4

___
Python tracker 

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



[issue23774] Test failures when unable to write to install location

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> allow the testsuite to run in the installed location

___
Python tracker 

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



[issue17763] test_pydoc fails with the installed testsuite

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

Should we close this as third party or is there something we can do about it?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue45109] pipes seems designed for bytes but is str-only

2021-09-10 Thread Guido van Rossum

Guido van Rossum  added the comment:

I think that module is probably a relic from the Python 1 days…

--

___
Python tracker 

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



[issue45168] dis output for co_consts is confusing

2021-09-10 Thread Irit Katriel


New submission from Irit Katriel :

When dis doesn't have co_consts, it just prints the index of the const in () 
instead. This is both unnecessary and confusing because (1) we already have the 
index and (2) there is no indication that this is the index and not the value. 

Can we change the output so that it doesn't print the value if it's missing?

--
messages: 401620
nosy: gvanrossum, iritkatriel
priority: normal
severity: normal
status: open
title: dis output for co_consts is confusing

___
Python tracker 

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



[issue45168] dis output for co_consts is confusing

2021-09-10 Thread Irit Katriel


Irit Katriel  added the comment:

See example here:
https://github.com/iritkatriel/cpython/pull/30/files#r706517665

--
components: +Library (Lib)
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



[issue45168] dis output for LOAD_CONST is confusing

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


--
title: dis output for co_consts is confusing -> dis output for LOAD_CONST  is 
confusing

___
Python tracker 

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



[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

[Mark Dickinson]
> I'd also really like to avoid a system-dependent default.

[Petr Viktorin]
> Exactly, a platform-dependent default is a bad idea.

I concur with Petr and Mark. 

The principal use case for int.to_bytes is to convert an integer of arbitrary 
size to a binary format for storage or transmission.  The corresponding file 
load or received data needs to symmetrically restore the int.  The default 
(whether little or big) needs to be the same on both sides to prevent bugs.  
Otherwise, for portable code, we would have to recommend that people not use 
the default because the output isn't deterministic across systems.

By way of comparison, we've had long standing issues like this in other parts 
of the language.  For example, this gives inconsistent encodings across systems:

with open(filename) as f:
f.write(text)

Not long ago, Inada had to sweep through and add encoding="utf-8" to fix all 
the bugs caused by the default platform dependent encoding.   Arguably, most 
code that has ever been written without an explicit encoding is wrong if the 
files were intended to be shared outside the local file system.

So if Veky wants the default to be "big", that's fine by me.  The important 
thing is that a *consistent* default be used (not platform dependent).  I won't 
argue for a "sensible default" because apparently Veky has different 
sensibilities.

--

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows

2021-09-10 Thread neonene


neonene  added the comment:

Thanks for all suggestions. I focused on my bisected commit and the previous.

I run pyperformance with 4 functions never inlined in the sections below.

   _Py_DECREF()
   _Py_XDECREF()
   _Py_IS_TYPE()
   _Py_atomic_load_32bit_impl()

are

   (1) never inlined in _PyEval_EvalFrameDefault().
   (2) never inlined in the other funcitons.
   (3) never inlined in all functions.


slow downs [4-funcs never inlined section]
--
Windows x64 PGO (44job)(*)(1)(2)(3)
rebuildnone   eval  others  all
--
b98eba5 (4 funcs inlined in eval)  1.00   1.05   1.09   1.14
PR25244 (not inlined in eval)  1.06   1.07   1.18   1.17

pyperf compare_to upper lower:
   (*) 1.06x slower  (slower 45, faster  4, not not significant  9)
   (1) 1.02x slower  (slower 33, faster 13, not not significant 12)
   (2) 1.08x slower  (slower 48, faster  6, not not significant  4)
   (3) 1.03x slower  (slower 39, faster  6, not not significant 13)


--
Windows x86 PGO (44job)(*)(1)(2)(3)
rebuildnone   eval  others  all
--
b98eba5 (4 funcs inlined in eval)  1.00   1.03   1.06   1.15
PR25244 (not inlined in eval)  1.13   1.13   1.22   1.24

pyperf compare_to upper lower:
   (*) 1.13x slower  (slower 54, faster  2, not not significant  2)
   (1) 1.10x slower  (slower 47, faster  3, not not significant  8)
   (2) 1.14x slower  (slower 54, faster  1, not not significant  3)
   (3) 1.08x slower  (slower 43, faster  3, not not significant 12)


In both x64 and x86, it looks column (2) and (*) has similar gaps.
So, I would like to simply focus on the eval-loop.

I built PGO with "/d2inlinestats" and 
"/d2inlinelogfull:_PyEval_EvalFrameDefault" according to the blog.

I posted logs. As for PR25244, the logsize is 3x smaller than the previous and 
pgo rejects the 4 funcs above. I will look into it later.


Collecting:
> Before the PR, it took 10x~ longer to link than without __forceinline 
> function.

Current build is 10x~ shorter than before to link.
Before the PR, __forceinline had no impact to me.

--
Added file: https://bugs.python.org/file50271/b98e-no-inline-in-all.diff

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows

2021-09-10 Thread neonene


Change by neonene :


Added file: https://bugs.python.org/file50272/b98e-no-inline-in-eval.diff

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows

2021-09-10 Thread neonene


Change by neonene :


Added file: https://bugs.python.org/file50273/b98e-no-inline-in-the-others.diff

___
Python tracker 

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



[issue45116] Performance regression 3.10b1 and later on Windows

2021-09-10 Thread neonene


Change by neonene :


Added file: https://bugs.python.org/file50274/pyproject_inlinestat.patch

___
Python tracker 

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



  1   2   >