[issue42331] 'base64' has no attribute 'decodestring'

2020-11-11 Thread michalis aggela


New submission from michalis aggela :

File 
"/Users/michaelmouchametai/Downloads/google-cloud-sdk/platform/gsutil/gslib/utils/encryption_helper.py",
 line 152, in Base64Sha256FromBase64EncryptionKey
decoded_bytes = base64.decodestring(csek_encryption_key)
AttributeError: module 'base64' has no attribute 'decodestring'

--
components: Build
messages: 380805
nosy: michalisaggela
priority: normal
severity: normal
status: open
title: 'base64' has no attribute 'decodestring'
type: crash
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



[issue42329] typing classes do not have __name__ attributes in 3.7+

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Between 3.6 and 3.7 they stopped being types.

IIRC this enabled optimizations. (Serhiy?)

I don't think this is important, but I suppose you have some code that this 
breaks?

The name is passed to the constructor of _SpecialGenericAlias, so I'm fine with 
fixing this, though the backports may get tricky when you get down to 3.7.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-11 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

FWIW here's a minimal demo:

from __future__ import annotations
from typing import get_type_hints

class C:
def func(self, a: "C"):
pass

print(get_type_hints(func))

In 3.8 this prints

{'a': ForwardRef('C')}

while in 3.9 it raises NameError:

Traceback (most recent call last):
  File "C:\Users\gvanrossum\cpython\t.py", line 4, in 
class C:
  File "C:\Users\gvanrossum\cpython\t.py", line 8, in C
print(get_type_hints(func))
  File "C:\Python39\lib\typing.py", line 1386, in get_type_hints
value = _eval_type(value, globalns, localns)
  File "C:\Python39\lib\typing.py", line 254, in _eval_type
return t._evaluate(globalns, localns, recursive_guard)
  File "C:\Python39\lib\typing.py", line 497, in _evaluate
self.__forward_value__ = _eval_type(
  File "C:\Python39\lib\typing.py", line 254, in _eval_type
return t._evaluate(globalns, localns, recursive_guard)
  File "C:\Python39\lib\typing.py", line 493, in _evaluate
eval(self.__forward_code__, globalns, localns),
  File "", line 1, in 
NameError: name 'C' is not defined

--

___
Python tracker 

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



[issue42330] Add browsh in the webbrowser module

2020-11-11 Thread Saiansh Singh

New submission from Saiansh Singh :

The webbrowser module is a module used to create a new tab or window inside 
browsers. It is currently built into python. It supports multiple 
terminal-based browsers but yet doesn't support browsh. Here is the 
documentation for browsh for more information: brow.sh. The repository is at: 
github.com/browsh-org/browsh. It runs firefox on headless and displays the 
websites inside the terminal.

Happy to make a PR! 😃

--
components: Library (Lib)
messages: 380802
nosy: saiansh2525
priority: normal
severity: normal
status: open
title: Add browsh in the webbrowser module
type: 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



[issue42329] typing classes do not have __name__ attributes in 3.7+

2020-11-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue42319] The `functools.singledispatchmethod` example in the document cannot run

2020-11-11 Thread hongweipeng


Change by hongweipeng :


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

___
Python tracker 

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



[issue42329] typing classes do not have __name__ attributes in 3.7+

2020-11-11 Thread Gregory P. Smith


New submission from Gregory P. Smith :

Python 3.7-3.10a1:
```
>>> List.__name__
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/typing.py", line 760, in __getattr__
raise AttributeError(attr)
AttributeError: __name__
>>> type(List)

>>> type(List[int])

```

Python 3.6:
```
>>> from typing import List
>>> List.__name__
'List'
>>> type(List)

>>> type(List[int])

```

Is this lack of common meta attributes intentional?  It makes the typing types 
unusual.

We just saw it trip up some code that was expecting everything to have a 
`__name__` attribute while moving beyond 3.6.  Judging by that `__getattr__` 
implementation it should happen on other common `__` attributes as mentioned in 
https://docs.python.org/3/library/stdtypes.html?highlight=__name__#special-attributes
 as well.

--
components: Library (Lib)
messages: 380801
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: typing classes do not have __name__ attributes in 3.7+
type: behavior
versions: Python 3.10, 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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Keep this issue.

--

___
Python tracker 

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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-11 Thread mental


mental  added the comment:

Interesting! thanks for the hint guido I'll try to investigate further.

This sounds like a regression (to me at least), in that case should a separate 
issue & patch PR be opened on the bpo or should this issue be used instead?

--

___
Python tracker 

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



[issue42328] ttk style.map function incorrectly handles the default state for element options.

2020-11-11 Thread Pat Thoyts


Change by Pat Thoyts :


--
keywords: +patch
nosy: +Pat Thoyts
nosy_count: 1.0 -> 2.0
pull_requests: +22138
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23241

___
Python tracker 

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



[issue42328] ttk style.map function incorrectly handles the default state for element options.

2020-11-11 Thread Pat Thoyts


New submission from Pat Thoyts :

When cloning a ttk style it is useful to copy an existing style and make 
changes. We can copy the configuration and layout using:

style.layout('Custom.TEntry', **style.layout('TEntry'))
style.configure('Custom.TEntry', **style.configure('TEntry))

However, doing this with style.map can result in an exception. An example of 
this occurs for any style that has a defined default state in the map eg the 
TNotebook.Tab in the clam theme:

>>> style.map('TNotebook.Tab','background')
[('selected', '#dcdad5'), ('#bab5ab',)]

However, calling Tk directly:

>>> style.tk.call(style._name,"map","TNotebook.Tab","-background")
(, '#dcdad5', , 
'#bab5ab')

The second pair is defining the default state ('') to use color #bab5ab but 
this is being mangled by the code that converts this into pythons response.

The culprit is ttk._list_from_statespec which treats the statespec with the 
empty string as None and drops it and then returns the value in place of the 
state and then puts in an empty value.

--
components: Tkinter
messages: 380798
nosy: patthoyts
priority: normal
severity: normal
status: open
title: ttk style.map function incorrectly handles the default state for element 
options.
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

I spent some time debugging this looking for the root cause.

I think it looks like the recursion check in ForwardRef._evaluate() fails to 
trigger.  At some point recursive_guard is a frozen set containing "'Integer'" 
(i.e. a string whose first and last character are single quotes, while 
self.__forward_arg__ is 'Integer' (i.e. a string that does not contain quotes).

I'm running out of time for the rest of the investigation, so feel free to 
confirm this and go down the rabbit hole from there...

--

___
Python tracker 

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



[issue24831] Load average in test suite too high

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue38823] Improve stdlib module initialization error handling.

2020-11-11 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue22442] Deprecate PIPE with subprocess.check_call() and call()

2020-11-11 Thread Irit Katriel


Irit Katriel  added the comment:

Any objections to closing this?

If the old API is going to be deprecated I think that's a topic for another 
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



[issue31242] Add SSLContext.set_verify_callback()

2020-11-11 Thread MineRobber___T


Change by MineRobber___T :


--
nosy: +MineRobber9000

___
Python tracker 

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



[issue42327] Add PyModule_Add()

2020-11-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

See also:

https://bugs.python.org/issue38823

https://github.com/python/cpython/pull/17298

--
nosy: +brandtbucher

___
Python tracker 

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



[issue42327] Add PyModule_Add()

2020-11-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue42327] Add PyModule_Add()

2020-11-11 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

There is a design flaw in PyModule_AddObject(). It steals reference of its 
value only if the result is success. To avoid leaks it should be used in the 
following form:

PyObject *tmp = ;
if (PyModule_AddObject(name, name, tmp) < 0) {
Py_XDECREF(tmp);
goto error;
}

It is inconvenient and many code forgot to use a temporary variable and call 
Py_XDECREF().

It was not intention, but it is too late to change this behavior now, because 
some code calls Py_XDECREF() if PyModule_AddObject() fails. Fixing 
PyModule_AddObject() now will break hard such code.

There was an idea to make the change gradual, controlled by a special macro 
(see issue26871). But it still has significant risk.

I propose to add new function PyModule_Add() which always steals reference to 
its argument. It is more convenient and allows to get rid of temporary variable:

if (PyModule_Add(name, name, ) < 0) {
goto error;
}

I choose name PyModule_Add because it is short, and allow to write the call in 
one line with moderately long expression  (like 
PyFloat_FromDouble(...) or PyLong_FromUnsignedLong(...)).

--
components: C API
messages: 380794
nosy: serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Add PyModule_Add()
type: 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



[issue42245] concurrent.futures.ProcessPoolExecutor freezes depending on complexity

2020-11-11 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The script as-is doesn't work with 3.8 because it uses the "spawn" strategy. I 
haven't tried to tweak the script to get it to work on 3.8 because the scripts 
works fine for me with 3.7.

The smaller script in msg380225 works for me on both python 3.7.4 and 3.8.3

Pip list says:

Package Version
--- ---
joblib  0.17.0 
numpy   1.19.4 
pandas  1.1.4  
pip 19.0.3 
python-dateutil 2.8.1  
pytz2020.4 
scikit-learn0.23.2 
scipy   1.5.4  
setuptools  40.8.0 
six 1.15.0 
sklearn 0.0
threadpoolctl   2.1.0  
xgboost 1.2.1

--

___
Python tracker 

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



[issue24743] Make _PyTraceback_Add public

2020-11-11 Thread Irit Katriel


Irit Katriel  added the comment:

The information about the location in c++ where the error occurred can be 
included in the exception message.

I don't think adding fake frames to the traceback is a pattern that we should 
support through a public API.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue42312] sys.prefix is set incorrectly on Mac OS X

2020-11-11 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I've thought about this some more and haven't changed my opinion: the current 
behaviour is intentional and won't change.

I'm therefore closing this issue.

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

___
Python tracker 

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



[issue42326] Add verify_callback hook capability to the SSL lib

2020-11-11 Thread Christian Heimes


Christian Heimes  added the comment:

Yes, it's a duplicate.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add SSLContext.set_verify_callback()

___
Python tracker 

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



[issue12508] codecs.StreamReader doesn't pass final=1 to the UTF-8 codec

2020-11-11 Thread STINNER Victor


Change by STINNER Victor :


--
title: Codecs Anomaly -> codecs.StreamReader doesn't pass final=1 to the UTF-8 
codec

___
Python tracker 

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



[issue25460] Misc/.gdbinit uses preprocessor macro

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Some gdb macros are broken in 3.6

___
Python tracker 

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



[issue6672] Add Mingw recognition to pyport.h to allow building extensions

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.4

___
Python tracker 

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



[issue42326] Add verify_callback hook capability to the SSL lib

2020-11-11 Thread Zackery Spytz


Zackery Spytz  added the comment:

Unfortunately, this seems like a duplicate of bpo-31242.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue10615] Trivial mingw compile fixes

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.1, Python 
3.2

___
Python tracker 

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



[issue41100] Build failure on macOS 11 (beta)

2020-11-11 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 12.0 -> 13.0
pull_requests: +22136
pull_request: https://github.com/python/cpython/pull/23239

___
Python tracker 

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



[issue1487481] Could BIND_FIRST be removed on HP-UX?

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


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



[issue6225] Fixing several minor bugs in Tkinter.Canvas and one in Misc._configure

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


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



[issue42324] Doctest: directives

2020-11-11 Thread Konrad Schwarz

Konrad Schwarz  added the comment:

Yes it is.

On Wed, Nov 11, 2020 at 1:06 PM Karthikeyan Singaravelan <
rep...@bugs.python.org> wrote:

>
> Karthikeyan Singaravelan  added the comment:
>
> Is this similar to https://bugs.python.org/issue36675 ?
>
> --
> nosy: +xtreak
>
> ___
> Python tracker 
> 
> ___
>

-- 
Mit freundlichen Grüßen

Konrad Schwarz

--

___
Python tracker 

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



[issue12508] Codecs Anomaly

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3

___
Python tracker 

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



[issue6225] Fixing several minor bugs in Tkinter.Canvas and one in Misc._configure

2020-11-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I believe, yes

--
status: pending -> open

___
Python tracker 

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



[issue10709] Misc/AIX-NOTES needs updating

2020-11-11 Thread Irit Katriel


Irit Katriel  added the comment:

The version in the patch was added as Misc/README.AIX, and the backporting 2.7 
and 3.1 is no longer relevant.

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



[issue1487481] Could BIND_FIRST be removed on HP-UX?

2020-11-11 Thread Göran Uddeborg

Göran Uddeborg  added the comment:

>From my view as reporter, it would be fine to close it. We no longer have any 
>HP-UX systems.

--
status: pending -> open

___
Python tracker 

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

> `May not be NULL` means everthing is possible

No, it does not. It only means a slot's value may not be NULL, which is an 
important difference between slots and entries in the PyTypeObject structure.

It's OK that it's mentioned elsewhere, but can we please put it back in the 
docs of PyType_Slot?

--

___
Python tracker 

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



[issue42317] Docs of `typing.get_args`: Mention that due to caching of typing generics the order of arguments for Unions can be different from the one of the returned tuple

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Agreed it's mildly sad, and I wish the cache could preserve the order in 
List[Union[int, str]], but for that to work we'd have to change how the cache 
works, which feels complex, or we'd have to chance things so that Union[int, 
str] != Union[str, int], which seems wrong as well (and we've had them equal 
for many releases so this would break code).

Fixing the cache would require adding a new comparison method to all generic 
type objects, and that just doesn't seem worth the effort (but I'd be open to 
this solution in the future).

So for now, let's document that get_args() may swap Union arguments.

--
stage:  -> needs patch

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-11 Thread David Edelsohn


David Edelsohn  added the comment:

nextafter is a known problem on AIX.  I believe that it is being addressed in 
newer releases of AIX.

Michael and I are helping the IBM AIX Open Source team to increase their 
attention on Python, but things only move so fast.

--

___
Python tracker 

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



[issue9420] gdbm with /usr/include/ndbm.h

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3

___
Python tracker 

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



[issue2449] Improved serialization error logging in xmlrpclib

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.2

___
Python tracker 

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



[issue6225] Fixing several minor bugs in Tkinter.Canvas and one in Misc._configure

2020-11-11 Thread Irit Katriel


Irit Katriel  added the comment:

Since the code looks so different from the patch now, shall we close this as 
out of date?

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



[issue42260] [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter

2020-11-11 Thread Chris Meyer


Chris Meyer  added the comment:

>> I would like to request that this ability to dynamically load Python DLLs 
>> remains even with any new initialization mechanism.

> I don't plan to remove any feature :-)

I am glad to hear that. I'm somewhat nervous about it nevertheless. In 
particular, the implementation of Py_DECREF changed from 3.7 to 3.8 to 3.9. 3.7 
worked entirely in a header; but 3.8 had a quirky definition of _Py_Dealloc 
which used _Py_Dealloc_inline but was defined out of order (used before 
defined). This was somewhat addressed in 
https://github.com/python/cpython/pull/18361/files; however 3.9 now has another 
mechanism that defines _Py_Dealloc in Objects/object.c. This isn't a major 
problem because it has the same implementation as before, but changes like this 
have the potential to make the launcher binary be version specific. Again, not 
a deal breaker, but it still makes me nervous.

--

___
Python tracker 

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



[issue42085] Add dedicated slot for sending values

2020-11-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thank you Victor for the report!

--

___
Python tracker 

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



[issue42260] [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter

2020-11-11 Thread Chris Meyer

Chris Meyer  added the comment:

> How do you configure sys.path currently? Do you parse a configuration file? 
> Do you use a registry key on Windows?

We have several launch scenarios - but for the currently most common one, which 
is to launch using a separate, existing Python environment, we call 
Py_SetPythonHome and Py_SetPath with the home directory of the environment. 
Then, presumably, the more complete path gets set in either Py_Initialize or 
when we call PyImport_ImportModule(“sys”). I might have tracked the details 
down once, but I don't recall them. By the time our Python code starts running, 
sys.path is reasonably populated.

However, in another scenario, we launch with an embedded Python environment, 
essentially a virtual environment. In that case, we have a config file to 
explicitly add lib, DLLs, and site packages. But something goes wrong [cannot 
find/load the unicode DLL IIRC] unless we call site.addsitedir for each 
directory already in sys.path near the start of our Python portion of code. My 
notes point to two issues to explain this: https://bugs.python.org/issue22213 
and https://bugs.python.org/issue35706.

--

___
Python tracker 

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



[issue979658] Improve HTML documentation of a directory

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 3.2

___
Python tracker 

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



[issue42326] Add verify_callback hook capability to the SSL lib

2020-11-11 Thread MineRobber___T


New submission from MineRobber___T :

The SSL library currently lacks the ability to accept a client certificate 
without attempting to verify it. To alleviate this issue, I was thinking that 
an attribute could be added to the ssl.SSLContext class along the lines of 
`verify_callback` (similar to how the SNI callback is handled) which would 
allow the implementation of custom cert verification. I'd be willing to help 
work on this, if I knew where to even begin.

--
assignee: christian.heimes
components: SSL
messages: 380776
nosy: MineRobber9000, alex, christian.heimes, dstufft, janssen
priority: normal
severity: normal
status: open
title: Add verify_callback hook capability to the SSL lib
type: enhancement

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-11 Thread STINNER Victor


STINNER Victor  added the comment:

> That sounds more like a process problem than a CPython codebase one. The 
> ideal would be that the machinery sending those notifications can be 
> configured to ignore known failures when deciding whether to send email. Is 
> that remotely feasible? (I have zero familiarity with the buildbot machinery.)

If a test fails all the time and not randomly, a single email is sent at the 
first failure.

I'm annoyed by test_threading which crash randomly on AIX: 
https://bugs.python.org/issue40068 It's a known issue, I already fixed 3/4 of 
the issue, but I didn't fix the remaining part.

In the past, I already disabled AIX email notifications simply because there 
was nobody to fix issues, and so emails were just spam.


> but I kinda *want* IBM developers running the Python test suite on AIX to see 
> those failures, in the hope that they might then be motivated to push for a 
> fix to the relevant AIX bug. :-)

Well, that would be great.

I'm not sure if Michael Felt is still working on supporting AIX in Python. 
David Edelsohn might help.

--
nosy: +David.Edelsohn

___
Python tracker 

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



[issue42260] [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter

2020-11-11 Thread Chris Meyer


Chris Meyer  added the comment:

Responding to your request for feedback on Python-Dev:

We embed Python dynamically by finding the libPython DLL, loading it, and 
looking up the required symbols. We make appropriate define's so that the 
Python headers (and NumPy headers) point to our functions which in turn point 
to the looked up symbols.

Our launcher works on Linux, macOS, and Windows and works with many 
environments including standard Python and conda and brew. It also supports 
virtual environments in most cases. Also, a single executable [per platform] is 
able to work with Python versions 3.7 - 3.9 (3.6 was recently dropped, but only 
for external reasons).

So my comment is not directly addressing the usefulness of configuring Python 
initialization - but I would like to request that this ability to dynamically 
load Python DLLs remains even with any new initialization mechanism.

As another note, the main issues we run into are configuring the Python path to 
properly find packages and DLLs. A goal of ours is to be able to provide the 
base application as a drag-and-drop style installer with its own full embedded 
Python distribution (but still loaded dynamically) and then be able to supply 
additional plug-in packages (Python packages) by drag and drop. This is 
somewhat similar to conda packaging but without support for command line tools.

--
nosy: +cmeyer

___
Python tracker 

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



[issue42258] argparse: show choices once per argument

2020-11-11 Thread mendelmaleh


mendelmaleh  added the comment:

When using more than one flag for an argument, it is redundant to have the 
choices more than once, since they are the same argument and have the same 
choices.
Showing it once means cleaner output, and often means that the other option 
lines are shorter, like in the test case.

### sample code
```py
import argparse

ap = argparse.ArgumentParser(allow_abbrev=False)
ap.add_argument('-c', '--choices', choices=['a', 'b', 'c'])
ap.parse_args()
```

### previous output
```
usage: main.py [-h] [-c {a,b,c}]

optional arguments:
  -h, --helpshow this help message and exit
  -c {a,b,c}, --choices {a,b,c}
```

### new output
```
usage: main.py [-h] [-c {a,b,c}]

optional arguments:
  -h, --helpshow this help message and exit
  -c, --choices {a,b,c}
```

--

___
Python tracker 

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



[issue7611] shlex not posix compliant when parsing "foo#bar"

2020-11-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 3.2

___
Python tracker 

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



[issue42260] [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter

2020-11-11 Thread STINNER Victor


STINNER Victor  added the comment:

> I would like to request that this ability to dynamically load Python DLLs 
> remains even with any new initialization mechanism.

I don't plan to remove any feature :-)

> As another note, the main issues we run into are configuring the Python path 
> to properly find packages and DLLs.

Do you mean sys.path? If yes, that's one of the goal of this issue. Allow you 
to write your own Python code to configure sys.path, rather than having to 
write C code, before the first (external) import.

How do you configure sys.path currently? Do you parse a configuration file? Do 
you use a registry key on Windows?

--

___
Python tracker 

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



[issue42085] Add dedicated slot for sending values

2020-11-11 Thread STINNER Victor


STINNER Victor  added the comment:

commit cda99b4022daa08ac74b0420e9903cce883d91c6 (HEAD -> master, 
upstream/master)
Author: Andrew Svetlov 
Date:   Wed Nov 11 17:48:53 2020 +0200

Fix memory leak introduced by GH-22780 (GH-23237)

--

___
Python tracker 

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



[issue42085] Add dedicated slot for sending values

2020-11-11 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks! The change fixed the leak:

$ ./python -m test -j0 -R 3:3 test_asyncgen test_coroutines test_unittest # 
test_asyncio 
(...)
Tests result: SUCCESS

I didn't run test_asyncio because the test is too slow.

--

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-11 Thread Mark Dickinson


Mark Dickinson  added the comment:

> My worry is that I'm getting emails about AIX buildbot failures.

That sounds more like a process problem than a CPython codebase one. The ideal 
would be that the machinery sending those notifications can be configured to 
ignore known failures when deciding whether to send email. Is that remotely 
feasible? (I have zero familiarity with the buildbot machinery.)

Skipping the test on AIX sounds like a reasonable option, but I kinda *want* 
IBM developers running the Python test suite on AIX to see those failures, in 
the hope that they might then be motivated to push for a fix to the relevant 
AIX bug. :-)

--

___
Python tracker 

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



[issue42269] Add ability to set __slots__ in dataclasses

2020-11-11 Thread Xtrem532


Change by Xtrem532 :


--
nosy: +Xtrem532

___
Python tracker 

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



[issue42245] concurrent.futures.ProcessPoolExecutor freezes depending on complexity

2020-11-11 Thread DanilZ


DanilZ  added the comment:

Hi Ken, 

Thanks for your comment.

Unfortunately at the time I can not upgrade to 3.8 to run this test. My whole 
system depends on 3.7 and some peculiarities of 3.8 need to be dealt with.

It would be great if someone with OSX and 3.8 could test this out, otherwise I 
will dig into this later creating a new environment.

> On 11 Nov 2020, at 18:12, Ken Jin  wrote:
> 
> 
> Ken Jin  added the comment:
> 
> Danil, thanks for finding the cause behind this. Could you check if the new 
> behavior in Python 3.8 and higher has the same problem on your machine 
> (without your fix)? multiprocessing on MacOS started using spawn in 3.8, and 
> I was wondering if it that fixed it.
> 
> What's new entry for 3.8 : 
> https://docs.python.org/3/whatsnew/3.8.html#multiprocessing
> 
> The bug tracked:
> https://bugs.python.org/issue33725
> 
> The PR for that
> https://github.com/python/cpython/pull/13603/files
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-11 Thread hai shi


hai shi  added the comment:

> The PR entirely removed the note that a slot's value "May not be NULL".
> In fact, only tp_doc may be NULL. AFAIK, the restriction is still there > for 
> other slots.
> Can that note be added back?

`May not be NULL` means everthing is possible, so I decided removed it:(
Before, I updated an old commit in PR23123 to describe this fact in 
https://github.com/python/cpython/pull/23123/commits/cca7bc7edf11a7d212ae70dcff6f10cf96fab470.

--

___
Python tracker 

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



[issue42245] concurrent.futures.ProcessPoolExecutor freezes depending on complexity

2020-11-11 Thread Ken Jin


Ken Jin  added the comment:

Danil, thanks for finding the cause behind this. Could you check if the new 
behavior in Python 3.8 and higher has the same problem on your machine (without 
your fix)? multiprocessing on MacOS started using spawn in 3.8, and I was 
wondering if it that fixed it.

What's new entry for 3.8 : 
https://docs.python.org/3/whatsnew/3.8.html#multiprocessing

The bug tracked:
https://bugs.python.org/issue33725

The PR for that
https://github.com/python/cpython/pull/13603/files

--

___
Python tracker 

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



[issue42085] Add dedicated slot for sending values

2020-11-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

PR for the fix is created: https://github.com/python/cpython/pull/23237

--

___
Python tracker 

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



[issue42085] Add dedicated slot for sending values

2020-11-11 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +22135
pull_request: https://github.com/python/cpython/pull/23237

___
Python tracker 

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



[issue42245] concurrent.futures.ProcessPoolExecutor freezes depending on complexity

2020-11-11 Thread DanilZ


DanilZ  added the comment:

I have managed to solve the problem by inserting in the beginning of my program:

import multiprocessing
multiprocessing.set_start_method('forkserver')
as this is explained here: 
https://scikit-learn.org/stable/faq.html#why-do-i-sometime-get-a-crash-freeze-with-n-jobs-1-under-osx-or-linux
 

It works, but the shell looses some level of interactivity as the results 
intermediate results don't get printed as the program is executed.

> On 2 Nov 2020, at 19:03, Ken Jin  wrote:
> 
> 
> Ken Jin  added the comment:
> 
> Hmm apologies I'm stumped then. The only things I managed to surmise from 
> xgboost's and scikit-learn's GitHub issues is that this is a recurring issue 
> specifically when using GridSearchCV :
> 
> Threads with discussions on workarounds:
> https://github.com/scikit-learn/scikit-learn/issues/6627
> https://github.com/scikit-learn/scikit-learn/issues/5115
> 
> Issues reported:
> https://github.com/dmlc/xgboost/issues/2163
> https://github.com/scikit-learn/scikit-learn/issues/10533
> https://github.com/scikit-learn/scikit-learn/issues/10538 (this looks quite 
> similar to your issue)
> 
> Some quick workarounds I saw were:
> 1. Remove n_jobs argument from GridSearchCV
> 2. Use parallel_backend from sklearn.externals.joblib rather than 
> concurrent.futures so that the pools from both libraries don't have weird 
> interactions.
> 
> I recommend opening an issue on scikit-learn/XGBoost's GitHub. This seems 
> like a common problem that they face.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue42014] shutil.rmtree calls onerror with different function than failed

2020-11-11 Thread Hynek Schlawack


Change by Hynek Schlawack :


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



[issue42085] Add dedicated slot for sending values

2020-11-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Investigating. The test leaks a future instance.

--

___
Python tracker 

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



[issue42317] Docs of `typing.get_args`: Mention that due to caching of typing generics the order of arguments for Unions can be different from the one of the returned tuple

2020-11-11 Thread Ken Jin


Ken Jin  added the comment:

You're right, currently this happens for 2 reasons:

1. _SpecialGenericAlias (used by List), caches its __getitem__. (As you already 
pointed out :) )

2. _UnionGenericAlias (Union)'s __hash__ is `hash(frozenset(self.__args__))`. 
i.e. Unions with different args orders but same unique args produce the same 
hash result. Causing the same cache hit.

I find it mildly sad however that:

>>> get_args(Union[int, str])
[int, str]

>>> get_args(Union[str, int])
[str, int]

Which is slightly inconsistent with its behavior when nested in List. I don't 
think there's an easy way to fix this without breaking the cache (and also it 
makes sense that Unions' args aren't order dependent). So I'm all for updating 
the docs with your addition (slightly edited):

> If `X` is a `Union`, the order of `(Y, Z, ...)` may be different from the 
> order of the original arguments `[Y, Z, ...]`.

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



[issue42325] UnicodeDecodeError executing ./setup.py during build

2020-11-11 Thread Skip Montanaro

New submission from Skip Montanaro :

I recently replaced Ubuntu 20.04 with Manjaro 20.2. In the process my Python 
builds broke in the sharedmods target of the Makefile. The tail end of the 
traceback is:

  File "/home/skip/src/python/cpython/./setup.py", line 246, in grep_headers_for
    if function in f.read():
  File "/home/skip/src/python/cpython/Lib/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb4 in position 1600: 
invalid start byte

The grep_headers_for() function in setup.py appeared to be the culprit, so I 
added a print statement to its loop:

def grep_headers_for(function, headers):
    for header in headers:
        print("***", header, file=sys.stderr)
        with open(header, 'r') as f:
            if function in f.read():
                return True
    return False

which printed these lines:

*** /usr/include/umfpack_report_perm.h
*** /usr/include/dbstl_dbc.h
*** /usr/include/itclTclIntStubsFcn.h
*** /usr/include/dbstl_vector.h
*** /usr/include/cholmod_blas.h
*** /usr/include/amd.h
*** /usr/include/m17n-X.h

Sure enough, that m17n-X.h file (attached) doesn't contain utf-8 (my 
environment's encoding). According to the Emacs coding cookie at the end, the 
file is euc-japan encoded. Would simply catching the exception in 
grep_headers_for() be the correct way to deal with this?

--
components: Build
files: m17n-X.h
messages: 380761
nosy: skip.montanaro
priority: normal
severity: normal
status: open
title: UnicodeDecodeError executing ./setup.py during build
versions: Python 3.10
Added file: https://bugs.python.org/file49593/m17n-X.h

___
Python tracker 

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



[issue42322] Spectre mitigations in CPython interpreter

2020-11-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

AFAIK Spectre attacks rely on precise time measures. But Python is very far 
from bare hardware. Pure Python code is 10-100 times slower than compiled C or 
jitted JavaScript, and the variance is high, so it is hard to get stable 
results in benchmarks. Simple a=b+c can causes execution of hundreds or 
thousands of microprocessor instructions, numerous memory read and write 
operations, calling many subroutines, memory allocations and deallocations.

I have doubts that it is practical to use Spectre attacks on pure Python.

Of course, if you use high-performance extensions to work with sensitive data, 
they can be vulnerable to attack if the attacker code is in the other 
extension. You can counteract this by building that extensions with a C 
compiler which implements workarounds.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42269] Add ability to set __slots__ in dataclasses

2020-11-11 Thread Jakub Stasiak


Jakub Stasiak  added the comment:

As a moderately-heavy dataclass user I support this. :)

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-11-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ba2958ed40d284228836735cbed4a155190e0998 by Victor Stinner in 
branch 'master':
bpo-40170: Fix PyType_Ready() refleak on static type (GH-23236)
https://github.com/python/cpython/commit/ba2958ed40d284228836735cbed4a155190e0998


--

___
Python tracker 

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



[issue42140] asyncio.wait function creates futures set two times

2020-11-11 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-11-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ba2958ed40d284228836735cbed4a155190e0998 by Victor Stinner in 
branch 'master':
bpo-40170: Fix PyType_Ready() refleak on static type (GH-23236)
https://github.com/python/cpython/commit/ba2958ed40d284228836735cbed4a155190e0998


--

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-11 Thread STINNER Victor


STINNER Victor  added the comment:

My worry is that I'm getting emails about AIX buildbot failures. I see 
different options:

* Skip the test on AIX
* Fix nextafter() on AIX
* Turn off AIX buildbot email notifications
* Remove thE AIX buildbot

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-11-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22134
pull_request: https://github.com/python/cpython/pull/23236

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-11-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22133
pull_request: https://github.com/python/cpython/pull/23236

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-11 Thread Mark Dickinson


Mark Dickinson  added the comment:

Is there any reasonable channel for reporting the issue upstream?

--

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-11 Thread Mark Dickinson


Mark Dickinson  added the comment:

If AIX were one of our officially supported platforms, then yes, I'd say that 
we should add a workaround to handle special cases ourselves, similarly to what 
we already do for a number of math module functions (like math.pow, for 
example).

But given that it's only a "best effort" platform, I'm not convinced that it's 
worth the effort or the extra complication in the codebase.

-0 from me, I guess.

--

___
Python tracker 

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



[issue42314] Incorrect documentation entry for venv

2020-11-11 Thread Vinay Sajip


Change by Vinay Sajip :


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



[issue6103] Static library (libpythonX.Y.a) installed in incorrect location

2020-11-11 Thread Dirkjan Ochtman


Change by Dirkjan Ochtman :


--
nosy:  -djc

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +Michael.Felt

___
Python tracker 

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



[issue42324] Doctest: directives

2020-11-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is this similar to https://bugs.python.org/issue36675 ?

--
nosy: +xtreak

___
Python tracker 

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



[issue42324] Doctest: directives

2020-11-11 Thread Konrad Schwarz


New submission from Konrad Schwarz :

In both PDF and HTML, the examples for Doctest directives don't actually show 
the directives themselves, perhaps because they syntactically start with a #.

--
assignee: docs@python
components: Documentation
messages: 380752
nosy: docs@python, konrad.schwarz
priority: normal
severity: normal
status: open
title: Doctest: directives
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-11 Thread STINNER Victor


New submission from STINNER Victor :

https://buildbot.python.org/all/#/builders/302/builds/338

FAIL: test_nextafter (test.test_math.MathTests)
--
Traceback (most recent call last):
  File 
"/home/aixtools/buildarea/3.9.aixtools-aix-power6/build/Lib/test/test_math.py", 
line 1968, in test_nextafter
self.assertIsNaN(math.nextafter(NAN, 1.0))
  File 
"/home/aixtools/buildarea/3.9.aixtools-aix-power6/build/Lib/test/test_math.py", 
line 2015, in assertIsNaN
self.fail("Expected a NaN, got {!r}.".format(value))
AssertionError: Expected a NaN, got 1.0.

The test:

# NaN
self.assertIsNaN(math.nextafter(NAN, 1.0))   # <=== HERE
self.assertIsNaN(math.nextafter(1.0, NAN))
self.assertIsNaN(math.nextafter(NAN, NAN))

The Linux manual page says: "If x or y is a NaN, a NaN is returned."
https://man7.org/linux/man-pages/man3/nextafter.3.html

But it seems like the AIX libc doesn't implement this rule. Should we implement 
this rule in Python on AIX?

The strange thing is that it worked previously. test.python of build 338:

platform.platform: AIX-2-00F9C1964C00-powerpc-32bit
sysconfig[HOST_GNU_TYPE]: powerpc-ibm-aix7.2.4.0
platform.architecture: 32bit

The latest green build is built 347. test.pythoninfo of build 347:

platform.architecture: 32bit
platform.platform: AIX-2-00F9C1964C00-powerpc-32bit
sysconfig[HOST_GNU_TYPE]: powerpc-ibm-aix7.2.0.0

Was the machine updated two days ago (2020-11-09), between build 338 and build 
347?

--
components: Tests
messages: 380751
nosy: lemburg, mark.dickinson, rhettinger, stutzbach, vstinner
priority: normal
severity: normal
status: open
title: [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN 
on AIX
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



[issue42085] Add dedicated slot for sending values

2020-11-11 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset 1e996c3a3b51e9c6f1f4cea8a6dbcf3bcb865060 by Vladimir Matveev in 
> branch 'master':

This change introduced big reference leaks:

4 tests failed:
test_asyncgen test_asyncio test_coroutines test_unittest

Example:

$ ./python -m test test_asyncgen -R 3:3 -m 
test.test_asyncgen.AsyncGenAsyncioTest.test_async_gen_asyncio_03
(...)
test_asyncgen leaked [63, 63, 63] references, sum=189
(...)

Please fix the leak, or revert if nobody is avaible to fix it:
https://pythondev.readthedocs.io/ci.html#revert-on-fail

--
nosy: +vstinner

___
Python tracker 

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



[issue42322] Spectre mitigations in CPython interpreter

2020-11-11 Thread STINNER Victor


STINNER Victor  added the comment:

You can try to use a C compiler which implements workarounds, but I don't think 
that anything should be done directly in CPython.

--
nosy: +vstinner

___
Python tracker 

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



[issue42322] Spectre mitigations in CPython interpreter

2020-11-11 Thread Amir Naseredini


New submission from Amir Naseredini :

I was looking up everywhere and could not find any mitigations for Spectre 
attack by a Python interpreter(CPython)! I don't know if my question is correct 
or how feasible it is, but does anyone know if there are any mitigations for 
different variants of Spectre attacks Specter v1 (Spectre-PHT), v2 
(Spectre-BTB), v4 (Spectre-STL) and v5 (Spectre-RSB) at the interpreter level 
for Python?
Looking forward to hearing from you guys :)

--
components: Interpreter Core
messages: 380748
nosy: sahnaseredini
priority: normal
severity: normal
status: open
title: Spectre mitigations in CPython interpreter
type: security
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



[issue42321] Limitations of building a static python library on Windows (MSVC)

2020-11-11 Thread Maarten


New submission from Maarten :

`PCbuild/readme.txt` contains a little paragraph about how to build a static 
python library.
The resulting static `python.lib` library contains all python C API functions.

Windows DLL's don't allow missing symbols, so C extensions modules must link 
with a library containing the python C API symbols.
When a C extension links to the static python library, it will contain a copy 
of all python symbols.
This means that python C symbols are used twice: once by a static python.exe 
executable, and once for each C extension (_extension.pyw).

Is there a way to use C extensions with a static Windows python.exe wuch that 
the python symbols are used only once?
Does a statically built Windows python.exe support C extension modules at all?

Thanks

I'm currently working on a conan build recipe for cpython at 
https://github.com/conan-io/conan-center-index/pull/1510
Fow now, I'm disabling extensions on a static MSVC build.

--
components: Windows
messages: 380747
nosy: maarten, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Limitations of building a static python library on Windows (MSVC)
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



[issue33129] Add kwarg-only option to dataclass

2020-11-11 Thread conchylicultor


conchylicultor  added the comment:

Solving this would significantly improve @dataclass inheritance 
(https://bugs.python.org/issue39300). Any idea when this will land ?

Currently, it is not possible to add required argument to a child dataclass 
(unless hacks like duplicating attributes):

```
import dataclasses

@dataclasses.dataclass
class A:
  x: int = 1


@dataclasses.dataclass
class B(A):
  y: int  # ERROR: non-default argument follows default argument
```

Keywords-only would solve this issue:

```
@dataclasses.dataclass
class B(A):
  y: int = dataclasses.field(kw_only=True)


B(123, y=456)
```

Note: Attrs already support this: 
https://www.attrs.org/en/stable/examples.html#keyword-only-attributes


For the behavior, I think there are two options:

```
class A:
  a0: int
  a1: int = field(kw_only=True)
  a2: int


class B(A):
  b0: int
  b1: int = field(kw_only=True)
  b2: int
```


Option 1: All attributes following `kw_only` are `kw_only` (kw_only indicates 
where to place '*')

A(a0, *, a1, a2)
B(a0, b0, *, a1, a2, b1, b2)

Option 2: `kw_only` are individually moved to the end

A(a0, a2, *, a1)
B(a0, a2, b0, b2, *, a1, b1)

I personally prefer Option 1, as it makes it easier to place the `*` with less 
boilerplate.

```
class Request:
  url: str
  timeout: int = field(default=-1, kw_only=True)
  verify: bool = False
  params: Optional[Dict[str, str]] = None
  cookies: Optional[Dict[str, str]] = None

Request(url, *, timeout=-1, verify=False, params=None, cookies=None)
```

Which looks better than:

```
class Request:
  url: str
  timeout: int = field(default=-1, kw_only=True)
  verify: bool = field(default=False, kw_only=True)
  params: Optional[Dict[str, str]] = field(default=None, kw_only=True)
  cookies: Optional[Dict[str, str]] = field(default=None, kw_only=True)
```

--
nosy: +conchylicultor

___
Python tracker 

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



[issue42320] unexpected difference between map and list

2020-11-11 Thread Pierre van de Laar


Pierre van de Laar  added the comment:

Not a bug: tuple is an iterator but an iterator is not a tuple.
Yet iterators are often accepted during initialization...

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



[issue42292] C API: Allocating Objects on the Heap. Misleading documentation.

2020-11-11 Thread igo95862


igo95862  added the comment:

I found out that you can call the type as an object in order to create new 
object.


Example:


SdBusMessageObject *new_message_object = (SdBusMessageObject 
*)PyObject_Call((PyObject *)&SdBusMessageType, dummy_tuple, dummy_dict);


This is somewhat not documented. Is this the recommended way to allocate object 
on heap?


I also found out that if you create a custom .tp_free function for the type it 
must call PyObject_Free(self); otherwise you leak memory.

--

___
Python tracker 

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



[issue42320] unexpected difference between map and list

2020-11-11 Thread Pierre van de Laar


Pierre van de Laar  added the comment:

Zip didn't contain the test cases from the tests directory (sorry for that)

--
Added file: https://bugs.python.org/file49592/tests.zip

___
Python tracker 

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



[issue42320] unexpected difference between map and list

2020-11-11 Thread Pierre van de Laar


New submission from Pierre van de Laar :

On windows, with python 3.9, with unittests,

My test case fails when I use the following lines of code
```
result = map(lambda x: self.substitute_in_expression(x),
 sequence.sequence)
```
It works fine with
```
result = list()
for x in sequence.sequence:
 result.append(self.substitute_in_expression(x))
```

Note that result is used as input for an inherited class instantiation:
```
sequence_type = type(sequence)
return sequence_type(result)
```
The classes are constructed using the dataclass decorator!


I have unfortunately not have time to make a small reproducer.
So I just send the whole project.

--
files: bug.zip
messages: 380742
nosy: Pierre van de Laar
priority: normal
severity: normal
status: open
title: unexpected difference between map and list
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49591/bug.zip

___
Python tracker 

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



[issue42319] The `functools.singledispatchmethod` example in the document cannot run

2020-11-11 Thread hongweipeng


New submission from hongweipeng :

https://docs.python.org/zh-cn/3.8/library/functools.html#functools.singledispatchmethod

as the code:
```
from functools import singledispatchmethod

class Negator:
@singledispatchmethod
@classmethod
def neg(cls, arg):
raise NotImplementedError("Cannot negate a")

@neg.register
@classmethod
def _(cls, arg: int):
return -arg

@neg.register
@classmethod
def _(cls, arg: bool):
return not arg

```

  File "/root/.pyenv/versions/3.8.5/lib/python3.8/functools.py", line 907, in 
register
return self.dispatcher.register(cls, func=method)
  File "/root/.pyenv/versions/3.8.5/lib/python3.8/functools.py", line 849, in 
register
raise TypeError(
TypeError: Invalid first argument to `register()`: . Use either `@register(some_class)` or plain `@register` on an 
annotated function.

--
assignee: docs@python
components: Documentation
messages: 380741
nosy: docs@python, hongweipeng
priority: normal
severity: normal
status: open
title: The `functools.singledispatchmethod` example in the document cannot run
versions: Python 3.8

___
Python tracker 

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