[issue42006] Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId

2020-10-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

My plan is to deprecate PyDict_GetItem() and functions with same design flaw 
and finally remove them (in 4.0?).

We cannot start to ignore exceptions in PyDict_GetItem(). It would not fix the 
original flaw when the user code does not check an exception after using 
PyDict_GetItem(), and only make it worse. It can cause crashes in the code 
which asserts that the exception is not set (for example when function returns 
value and sets exception). And in worst case it will lead to incorrect results 
when PyErr_Occurred() is used after calling other C API function.

Emitting a DeprecationWarning only when PyDict_GetItem() is called with an 
exception raised does not make much sense, because the problem with 
PyDict_GetItem() is not only in this case. Also, there is a trick in using 
warnings here, you should use PyErr_WriteUnraisable(), so warnings always will 
be printed and cannot be turned into exceptions.

--

___
Python tracker 

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



[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemIdWithError

2020-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use PyDict_Contains() and PyDict_SetDefault() instead of 
PyDict_GetItemIdWithError

___
Python tracker 

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



[issue42146] subprocess.Popen() leaks cwd in case of uid/gid overflow

2020-10-26 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

Thanks for merging! I've rebased PR 22970.

--

___
Python tracker 

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



[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError()

2020-10-26 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

It was common to use the code PyDict_GetItem(dict, key) == NULL to check 
whether the key is in the dict. PyDict_GetItem() returns borrowed reference, so 
no clean up is needed. And if we need to check only existence of the key, we do 
not need to store a value.

But PyDict_GetItem() which suppresses all internal exceptions is considered not 
safe, so PyDict_GetItemWithError() should be used. The code looks like:

if (PyDict_GetItemWithError(dict, key) == NULL) {
if (PyErr_Occurred()) {
goto error;
}
// does not have the key
}
else {
// has the key
}

It can be written with using PyDict_Contains():

int r = PyDict_Contains(dict, key);
if (r < 0) {
goto error;
}
if (r == 0) {
// does not have the key
}
else {
// has the key
}

Advantages:

* It is more clear expression of what we do.
* It is more simple and efficient in PyPy, because it has to keep borrowed 
references and track their lifetime.
* It may be more efficient in CPython, because calling PyErr_Occurred() has 
small but non-zero cost.
* PyErr_Occurred() would not be fooled by exception raised before. So you can 
use this code even if an exception is set.

Disadvantages:

* You need to use an int variable.

In some cases, when this check is used in combinations with PyDict_SetItem(), 
the code can be replaced with PyDict_SetDefault(), which is bot more terse and 
efficient. And when it is used in combinations with PyDict_DelItem(), the code 
can be replaced with _PyDict_Pop().

The proposed patch makes the code using PyDict_Contains() and 
PyDict_SetDefault() if appropriate. All use cases for _PyDict_Pop() were 
already covered by previous changes.

--
components: +Interpreter Core
nosy: +methane, vstinner
title: Use PyDict_Contains() and PyDict_SetDefault() instead of 
PyDict_GetItemIdWithError -> Use PyDict_Contains() and PyDict_SetDefault() 
instead of PyDict_GetItemWithError()
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



[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError()

2020-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError()

2020-10-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The code uses also _PyDict_ContainsId() added in issue42006 instead of 
_PyDict_GetItemIdWithError().

Few uses of _PyDict_GetItemStringWithError() are left as is. I do not think it 
is worth to introduce _PyDict_ContainsString(). They could be rewritten using 
_PyDict_ContainsId() if we find it worth.

--

___
Python tracker 

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



[issue1490929] urllib.retrieve's reporthook called with non-helpful value

2020-10-26 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

> so was this fixed?

Irit, not really. This is adding another hook called "progress hook" in 
addition to the "report hook". We need to evaluate if this is really required.

--
status: pending -> open

___
Python tracker 

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



[issue42153] doc: library imaplib a url not available

2020-10-26 Thread Chris Xiao

New submission from Chris Xiao :

jump to https://docs.python.org/3/library/imaplib.html#imap4-objects,

in the "See also" text, the url(https://www.washington.edu/imap/) of the 
University of Washington’s IMAP Information Center is not available.

--
assignee: docs@python
components: Documentation
messages: 379650
nosy: chrisxiao, docs@python
priority: normal
severity: normal
status: open
title: doc: library imaplib a url not available
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



[issue1490929] urllib.retrieve's reporthook called with non-helpful value

2020-10-26 Thread Irit Katriel


Change by Irit Katriel :


--
stage: test needed -> 
versions: +Python 3.10, Python 3.8, 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



[issue42147] Micro optimization for longrange iteration if step is 1

2020-10-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think that In sum(range(1 << 1000, (1 << 1000) + 100)) it is dwarfed by 
repeated addition of long integers in sum(). I expect the the effect of this 
optimization is even less that 13% in this case. In any case, for sum(range(a, 
b)) it is better to use formula (b-a)*(a+b-1)//2 if it is performance critical 
to you.

Iterating range object is pretty rare in Python (in most cases you iterate a 
sequence itself or enumerate object), and iterating range object for large 
integer is especially rare. Also, in real code you do not just iterate for the 
sake of iterating, you execute some code in every iteration. And it will make 
the effect of the optimization of this case much smaller, closer to 1% or 0.1% 
that to 13%.

Last week Inada-san played with my old optimization patch for using free lists 
for integers and decided to close the issue. He, and I, and other core 
developers agreed that it is not worth. Besides that optimization would help in 
much more cases and had good effect in microbenchmarks. And I closed also my 
other optimization patch few days ago. And did it many times in past. It is 
fanny to microoptimize the code, add special cases here and there, but it makes 
code larger and less maintenable, and a lot of such microoptimizations can have 
negative cumulative effect on the performance of general code. Sometimes the 
work of the core developer is to say "No" to his own code.

--

___
Python tracker 

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



[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-26 Thread Alex Roussel


Alex Roussel  added the comment:

OK understood. Thanks for the explanation, I wasn't aware of those and will 
take a look.

--

___
Python tracker 

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



[issue42153] doc: library imaplib a url not available

2020-10-26 Thread Hitansh K Doshi


Hitansh K Doshi  added the comment:

hello,
I am new to python repo,
I would like to contribute here.

I checked the page to told and it is showing that 
https://www.washington.edu/imap/ is not found.
I tried to find the url to their documentation but I couldn't found one. can 
you please guide me here

--
nosy: +hitansh159

___
Python tracker 

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



[issue42147] Micro optimization for longrange iteration if step is 1

2020-10-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

> Sometimes the work of the core developer is to say "No" to his own code.

Thank you for the careful sentence.
For clear the air, I never think that my patch should be accepted.
This is why I always get reviews from other core devs and I always accept the 
review result.
(You may know my a lot of rejected PR ;))

but for the future record, we always record why someone tried this and why 
rejected(e.g why not worthed to do it)
so this is the reason why I talked about why I tried this optimization.

In the future, if someone submits a similar patch we can give this issue to 
them.

--

___
Python tracker 

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



[issue42147] Micro optimization for longrange iteration if step is 1

2020-10-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

I will close this issue by tomorrow with rejected ;)

--

___
Python tracker 

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



[issue12737] str.title() is overzealous by upcasing combining marks inappropriately

2020-10-26 Thread Irit Katriel


Irit Katriel  added the comment:

You're right, I see that too when I don't tamper with the test.

--
components: +Library (Lib)

___
Python tracker 

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



[issue42154] Bad proxy returned immediately after BaseManager server restarted

2020-10-26 Thread john ryan


New submission from john ryan :

I am building an application that is made up of several separate processes, 
where each process is a python program. They are all started by the supervisord 
utility and execute within a venv running Python 3.8.5 (default, Aug 13 2020, 
15:42:06) [GCC 7.5.0] on linux, under Ubuntu 18.04.

I am using a multiprocessing BaseManager to implement a repository of queues. 
Each process asks for a queue by name then uses put/get on that queue.

The application needs to be resilient so it must be possible to restart the 
respository process and have the various client processes re-connect to the 
queues hosted by it.

The problem I am getting is that the first call to `get_queue()` after 
restarting the BaseManager server process does not return a queue.

The sequence below shows some testing by hand. (My test environment runs Ubuntu 
in a virtualbox hosted on Windows 8.1)

Here I started the server in a different terminal then started python as below 
(both pythons in the same venv).

This works as expected with the first call to get_queue returning a queue.
```
(hydra_env) john@u1804-VirtualBox:~/sw/code/hydra$ python
Python 3.8.5 (default, Aug 13 2020, 15:42:06) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing.managers import BaseManager
>>> class QueueManager(BaseManager): pass
... 
>>> QueueManager.register('get_queue')
>>> mgr = QueueManager(address=('localhost', 5), authkey=b'abracadabra' )
>>> mgr.connect()
>>> q = mgr.get_queue('name', 'src'); print(str(q))

>>> q = mgr.get_queue('name', 'src'); print(str(q))

```

Stop and restart the server to see the problem. The first call to get_queue 
seems to succeed but in fact it has failed as shown by the print(str...). The 
second call to get_queue succeeds.
```
>>> mgr.connect()
>>> q = mgr.get_queue('name', 'src'); print(str(q))

>>> q = mgr.get_queue('name', 'src'); print(str(q))

```

The server logs show it sent queues on all 4 calls
```
^C(hydra_env) john@u1804-VirtualBox:~/sw/code/hydra$ python 
../../trials/test_mgr.py 
starting
serving 
serving 
^C(hydra_env) john@u1804-VirtualBox:~/sw/code/hydra$ python 
../../trials/test_mgr.py 
starting
serving 
serving 
```

I get the same behaviour if I re-instantiate the local manager object

```
>>> mgr = QueueManager(address=('localhost', 5), authkey=b'abracadabra' )
>>> mgr.connect()
>>> q = mgr.get_queue('name', 'src'); print(str(q))

>>> q = mgr.get_queue('name', 'src'); print(str(q))

>>>
```

I even get the same behaviour if I just call `get_queue()` after restarting the 
server (ie without explicitly reconnecting).

I would have expected the first call to `get_queue()` to return a valid queue 
since neither it nor the call to `connect()` raised any kind of error.

It seems to me that there is some kind of state held that is the underlying 
cause of the issue. I did some investigating in  but I was not able to work out 
what was happening.

I found that it was possible to get into a state where a valid queue was never 
returned by `get_queue()` if an error had been raised by `get_nowait()` first.

Stop the server

```
>>> q.get_nowait()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in get_nowait
  File 
"/home/john/.pyenv/versions/3.8.5/lib/python3.8/multiprocessing/managers.py", 
line 835, in _callmethod
kind, result = conn.recv()
  File 
"/home/john/.pyenv/versions/3.8.5/lib/python3.8/multiprocessing/connection.py", 
line 250, in recv
buf = self._recv_bytes()
  File 
"/home/john/.pyenv/versions/3.8.5/lib/python3.8/multiprocessing/connection.py", 
line 414, in _recv_bytes
buf = self._recv(4)
  File 
"/home/john/.pyenv/versions/3.8.5/lib/python3.8/multiprocessing/connection.py", 
line 383, in _recv
raise EOFError
EOFError
```

Restart the server but do not call `get_queue()`

```
>>> q.get_nowait()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in get_nowait
  File 
"/home/john/.pyenv/versions/3.8.5/lib/python3.8/multiprocessing/managers.py", 
line 834, in _callmethod
conn.send((self._id, methodname, args, kwds))
  File 
"/home/john/.pyenv/versions/3.8.5/lib/python3.8/multiprocessing/connection.py", 
line 206, in send
self._send_bytes(_ForkingPickler.dumps(obj))
  File 
"/home/john/.pyenv/versions/3.8.5/lib/python3.8/multiprocessing/connection.py", 
line 411, in _send_bytes
self._send(header + buf)
  File 
"/home/john/.pyenv/versions/3.8.5/lib/python3.8/multiprocessing/connection.py", 
line 368, in _send
n = write(self._handle, buf)
BrokenPipeError: [Errno 32] Broken pipe
>>> q = mgr.get_queue('name', 'src'); print(str(q))

>>> q = mgr.get_queue('name', 'src'); print(str(q))

>>> q = mgr.get_queue('name', 'src'); print(str(q))

>>> q = mgr.get_queue('name', 'src'); print(str(q))

```

This continued while I was testing, but returned a queue some time later so was 
perhaps stuck on a timeout.


Python 3.9.0

[issue4297] Add error_log attribute to optparse.OptionParser

2020-10-26 Thread Irit Katriel


Irit Katriel  added the comment:

Following issue9938, argparse now offers a convenient way to handle errors. I 
propose to close this issue 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



[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError()

2020-10-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b510e101f8b5b31276bf97b921ca9247162881d2 by Serhiy Storchaka in 
branch 'master':
bpo-42152: Use PyDict_Contains and PyDict_SetDefault if appropriate. (GH-22986)
https://github.com/python/cpython/commit/b510e101f8b5b31276bf97b921ca9247162881d2


--

___
Python tracker 

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



[issue42097] Python 3.7.9 logging/threading/fork hang

2020-10-26 Thread Andrew de Quincey


Andrew de Quincey  added the comment:

Hi, sorry, I was ill on Friday, apologies for the delayed reply.

We're not using os.fork() directly, and I'm afraid the multiprocessing thing I 
mentioned was a bit of a red herring.

We're using a capped pool of threads to spawn subprocesses (using subprocess.*) 
and wait for them to complete.. so we'll do something like spawn max 6 threads, 
each of which will kick off a subprocess and stuff them in a list. Then in the 
main loop, we wait for one of the threads to complete and start a new one when 
it has done so. I don't _believe_ this should trigger the os.fork()/logging bug?

This all worked fine in 2.* and in 3.5. Its only in 3.7 that we have started to 
have this hanging problem.

Unfortunately the (production) environment that has the problem is currently 
running 3.7. We do have plans to upgrade to 3.8, but I can't just switch it.

--

___
Python tracker 

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



[issue42155] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-26 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Documentation says that parsedate_to_datetime() performs the same function as 
parsedata(), but on success returns a datetime.

parsedata() returns None when date cannot be parsed, but 
parsedate_to_datetime() raises TypeError.

>>> email.utils.parsedate("0")
>>> email.utils.parsedate_to_datetime("0")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/email/utils.py", line 198, in 
parsedate_to_datetime
*dtuple, tz = _parsedate_tz(data)
TypeError: cannot unpack non-iterable NoneType object

The other use case is passing None as arguments. Although it is not documented, 
but I seen the following code in wild:

parsedate(header.get('Date'))

parsedate() and parsedate_tz() accept None, but parsedate_to_datetime() does 
not.

--
components: Library (Lib), email
messages: 379661
nosy: barry, maxking, r.david.murray, serhiy.storchaka
priority: normal
severity: normal
status: open
title: email.utils.parsedate_to_datetime() should return None when date cannot 
be parsed
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



[issue21510] fma documentation should provide better example.

2020-10-26 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.1, Python 3.2, Python 
3.3, 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



[issue15339] document the threading "facts of life" in Python

2020-10-26 Thread Irit Katriel


Change by Irit Katriel :


--
priority: low -> normal
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.10, 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



[issue26954] Add Guido's rejection notice to the "with" FAQ

2020-10-26 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 
3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue42156] Currency not correct for all locales

2020-10-26 Thread Stefan Völkl

New submission from Stefan Völkl :

I found that the currency formatting does not work correctly for all locales. 
For example:

{{{
import locale

amount = 24.99
locale.setlocale(locale.LC_ALL, 'it_IT.UTF-8')

price = locale.currency(amount)

print(price)
}}}

returns "€ 24,99".
It should return "24,99 €", just like noted at 
http://publications.europa.eu/code/it/it-370303.htm
under "Posizione del simbolo (€) negli importi in cifre".

--
components: Library (Lib)
messages: 379662
nosy: GiftZwergrapper, lemburg
priority: normal
severity: normal
status: open
title: Currency not correct for all locales
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue42147] Micro optimization for longrange iteration if step is 1

2020-10-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

I close this issue with rejected status.
Thank you serhiy, pablogsal and Inada-san for discussion ;)

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

___
Python tracker 

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



[issue42156] Currency not correct for all locales

2020-10-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

What does locale.localeconv() return?

>>> locale.localeconv()
{'int_curr_symbol': '', 'currency_symbol': '', 'mon_decimal_point': '', 
'mon_thousands_sep': '', 'mon_grouping': [], 'positive_sign': '', 
'negative_sign': '', 'int_frac_digits': 127, 'frac_digits': 127, 
'p_cs_precedes': 127, 'p_sep_by_space': 127, 'n_cs_precedes': 127, 
'n_sep_by_space': 127, 'p_sign_posn': 127, 'n_sign_posn': 127, 'decimal_point': 
'.', 'thousands_sep': '', 'grouping': []}
>>>

In particular, the values of p_cs_precedes and n_cs_precedes.

--
nosy: +eric.smith

___
Python tracker 

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



[issue42156] Currency not correct for all locales

2020-10-26 Thread Stefan Völkl

Stefan Völkl  added the comment:

>>> locale.localeconv()
{'int_curr_symbol': 'EUR ', 'currency_symbol': '€', 'mon_decimal_point': ',', 
'mon_thousands_sep': '.', 'mon_grouping': [3, 3, 0], 'positive_sign': '', 
'negative_sign': '-', 'int_frac_digits': 2, 'frac_digits': 2, 'p_cs_precedes': 
1, 'p_sep_by_space': 1, 'n_cs_precedes': 1, 'n_sep_by_space': 1, 'p_sign_posn': 
1, 'n_sign_posn': 1, 'decimal_point': ',', 'thousands_sep': '.', 'grouping': 
[3, 3, 0]}

--

___
Python tracker 

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



[issue42156] Currency not correct for all locales

2020-10-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

p_cs_precedes == 1 means "the currency_symbol or int_curr_symbol strings should 
precede the value of a monetary amount", per 
https://www.gnu.org/software/libc/manual/html_node/Currency-Symbol.html (I 
couldn't find a more authoritative source, but I think this is okay).

So it looks like Python is following the rules correctly. I don't know how 
you'd adjust the locale values.

--

___
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-10-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 47e1afd2a1793b5818a16c41307a4ce976331649 by Victor Stinner in 
branch 'master':
bpo-1635741: _PyUnicode_Name_CAPI moves to internal C API (GH-22713)
https://github.com/python/cpython/commit/47e1afd2a1793b5818a16c41307a4ce976331649


--

___
Python tracker 

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



[issue42097] Python 3.7.9 logging/threading/fork hang

2020-10-26 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


Added file: https://bugs.python.org/file49531/test.py

___
Python tracker 

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



[issue42097] Python 3.7.9 logging/threading/fork hang

2020-10-26 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

(Restored test.py attachment)

The issue happens due to an incorrect usage of `multiprocessing.Pool`.

```
# Set up multiprocessing pool, initialising logging in each subprocess
with multiprocessing.Pool(initializer=process_setup, 
initargs=(get_queue(),)) as pl:
# 100 seems to work fine, 500 fails most of the time.
# If you're having trouble reproducing the error, try bumping this 
number up to 1000
pl.map(do_work, range(1))

if _globalListener is not None:
# Stop the listener and join the thread it runs on.
# If we don't do this, we may lose log messages when we exit.
_globalListener.stop()
```

Leaving `with` statement causes `pl.terminate()` [1, 2]
Since multiprocessing simply sends SIGTERM to all workers, a worker might be 
killed while it holds the cross-process lock guarding `_globalQueue`. In this 
case, `_globalListener.stop()` blocks forever trying to acquire that lock (to 
add a sentinel to `_globalQueue` to make a background thread stop monitoring 
it).

Consider using `Pool.close()` and `Pool.join()` to properly wait for task 
completion.

[1] 
https://docs.python.org/3.9/library/multiprocessing.html#multiprocessing.pool.Pool.terminate
[2] 
https://docs.python.org/3.9/library/multiprocessing.html#programming-guidelines

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



[issue42097] Python 3.7.9 logging/threading/fork hang

2020-10-26 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

By the way, I don't see a direct relation between `test.py` (which doesn't use 
`subprocess` directly) and your comment describing `subprocess` usage with 
threads. So if you think that the bug in `test.py` is unrelated to the problem 
you face, feel free to reopen.

--

___
Python tracker 

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



[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2020-10-26 Thread Felix C. Stegerman


Change by Felix C. Stegerman :


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

___
Python tracker 

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



[issue39706] unittest.IsolatedAsyncioTestCase hangs on asyncio.CancelledError

2020-10-26 Thread Lisa Roach


Change by Lisa Roach :


--
keywords: +patch
nosy: +lisroach
nosy_count: 3.0 -> 4.0
pull_requests: +21902
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22654

___
Python tracker 

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



[issue39101] IsolatedAsyncioTestCase freezes when exception is raised

2020-10-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +21903
pull_request: https://github.com/python/cpython/pull/22988

___
Python tracker 

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



[issue39706] unittest.IsolatedAsyncioTestCase hangs on asyncio.CancelledError

2020-10-26 Thread Lisa Roach


Change by Lisa Roach :


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



[issue39101] IsolatedAsyncioTestCase freezes when exception is raised

2020-10-26 Thread Lisa Roach


Lisa Roach  added the comment:


New changeset 8374d2ee1589791be8892b00f4bbf8121dde24bd by Lisa Roach in branch 
'master':
bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (GH-22654)
https://github.com/python/cpython/commit/8374d2ee1589791be8892b00f4bbf8121dde24bd


--

___
Python tracker 

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



[issue39101] IsolatedAsyncioTestCase freezes when exception is raised

2020-10-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21904
pull_request: https://github.com/python/cpython/pull/22989

___
Python tracker 

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



[issue39101] IsolatedAsyncioTestCase freezes when exception is raised

2020-10-26 Thread Lisa Roach


Change by Lisa Roach :


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



[issue42155] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-26 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

Hi Serhiy.  I believe this is a duplicate of bpo-30681 which is active and has 
a good PR IMHO.  The only hold up is whether to backport that PR to 3.9 and 
3.8.  See the bug and PR for details.

--
resolution:  -> duplicate
superseder:  -> email.utils.parsedate_to_datetime() should return None when 
date cannot be parsed

___
Python tracker 

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



[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2020-10-26 Thread Stefan Behnel


Stefan Behnel  added the comment:

The patch looks right. I'm not sure if this can still be changed in Py3.8, 
though, since that has been around for quite a while now.

Admittedly, few people will disable the C accelerator module and thus whitness 
this issue, but for them, this is a breaking change, and some code might rely 
on the current behaviour. I have no way to tell how much, and whether it 
intentionally relies on it.

I'd definitely change this for 3.9 and later. Maybe for 3.8, but it's at least 
a bit of a risk, given that there will only be very few more minor releases for 
it, and given that this is how things have been working for years. So, rather 
not, unless there is a convincing argument for backporting the change.

--
components: +XML -Library (Lib)
versions:  -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue42155] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-26 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


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



[issue38865] [subinterpreters] Can Py_Finalize() be called if the current interpreter is not the main interpreter?

2020-10-26 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


New submission from STINNER Victor :

Mohamed Koubaa and me are trying to convert the unicodedata module to the 
multi-phase initialization API (PEP 489) and to convert the UCD static type to 
a heap type in bpo-1635741.

The unicodedata extension module has some special cases:

* It has a C API exposes in Python as the "unicodedata.ucnhash_CAPI" PyCapsule 
object.
* In C, the unicodedata_functions array is used to define module functions 
*AND* unicodedata.UCD methods. It is unused to do that and makes the conversion 
more tricky.
* Most C functions have a "self" parameter which is used to choose between the 
current version of the Unicode database and the version 3.2.0 
("unicodedata.ucd_3_2_0").

There is also a unicodedata.UCD type which cannot be instanciated in Python. It 
is only used to create the unicodedata.ucd_3_2_0 instance.

In the commit 47e1afd2a1793b5818a16c41307a4ce976331649, I moved the private 
_PyUnicode_Name_CAPI structure to internal C API.

In the commit ddc0dd001a4224274ba6f83568b45a1dd88c6fc6, Mohammed added a 
ucd_type parameter to the UCD_Check() macro. I asked him to do that.

In the commit e6b8c5263a7fcf5b95d0fd4c900e5949eeb6630d, I added a "global 
module state" and a "state" parameter to most functions. This change prepares 
the code base to pass a UCD type instance to functions, to be able to have more 
than once UCD type when it will be converted to a heap type, one type per 
module instance.

The technical problem is that unicodedata_functions is used for module 
functions and UCD methods. Duplicating unicodedata_functions requires to 
duplicate a lot of code and comments.

Sadly, it does not seem easily possible to retrieve the "module state" ("state" 
variable) in functions since unicodedata_functions is reused for module 
functioins and UCD methods. Using "defining_class" in Argument Clinic would 
require to duplicate all unicodedata_functions functions, one flavor for module 
functions, one flavor for UCD type. It would also require to duplicate all 
docstrings, which means to increase the maintenance burden and introduce a risk 
of having inconsistencies.

Maybe we could introduce a new UCD instance which would be mapped to the 
current Unicode Character Database version, and module functions which be 
bounded methods of this type. But it sounds overkill to me.

By the way, Unicode 3.2 was released in 2002: 18 years ago. I don't think that 
it's still relevant in 2020 to keep backward compatibility with Unicode 3.2. I 
propose to deprecate unicodedata.ucd_3_2_0 and deprecate the unicodedate.UCD 
type. In Python 3.12, we will be able to remove a lot of code, and simplify the 
code a lot.

For now, we can convert unicodedata to the multi-phase initilization API (PEP 
489) and convert UCD static type to a heap type by avoiding references to the 
UCD type. Rather than checking if self is an instance of UCD_Type, we can check 
if it is not a module (PyModule_Check). This is exactly what Mohammed proposed 
in the first place, but I misunderstood the whole issue and gave him bad 
advices.

--
components: Library (Lib)
messages: 379673
nosy: vstinner
priority: normal
severity: normal
status: open
title: Cleanup the unicodedata module
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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

On 26.10.2020 18:05, STINNER Victor wrote:
> 
> By the way, Unicode 3.2 was released in 2002: 18 years ago. I don't think 
> that it's still relevant in 2020 to keep backward compatibility with Unicode 
> 3.2. I propose to deprecate unicodedata.ucd_3_2_0 and deprecate the 
> unicodedate.UCD type. In Python 3.12, we will be able to remove a lot of 
> code, and simplify the code a lot.

The version 3.2.0 is needed for IDNA compatibility:

IDNA 2003: https://tools.ietf.org/html/rfc3490
requires Unicode 3.2 mappings

IDNA 2008: https://tools.ietf.org/html/rfc5890 et al.
requires Unicode 5.2+ mappings

Python only supports IDNA 2003 AFAIK and the ucs_3_2_0 tag was added
by Martin von Löwis to support it even after moving forward to more
recent Unicode versions.

IDNA 2008 seems to have mechanisms to also work for Unicode versions
later than 5.2, but I don't know the details. See this TR for details
on how IDNA compatibility is handled:

http://www.unicode.org/reports/tr46/

All that said, it may actually be better to deprecate IDNA 2003 support
first and direct people to:

https://pypi.org/project/idna/

or incorporate this into the stdlib instead of IDNA 2003. The special
tag can then be dropped.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Experts (#1, Oct 26 2020)
>>> Python Projects, Coaching and Support ...https://www.egenix.com/
>>> Python Product Development ...https://consulting.egenix.com/


::: We implement business ideas - efficiently in both time and costs :::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   https://www.egenix.com/company/contact/
 https://www.malemburg.com/

--
nosy: +lemburg

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-10-26 Thread Miro Hrončok

Miro Hrončok  added the comment:

This also breaks pycurl:

https://github.com/pycurl/pycurl/pull/660

And breezy:

https://bugzilla.redhat.com/show_bug.cgi?id=1890880 (not yet reported upstream)


I don't understand the rationale for this change in depth, but does the benefit 
outweigh (yet another) backwards incompatibility?

--
nosy: +hroncok

___
Python tracker 

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



[issue42158] guess_format() MIME type doesn't guess n-quads, n-triples, notation3 and TriG

2020-10-26 Thread Dylan Van Assche


New submission from Dylan Van Assche :

guess_format() from lib/mimetypes.py doesn't guess correctly the following MIME 
types:

- .nq: application/n-quads (specification: https://www.w3.org/TR/n-quads/)
- .nt: application/n-triples (specification: https://www.w3.org/TR/n-triples/)
- .n3: text/n3 (specification: https://www.w3.org/TeamSubmission/n3/)
- .trig: application/trig (specification: https://www.w3.org/TR/trig/)

In these cases the default MIME type is returned: application/octet-stream

--
components: Library (Lib)
messages: 379676
nosy: DylanVanAssche
priority: normal
severity: normal
status: open
title: guess_format() MIME type doesn't guess n-quads, n-triples, notation3 and 
TriG
type: enhancement
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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42158] http.server doesn't guess n-quads, n-triples, notation3 and TriG MIME types

2020-10-26 Thread Dylan Van Assche


Change by Dylan Van Assche :


--
title: http.server MIME type doesn't guess n-quads, n-triples, notation3 and 
TriG MIME types -> http.server doesn't guess n-quads, n-triples, notation3 and 
TriG MIME types

___
Python tracker 

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



[issue42158] http.server MIME type doesn't guess n-quads, n-triples, notation3 and TriG MIME types

2020-10-26 Thread Dylan Van Assche


Change by Dylan Van Assche :


--
title: guess_format() MIME type doesn't guess n-quads, n-triples, notation3 and 
TriG -> http.server MIME type doesn't guess n-quads, n-triples, notation3 and 
TriG MIME types

___
Python tracker 

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



[issue42158] http.server doesn't guess n-quads, n-triples, notation3 and TriG MIME types

2020-10-26 Thread Dylan Van Assche


Dylan Van Assche  added the comment:

Adding the MIME types to /etc/mime.types fixes this issue, but I'm not sure if 
that's the right 'fix'

--

___
Python tracker 

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 920cb647ba23feab7987d0dac1bd63bfc2ffc4c0 by Victor Stinner in 
branch 'master':
bpo-42157: unicodedata avoids references to UCD_Type (GH-22990)
https://github.com/python/cpython/commit/920cb647ba23feab7987d0dac1bd63bfc2ffc4c0


--

___
Python tracker 

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21906
pull_request: https://github.com/python/cpython/pull/22991

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-10-26 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

> I don't understand the rationale for this change in depth, but
> does the benefit outweigh (yet another) backwards incompatibility?

I think you can have it both ways.  Do you want a C API that is
stable over a long period of CPython releases or do you want to
continue to be able to look deep (i.e. non opaque PyObject*) into
CPython implementation internals?

During the sprint last week, we talked about how to provide a
compatible API, similar to what Pypy cpyext does.  It would be
possible to provide a (nearly) fully compatible API with the
approach.  It could get quite painful for CPython to maintain such a
thing however.  E.g. cpyext has proxy objects (to maintain CPython
compatible structure layouts) but keeping those proxies in sync with
the internal VM object structures is expensive and tricky.

Certainly making PyObject opaque is going to break some 3rd party
code.  Making it opaque for the non-limited API is not an option
IMHO because it breaks too much 3rd party code.   Is making it
opaque for the limited C API going to break too much code?  Maybe, I
don't know.  Thanks for pointing out pycurl and breezy.

--

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-10-26 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

Correction: I think you *cannot* have it both ways.

--

___
Python tracker 

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



[issue42156] Currency not correct for all locales

2020-10-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

And just to show that python is doing the right thing, if the locale is set up 
correctly, I'll show the following hack:

>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'en_US')
'en_US'
>>> locale.currency(24.99)
'$24.99'
>>> locale._override_localeconv["p_cs_precedes"] = 0
>>> locale.currency(24.99)
'24.99$'

Notice the change from '$24.99' to '24.99$' when I change p_cs_precedes to 0.

WARNING: you really, really shouldn't use _override_localeconv. It looks like 
it exists just for testing, but I'm using it here to show that currency 
formatting does respect p_cs_precedes.

On the other hand, I've often wanted to build up a locale programmatically and 
then use it, so maybe we should support that use case.

--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-26 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

Ma Lin proposed this approach (PR 21740) for _PyBytesWriter/_PyUnicodeWriter on 
python-dev:
https://mail.python.org/archives/list/python-...@python.org/message/UMB52BEZCX424K5K2ZNPWV7ZTQAGYL53/

--
nosy: +vstinner

___
Python tracker 

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



[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

It would be interested to see if using _PyBytesWriter in bz2, lzma, zlib and 
_io.FileIO.readall() would speed up the code. I would prefer to centralize the 
buffer allocation logic in _PyBytesWriter rather than having custom code in 
each file. _PyBytesWriter is designed to reduce the number of realloc() by 
using overallocation, it uses a different overallocation ratio on Windows, and 
it uses a small buffer allocated on the stack for strings up to 512 bytes.

--

___
Python tracker 

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



[issue21510] fma documentation should provide better example.

2020-10-26 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I suggest using the text and example from the spec:
http://speleotrove.com/decimal/daops.html#reffma

=

fused-multiply-add takes three operands; the first two are multiplied together, 
using multiply, with sufficient precision and exponent range that the result is 
exact and unrounded.[4]  No flags are set by the multiplication unless one of 
the first two operands is a signaling NaN or one is a zero and the other is an 
infinity.
Unless the multiplication failed, the third operand is then added to the result 
of that multiplication, using add, under the current context.

In other words, fused-multiply-add(x, y, z) delivers a result which is (x × y) 
+ z with only the one, final, rounding.

Examples:

  fused-multiply-add(’3’, ’5’, ’7’)   ==>  ’22’
  fused-multiply-add(’3’, ’-5’, ’7’)  ==>  ’-8’
  fused-multiply-add(’888565290’, ’1557.96930’,
  ’-86087.7578’)  ==>  ’1.38435736E+12’
Note that the last example would have given the result ’1.38435735E+12’ if the 
operation had been carried out as a separate multiply followed by an add.

--
nosy: +rhettinger

___
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-10-26 Thread Diogo Dutra

Diogo Dutra  added the comment:

> Are you suggesting this is a bug, or is it just a suggested code cleanup?

It is a suggested code cleanup.

My point is that the code creates two sets based on the Sequence `fs`.
I think it is better if the code creates the set just one time, instead of
two times.

Em dom., 25 de out. de 2020 às 18:57, Chris Jerdonek 
escreveu:

>
> Chris Jerdonek  added the comment:
>
> Are you suggesting this is a bug, or is it just a suggested code cleanup?
> I ask because the docs suggest that a set should be passed:
> https://docs.python.org/3/library/asyncio-task.html#asyncio.wait
>
> And the docstring says it should be a sequence:
>
> https://github.com/python/cpython/blob/d1a0a960ee493262fb95a0f5b795b5b6d75cecb8/Lib/asyncio/tasks.py#L373-L376
>
> So while code cleanup is okay, I'm not sure support for general iterator
> arguments can / should be guaranteed.
>
> --
> nosy: +chris.jerdonek
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue42142] FAIL tkinter ttk LabeledScale test_resize, and more

2020-10-26 Thread E. Paine


E. Paine  added the comment:

This is strange as these only seem to have started occurring recently (though 
there hasn't been a change to the tests themselves in a long time). There must 
be something different about how Azure runs the GUI tests because it was on 
Azure that the tests on PR-22682 failed (noting that it was only on Azure they 
failed and all the Azure bots failed - suspicious). Is there someone we can 
nosy who would know better how Azure works (and hence why the possible 
difference)?

I am looking into both Azure and the tests themselves but am not really sure 
how to check if they pass without a messy commit history.

--
nosy: +epaine

___
Python tracker 

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



[issue42159] AsyncMock restores stopped patch if same object stopped multiple times

2020-10-26 Thread Lisa Roach


New submission from Lisa Roach :

Hard to explain in the title, easier to see via a test case:

 async def async_func():
 raise Exception

def test_simultaneous_mocks(self):
class Test(IsolatedAsyncioTestCase):
async def test_test(self):
patcher1 = patch(f"{__name__}.async_func")
patcher2 = patch(f"{__name__}.async_func")
patcher1.start()
await async_func()
patcher2.start()
await async_func()
patcher1.stop()
with self.assertRaises(Exception):
await async_func()
patcher2.stop()
with self.assertRaises(Exception): # Fails, mock is restored!
await async_func()

test = Test("test_test")
output = test.run()
self.assertTrue(output.wasSuccessful()) # Fail


Calling stop() on the second patch actually restores the mock and causes the 
test to fail.

--
assignee: lisroach
messages: 379687
nosy: lisroach
priority: normal
severity: normal
status: open
title: AsyncMock restores stopped patch if same object stopped multiple times
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



[issue42160] unnecessary overhead in tempfile

2020-10-26 Thread Eric Wolf


Change by Eric Wolf :


--
components: Library (Lib)
nosy: Deric-W
priority: normal
severity: normal
status: open
title: unnecessary overhead in tempfile
type: enhancement
versions: 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



[issue42160] unnecessary overhead in tempfile

2020-10-26 Thread Eric Wolf


New submission from Eric Wolf :

The tempfile module contains the class _RandomNameSequence, which has the rng 
property.
This property checks os.getpid() every time and re-initializes a random number 
generator when it has changed.
However, this is only necessary on systems which allow the process to be cloned 
and should be solved on such systems with os.register_at_fork (see the random 
module).

--

___
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-10-26 Thread Justin Arthur


Justin Arthur  added the comment:

Your change makes perfect sense to me. It would be a backport-only change as 
the 2nd set creation is actually getting removed for the development version 
(3.10) to finalize the deprecation of wait's coroutine scheduling.

--
nosy: +JustinTArthur

___
Python tracker 

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



[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2020-10-26 Thread Pascal Chambon


Pascal Chambon  added the comment:

The latest doc has a quick mention about the fact that daemon is not used in 
the Unix sens, so it seems fine now  B-)

https://docs.python.org/3/library/multiprocessing.html?#multiprocessing.Process.daemon

"""Additionally, these are not Unix daemons or services, they are normal 
processes that will be terminated (and not joined) if non-daemonic processes 
have exited."""

My paragraph was just my one attempt at distinguishing concepts, it was never 
part of the official docs

--

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


New submission from STINNER Victor :

In bpo-38858, I made the small integer singletons per interpreter: commit 
630c8df5cf126594f8c1c4579c1888ca80a29d59. _PyLong_Zero and _PyLong_One 
variables are still shared by all interpreters, whereas subinterpreters must 
not share Python objects: see bpo-40533.

I propose to add new _PyLong_GetZero() and _PyLong_GetOne() functions to 
replace _PyLong_Zero and _PyLong_One variables. These functions will retrieve 
the singletons from tstate->interp->small_ints.

--
components: Interpreter Core
messages: 379691
nosy: vstinner
priority: normal
severity: normal
status: open
title: Remove private _PyLong_Zero and _PyLong_One variables
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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42162] The license page for Python 3.0 is messed up

2020-10-26 Thread MaT1g3R


New submission from MaT1g3R :

Page in question: https://docs.python.org/3.0/license.html

The page still shows up in web searches (this is how I found the error)

I tracked down the error to this commit, but I couldn't find a relevant branch 
to fix it: 4ca04b67f00edabe86072446f059adcb70eafcdd

--
assignee: docs@python
components: Documentation
messages: 379692
nosy: MaT1g3R, docs@python
priority: normal
severity: normal
status: open
title: The license page for Python 3.0 is messed up
type: behavior

___
Python tracker 

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c8c4200b65b2159bbb13cee10d67dfb3676fef26 by Victor Stinner in 
branch 'master':
bpo-42157: Convert unicodedata.UCD to heap type (GH-22991)
https://github.com/python/cpython/commit/c8c4200b65b2159bbb13cee10d67dfb3676fef26


--

___
Python tracker 

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



[issue42163] _replace() no longer works on platform.uname_result objects

2020-10-26 Thread Chandan Singh


New submission from Chandan Singh :

Starting from Python 3.9, it seems like the `_replace()` method no longer  
works on `platform.uname_result` objects, that are returned by
`platform.uname()`. A simple example can be seen below, which works on Python 
3.8, but not on Python 3.9.

```
>>> import platform
>>> result = platform.uname()
>>> result._replace(machine="x86_64")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.9/collections/__init__.py", line 448, in _replace
result = self._make(_map(kwds.pop, field_names, self))
  File "/usr/local/lib/python3.9/collections/__init__.py", line 441, in _make
raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
TypeError: Expected 5 arguments, got 6
```

I'm not sure if this is an intended change or an uninteded side-effect. The 
`_replace` method does work on simple namedtuple objects, and `uname_result` 
claims to be:

> largely compatible with a simple namedtumple` object except that 'platform' 
> is resolved late and cached to avoid calling "uname" except when needed`

This late resolution is what's new in Python 3.9 and also the source of the 
issue  as far as I can tell. I suppose the answer may depend on how braod our 
definition of  "largely compatible" is.

For some context, we use `_replace` in the tests of our BuildStream project, 
which is why we ran into this. The fix is reasonably simple on our end by 
changing how we mock some bits. But I wanted to check here if it's considered a 
bug or not. For reference, this is the patch we neded on our end: 
https://gitlab.com/BuildStream/buildstream/-/merge_requests/2092.

--
components: Library (Lib)
messages: 379694
nosy: cs-shadow
priority: normal
severity: normal
status: open
title: _replace() no longer works on platform.uname_result objects
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



[issue42142] FAIL tkinter ttk LabeledScale test_resize, and more

2020-10-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Steve, we have a new Pipelines-specific intermittent tkinter test failure.  Are 
you familiar with Pipelines, or do you know who is?

--
nosy: +steve.dower

___
Python tracker 

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21908
pull_request: https://github.com/python/cpython/pull/22994

___
Python tracker 

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread Pablo Galindo Salgado

New submission from Pablo Galindo Salgado :

I have been trying to diagnose this failure:

https://buildbot.python.org/all/#/builders/271/builds/710/steps/3/logs/stdio

it happens on these buildbots:

x86_64 fedora stable
ppc64le fedora stable (so 32 now)

It seems that CPython cannot be compiled with --with-lto regardless of the 
version:

https://buildbot.python.org/all/#/builders/336/builds/2145
https://buildbot.python.org/all/#/builders/426/builds/641
https://buildbot.python.org/all/#/builders/294/builds/986

This seems to indicate that something has changed in these buildbots somehow. 
Maybe the gcc installation is broken?

In my investigation, it seems that Python/compile.o is miscompiled.For example

FEDORA BUILDBOT with LTO:

[buildbot@python-builder2-rawhide cpython]$ nm Python/compile.o  | grep 
_Py_Mangle
In function ‘assemble_lnotab’,
inlined from ‘assemble_emit’ at Python/compile.c:5696:25,
inlined from ‘assemble’ at Python/compile.c:6038:18:
Python/compile.c:5650:19: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
 5650 | *lnotab++ = k;
  |   ^
 U _Py_Mangle


MY ARCH LINUX SYSTEM:

❯ nm Python/compile.o  | grep _Py_Mangle
 T _Py_Mangle

It seems that the _Py_Mangle is not included in the object file. Is this a gcc 
bug? I have not been able to diagnose exactly where does this problem. It seems 
that the gcc version is "10.2.1" but I can correctly build CPython with LTO in 
my arch Linux machine with gcc 10.2.0.

Given that these are stable buildbots, could you investigate what is going on 
or report this to the gcc folks ar RedHat/Fedora? 



More interesting data:

Compiling with -O0 does not have a problem, but doing it with -O3 does.

With -O0:

[buildbot@python-builder2-rawhide cpython]$ nm Python/compile.o  | grep 
_Py_Mangle
 T _Py_Mangle

With -O3:

[buildbot@python-builder2-rawhide cpython]$ nm Python/compile.o  | grep 
_Py_Mangle
 U _Py_Mangle

--
components: Build
messages: 379696
nosy: cstratak, hroncok, pablogsal, petr.viktorin, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Python fails to compile in the Fedora Stable LTO buildbots
type: compile error
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



[issue42123] Run parser twice; enable invalid_* rules only on the second run

2020-10-26 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

We do not have a big corpus of SyntaxErrors to test against, but some manual 
testing of running a file with a SyntaxError after a long complex line 1000 
times shows no slowdown.

We keep the token stream for the second run, so we don't need to run the 
tokenizer all over again and the parsing is done much more quickly.

--

___
Python tracker 

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



[issue42123] Run parser twice; enable invalid_* rules only on the second run

2020-10-26 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:


New changeset bca701403253379409dece03053dbd739c0bd059 by Lysandros Nikolaou in 
branch 'master':
bpo-42123: Run the parser two times and only enable invalid rules on the second 
run (GH-22111)
https://github.com/python/cpython/commit/bca701403253379409dece03053dbd739c0bd059


--

___
Python tracker 

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



[issue42123] Run parser twice; enable invalid_* rules only on the second run

2020-10-26 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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



[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2020-10-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue41659] PEG discrepancy on 'if {x} {a}: pass'

2020-10-26 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests:  -21195

___
Python tracker 

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> By the way, Unicode 3.2 was released in 2002: 18 years ago. I don't think 
> that it's still relevant in 2020 to keep backward compatibility with Unicode 
> 3.2. I propose to deprecate unicodedata.ucd_3_2_0 and deprecate the 
> unicodedate.UCD type. In Python 3.12, we will be able to remove a lot of 
> code, and simplify the code a lot.

Oh, it is used by the IDNA encoding (encodings.idna module) and the stringprep 
module (which is used by the encodings.idna module.

--

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8e3b9f92835654943bb59d9658bb52e1b0f40a22 by Victor Stinner in 
branch 'master':
bpo-42161: Add _PyLong_GetZero() and _PyLong_GetOne() (GH-22993)
https://github.com/python/cpython/commit/8e3b9f92835654943bb59d9658bb52e1b0f40a22


--

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21909
pull_request: https://github.com/python/cpython/pull/22995

___
Python tracker 

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



[issue41659] PEG discrepancy on 'if {x} {a}: pass'

2020-10-26 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +21910
pull_request: https://github.com/python/cpython/pull/22996

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> I have been trying to diagnose this failure:
> https://buildbot.python.org/all/#/builders/271/builds/710/steps/3/logs/stdio

This is the "AMD64 Fedora Stable LTO 3.x" worker. The latest successful build 
was build 684, finished 6 days ago. test.pythoninfo of build 684:

CC.version: gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
platform.libc_ver: glibc 2.31
platform.platform: Linux-5.8.14-200.fc32.x86_64-x86_64-with-glibc2.31
sys.version: 3.10.0a1+ (heads/master:c0f22fb8b3, Oct 21 2020, 00:02:36)  [GCC 
10.2.1 20200723 (Red Hat 10.2.1-1)]
sysconfig[CCSHARED]: -fPIC
sysconfig[CC]: gcc -pthread
sysconfig[CFLAGS]: -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall
sysconfig[OPT]: -DNDEBUG -g -fwrapv -O3 -Wall
sysconfig[PY_CFLAGS]: -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall
sysconfig[PY_CFLAGS_NODIST]: -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal
sysconfig[PY_CORE_LDFLAGS]: -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g
sysconfig[PY_LDFLAGS_NODIST]: -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g
sysconfig[PY_STDMODULE_CFLAGS]: -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal 
-I. -I./Include


It started to fail at October 21 (build 685). At 2020-10-21, GCC package was 
upgraded from version 10.2.1-1 to 10.2.1-5 to gcc-10.2.1-5 according to 
/var/log/dnf.log:

2020-10-21T06:58:01-0400 SUBDEBUG drpm: spawned 2243855: /usr/bin/applydeltarpm 
-a x86_64 
/var/cache/dnf/updates-b3cb4614b6495970/packages/gcc-10.2.1-1.fc32_10.2.1-5.fc32.x86_64.drpm
 /var/cache/dnf/updates-b3cb4614b6495970/packages/gcc-10.2.1-5.fc32.x86_64.rpm

Package changelog between 10.2.1-1 and 10.2.1-5:
---
* Mon Oct 05 2020 Jakub Jelinek  10.2.1-5
- update from releases/gcc-10 branch
  - PRs bootstrap/97163, bootstrap/97183, c++/96994, c++/97145, c++/97195,
fortran/93423, fortran/95614, fortran/96041, gcov-profile/64636,
gcov-profile/96913, gcov-profile/97069, gcov-profile/97193,
libstdc++/94160, libstdc++/94681, libstdc++/96803, libstdc++/97101,
libstdc++/97167, middle-end/95464, middle-end/97054, middle-end/97073,
preprocessor/96935, target/71233, target/96683, target/96795,
target/96827, target/97166, target/97184, target/97231, target/97247,
tree-optimization/96979, tree-optimization/97053

* Wed Sep 16 2020 Jakub Jelinek  10.2.1-4
- update from releases/gcc-10 branch
  - PRs bootstrap/96203, c++/95164, c++/96862, c++/96901, d/96157, d/96924,
debug/93865, debug/94235, debug/96729, fortran/94690, fortran/95109,
fortran/95398, fortran/95882, fortran/96859, libstdc++/71960,
libstdc++/92978, libstdc++/96766, libstdc++/96851, lto/94311,
middle-end/87256, middle-end/96369, target/85830, target/94538,
target/96357, target/96551, target/96574, target/96744, target/96808,
target/97028, tree-optimization/88240, tree-optimization/96349,
tree-optimization/96370, tree-optimization/96514,
tree-optimization/96522, tree-optimization/96579,
tree-optimization/96597, tree-optimization/96820,
tree-optimization/96854, tree-optimization/97043
- fix up ARM target attribute/pragma handling (#1875814, PR target/96939)
- don't ICE on sp clobbers with -mincoming-stack-boundary=2 on ia32
  (#1862029, PR target/97032)

* Wed Aug 26 2020 Jakub Jelinek  10.2.1-3
- update from releases/gcc-10 branch
  - PRs c++/95428, c++/96082, c++/96106, c++/96164, c++/96199, c++/96497,
c/96545, c/96549, c/96571, d/96250, d/96254, d/96301, debug/96354,
fortran/93553, fortran/96312, fortran/96486, ipa/95320, ipa/96291,
ipa/96482, libstdc++/89760, libstdc++/95749, libstdc++/96303,
libstdc++/96484, libstdc++/96718, lto/95362, lto/95548,
middle-end/96426, middle-end/96459, target/93897, target/95450,
target/96191, target/96243, target/96446, target/96493, target/96506,
target/96525, target/96530, target/96536, target/96562, target/96682,
tree-optimization/96483, tree-optimization/96535,
tree-optimization/96722, tree-optimization/96730,
tree-optimization/96758
- mangle some further symbols needed for debug info during early dwarf
  (#1862029, PR debug/96690)
- during %check perform tests whether annobin is usable with the newly built
  compiler or whether it might need to be rebuilt
- disable graphite for ELN

* Tue Aug 04 2020 Jakub Jelinek  10.2.1-2
- update from releases/gcc-10 branch
  - PRs c++/95591, c++/95599, c++/

[issue42142] FAIL tkinter ttk LabeledScale test_resize, and more

2020-10-26 Thread Steve Dower


Steve Dower  added the comment:

I'm as familiar as anyone else that I'll be able to find, but I've really got 
no way to explain why the window isn't becoming visible.

Is it possible that it's trying to default to the process's nShowCmd value 
instead of a constant "normal" window size? That would seem most likely - 
nearly every issue we've had along these lines in the past have been some form 
of inherited process-wide setting.

The other possibility is if the screen size is so small that the window is 
being put outside of the bounds, and then the visibility test being used is one 
that checks whether its bounds are within the current monitor. That may also 
get a false negative in some non-interactive cases.

(I'm assuming, based on two examples, that they're all timing out at the 
"wait_visibility" call.)

--

___
Python tracker 

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

I reproduced the bug on Fedora 32 with gcc-10.2.1-6.fc32.x86_64 (new) but I 
failed to reproduce with gcc-10.2.1-1.fc32.x86_64 (old, before I upgraded GCC). 
So it's a regression of gcc-10.2.1-6.fc32.x86_64 package.

The package contains multiple downstream patches:

   https://src.fedoraproject.org/rpms/gcc/tree/f32

Commands used to reproduce the issue:

   export MAKEFLAGS=-j10
   ./configure --with-lto 
   make

Extract of my Makefile:

OPT=-DNDEBUG -g -fwrapv -O3 -Wall
BASECFLAGS=  -Wno-unused-result -Wsign-compare
CONFIGURE_CFLAGS_NODIST= -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -fvisibility=hidden
CONFIGURE_LDFLAGS_NODIST= -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g

--

___
Python tracker 

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



[issue42160] unnecessary overhead in tempfile

2020-10-26 Thread Eric Wolf


Change by Eric Wolf :


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

___
Python tracker 

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

With LTO, compile.o requires an undefined _Py_Mangle symbol:

$ gcc -pthread -c -DNDEBUG -fwrapv -O3 -std=c99 -fvisibility=hidden -flto 
-I./Include/internal  -I. -I./Include -DPy_BUILD_CORE -o Python/compile.o 
Python/compile.c; nm Python/compile.o | grep _Py_Mangle

 U _Py_Mangle


Without LTO, compile.o defines _Py_Mangle symbol:

$ gcc -pthread -c -DNDEBUG -fwrapv -O3 -std=c99 -fvisibility=hidden 
-I./Include/internal  -I. -I./Include -DPy_BUILD_CORE -o Python/compile.o 
Python/compile.c; nm Python/compile.o | grep _Py_Mangle

3c20 T _Py_Mangle

--

___
Python tracker 

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> With LTO, compile.o requires an undefined _Py_Mangle symbol:


Yeah, now try to compile with LTO and CFLAGS='-O0'

--

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset 303aac8c56609290e122eecc14c038e9b1e4174a by Georges Toth in 
branch 'master':
bpo-30681: Support invalid date format or value in email Date header (GH-22090)
https://github.com/python/cpython/commit/303aac8c56609290e122eecc14c038e9b1e4174a


--
nosy: +miss-islington

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-26 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> Yeah, now try to compile with LTO and CFLAGS='-O0'

Using LTO:

* "-O1 -finline-functions -finline-small-functions -fpartial-inlining" 
reproduces the issue.
* "-O1" does not reproduce the issue.

--

___
Python tracker 

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

I reported the issue to Fedora: 
https://bugzilla.redhat.com/show_bug.cgi?id=1891657

--

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c9bc290dd6e3994a4ead2a224178bcba86f0c0e4 by Victor Stinner in 
branch 'master':
bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (GH-22995)
https://github.com/python/cpython/commit/c9bc290dd6e3994a4ead2a224178bcba86f0c0e4


--

___
Python tracker 

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



[issue42160] unnecessary overhead in tempfile

2020-10-26 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Wouldn't it be simpler to use random.SystemRandom instead?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21913
pull_request: https://github.com/python/cpython/pull/22998

___
Python tracker 

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



[issue35061] Specify libffi.so soname for ctypes

2020-10-26 Thread Yongkwan Kim


Yongkwan Kim  added the comment:

My solution is creating link of libffi.so.6 as .5 This is for anyone who has 
same issue with me.
But thanks for your kind reply though.

--

___
Python tracker 

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



[issue38980] Compile libpython with -fno-semantic-interposition

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

Since Fedora and RHEL build Python with -fno-semantic-interposition, we did not 
get any user bug report about the LD_PRELOAD use case. IMO we can safely 
consider that no user rely on LD_PRELOAD to override libpython symbols.

Thanks for implementing the feature Pablo and Petr!

--

___
Python tracker 

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



  1   2   >