[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-20 Thread Greg Price


Greg Price  added the comment:

(A bit easy to miss in the way this thread gets displayed, so to highlight in a 
comment: GH-15265 is up, following the 5 other patches which have now all been 
merged.  That's the one that replaces the length-18 tuples with a dataclass.)

--

___
Python tracker 

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



[issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore

2019-08-20 Thread miss-islington


miss-islington  added the comment:


New changeset 198a0d622a696a4c234aa7866d6c15e38839cc76 by Miss Islington (bot) 
in branch '2.7':
bpo-35518: Skip test that relies on a deceased network service. (GH-15349)
https://github.com/python/cpython/commit/198a0d622a696a4c234aa7866d6c15e38839cc76


--

___
Python tracker 

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



[issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore

2019-08-20 Thread miss-islington


miss-islington  added the comment:


New changeset b9d88e771238b5098842cad8a6ad624621f3f62e by Miss Islington (bot) 
in branch '3.7':
bpo-35518: Skip test that relies on a deceased network service. (GH-15349)
https://github.com/python/cpython/commit/b9d88e771238b5098842cad8a6ad624621f3f62e


--

___
Python tracker 

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



[issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore

2019-08-20 Thread miss-islington


miss-islington  added the comment:


New changeset 44f2c096804e8e3adc09400a59ef9c9ae843f339 by Miss Islington (bot) 
in branch '3.8':
bpo-35518: Skip test that relies on a deceased network service. (GH-15349)
https://github.com/python/cpython/commit/44f2c096804e8e3adc09400a59ef9c9ae843f339


--
nosy: +miss-islington

___
Python tracker 

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



[issue31461] IDLE: Enhance module browser

2019-08-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#37902 Add mousewheel scrolling.

--
dependencies: +Add scrolling for IDLE browsers

___
Python tracker 

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



[issue37902] Add scrolling for IDLE browsers

2019-08-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#31461 is the index issue for class browser.  Mousewheel scrolling was listed 
without an issue.  Now there is, and this has been added as a dependency.

--

___
Python tracker 

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



[issue37902] Add scrolling for IDLE browsers

2019-08-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I agree.  We added mousewheel scrolling to editor just over a year ago and 
later added it to text views.  But for the browsers, I want to factor out the 
common code.  It is a bit tricky since the 3 major systems each send different 
events for the same action, and macOS has the opposite convention for how the 
text moves when pushing the wheel up.

--
stage:  -> needs patch

___
Python tracker 

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



[issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore

2019-08-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15065
pull_request: https://github.com/python/cpython/pull/15351

___
Python tracker 

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



[issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore

2019-08-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15066
pull_request: https://github.com/python/cpython/pull/15352

___
Python tracker 

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



[issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore

2019-08-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15064
pull_request: https://github.com/python/cpython/pull/15350

___
Python tracker 

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



[issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore

2019-08-20 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 5b95a1507e349da5adae6d2ab57deac3bdd12f15 by Benjamin Peterson 
(Greg Price) in branch 'master':
bpo-35518: Skip test that relies on a deceased network service. (GH-15349)
https://github.com/python/cpython/commit/5b95a1507e349da5adae6d2ab57deac3bdd12f15


--

___
Python tracker 

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



[issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore

2019-08-20 Thread Greg Price


Greg Price  added the comment:

I ran across this test when looking at especially slow files in the test suite: 
it turns out that not only is this service currently down, but the 
snakebite.net domain still exists, and as a result the test can end up waiting 
20-30s before learning that the hosts can't be found and the test gets skipped.

I agree with Benjamin's and Victor's comments -- the best solution would be to 
recreate the test, ideally as something that anyone (anyone with Docker 
installed, perhaps?) can just run locally.

For now I've just sent GH-15349 as a one-line fix to skip the test, with a 
remark pointing at this issue. It's already getting skipped 100% of the time 
thanks to the handy `support.transient_internet` mechanism -- this just makes 
the skip (a) explicit in the source code, and (b) a lot faster. :-)

--
nosy: +Greg Price

___
Python tracker 

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



[issue35518] test_timeout uses blackhole.snakebite.net domain which doesn't exist anymore

2019-08-20 Thread Greg Price


Change by Greg Price :


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

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-08-20 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Additional logging on failures is always welcome.  Might I suggest that, in 
this case, regrtest treats this action as a hard fail so as to not got lost in 
the other transient failures (test_asyncio).

By that I mean, either to not re-run, or to still be "failed" even after a 
successful re-run as this test_concurrent mishap is rare enough that I doubt it 
would happen twice in one build.

Now for a brain dump.

The process tree at this time:

python.exe (buildbot)
. cmd.exe (test step)
.. python_d.exe (regrtest main)
... typepref.exe (load)
... 
 typepref.exe (load for test_concurrent_futures)
 python_d.exe (multiprocessing pool)
 python_d.exe (multiprocessing pool)
 python_d.exe (multiprocessing pool)
 python_d.exe (multiprocessing pool)
 python_d.exe (multiprocessing pool)


1. To see how process termination played out, I killed the main regrtest 
process.  This did not let the buildbot complete, but just sit there without 
any output.  Also the typepref.exe process (and the failed multiprocessing pool 
processes) still lingered.

2. I then terminated the children* of the already terminated process.  No 
change to the buildbot.

 [*] Windows doesn't really have the concept of a process tree

3. I then terminated the final typepref.exe process.  The buildbot finally 
finished its test step.

Given that typepref.exe also prevents completion, I believe the problem is in 
how we are spawning subprocesses.  Maybe a process handle is being inherited by 
the spawned processes preventing it from fully terminating?

I mention the process handle as it was listed as an open handle in Process 
Explorer for the regrtest process even though it had been terminated prior.

--
nosy: +eryksun

___
Python tracker 

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



[issue29427] Option to skip padding for base64 urlsafe encoding/decoding

2019-08-20 Thread Franklin Yu


Change by Franklin Yu :


--
nosy: +Franklin Yu

___
Python tracker 

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



[issue37901] 21 tests fail when run on an IPv6-only host

2019-08-20 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vstinner

___
Python tracker 

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



[issue37902] Add scrolling for IDLE browsers

2019-08-20 Thread George Zhang


New submission from George Zhang :

I've just started using IDLE's module/path browsers and they offer a lot! 
Putting aside the issue of them opening in separate windows, they have a small 
change that could be made to improve them.

Both browsers have scrollbars, but (for me at least) I cannot scroll using my 
mouse. I propose adding support for scrolling similar to the editor/shell 
windows.

--
assignee: terry.reedy
components: IDLE
messages: 350043
nosy: GeeVye, terry.reedy
priority: normal
severity: normal
status: open
title: Add scrolling for IDLE browsers
type: enhancement
versions: 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



[issue37890] Modernize several tests in test_importlib

2019-08-20 Thread Kyle Stanley


Kyle Stanley  added the comment:

> This might be a decent way to prevent the AttributeErrors, but still allows 
> for differentiation of actual None values

Another alternative solution might be to use hasattr() before getattr(), if it 
is not desirable for test_pkg_import.py to raise exceptions:

```
 self.assertTrue(hasattr(module, var), msg=f"{module} should have attribute 
{var}")
 self.assertEqual(getattr(module, var), 1)
```

That would follow more of a LBYL style, but I know that EAFP is more common 
within Python. The better alternative depends on the answer to my earlier 
question regarding exceptions being raised from the unit tests:

> Is there a particular preference in the context of Python's tests?

--

___
Python tracker 

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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Tim Peters


Tim Peters  added the comment:

I don't have a problem with the trivial ring - I wasn't being that high-minded 
;-)  I was testing a different inverse algorithm, and in the absence of errors 
checked that

minv(a, m) * a % m == 1

for various a and m >= 0.  Of course that failed using pow(a, -1, m) instead 
when m=1.  Offhand, I couldn't imagine a plausible use case for finding an 
inverse mod 1 - and still can't ;-)  In abstract algebra, sure - but for 
concrete numerical computation?  Oh well.

In any case, testing

(minv(a, m) * a - 1) % m == 0

instead appears to work for all non-error cases.

--

___
Python tracker 

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



[issue37890] Modernize several tests in test_importlib

2019-08-20 Thread Kyle Stanley


Kyle Stanley  added the comment:

Ah okay, I wasn't sure what exactly would be involved with the "modernization" 
process, so those points were just rough ideas more than anything. I haven't 
started working on anything yet since I figured it'd be worthwhile to wait for 
approval first.

> 1) __import__() can be used for purpose. I would not change this.

Okay, I'll keep that part as is then. This idea was primarily based on 
importlib's documentation:

"Programmatic importing of modules should use import_module() instead of 
[importlib.__import__()]" 

But that probably applies more to users of importlib, rather than the internal 
tests for it. That would make sense.

3) How would you distinguish the case when the module have an attribute with 
the value is None and when it does not have the attribute at all? This 
information would lost with your change.

Good point. This might be a decent way to prevent the AttributeErrors, but 
still allows for differentiation of actual None values:

```
try:
self.assertEqual(getattr(module, var), 1)
except AttributeError:
self.fail(f"{module} should have attribute {var}")
```

Personally I think it makes a bit more sense to use self.fail() with a helpful 
message rather than raising errors within the tests. There's a comment on line 
56, "# self.fail() ?", which gave me this idea. Is there a particular 
preference in the context of Python's tests?

Also, do either of you (or anyone else) have any ideas for other modernization 
improvements that could be made to either test_pkg_import.py or to the other 
two? In the meantime, I can start working on ideas (2) and (4) if those ones 
would be appropriate. (2) should be fairly straightforward, but (4) will 
probably be a bit more subjective.

--

___
Python tracker 

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



[issue34690] Store startup modules as C structures for 20%+ startup speed improvement

2019-08-20 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue37901] 21 tests fail when run on an IPv6-only host

2019-08-20 Thread Gregory P. Smith


New submission from Gregory P. Smith :

21 tests failed:
test_asynchat test_asyncore test_docxmlrpc test_eintr test_epoll
test_ftplib test_httplib test_imaplib
test_multiprocessing_forkserver test_multiprocessing_spawn
test_nntplib test_os test_poplib test_robotparser test_smtplib
test_socket test_ssl test_support test_telnetlib
test_urllib2_localnet test_wsgiref

This is a rollup tracking issue.  I've got an IPv6-only future buildbot host 
with which to run an diagnose these for fixes.  Of note there is no IPv4 
localhost.

If there are larger problems I may spawn child bugs for specific issues off of 
this one.  (I already filed separate issues about 5 other tests that hang 
rather than fail)

--
assignee: gregory.p.smith
components: Tests
messages: 350039
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: 21 tests fail when run on an IPv6-only host
type: behavior
versions: 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



[issue37900] [urllib] proxy_bypass_registry doesn't handle invalid proxy override values

2019-08-20 Thread Kevin Wojniak


New submission from Kevin Wojniak :

proxy_bypass_registry() will split the ProxyOverride registry key by semicolon. 
Then for each value it uses that value as a regular expression pattern with 
match(). However, if this value is not a valid regular expression, then match() 
will throw an exception that goes uncaught. This then breaks the loop and 
prevents the function from working correctly on other valid input.

It's easy to reproduce:

1. Set this registry key to 1 
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet 
Settings\ProxyEnable
2. Set HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet 
Settings\ProxyOverride to this value (create as a string if necessary):
[]-78;
3. Call urllib.proxy_bypass()

My suggestion for a fix would be to catch exceptions from match() in the loop 
and continue the loop on error.

--
components: Windows
messages: 350038
nosy: kwojniak_box, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [urllib] proxy_bypass_registry doesn't handle invalid proxy override 
values
type: crash
versions: Python 2.7, Python 3.7

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Please give Niel a chance to submit wording, even a post here on the tracker 
will be fine.  We usually defer to the person who actually encountered the 
issue.  

If after a week or so, there is no response, you can pick this up.  Try to be 
minimal with it and avoid the temptation to go gonzo.  The "from" part of 
exception semantics is one of its most minor and easily ignored features.  
Accordingly, it should get minimal space in the tutorial and probably doesn't 
even warrant an example if a simple, clear sentence will suffice.

--

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Srinivas Nyayapati


Srinivas Nyayapati  added the comment:

In case Niels Albers is not interested, can I submit a PR?
I noticed the linked raise reference documentation from the tutorial having 
details on exception chaining 
(https://docs.python.org/3.7/reference/simple_stmts.html#raise). Does it make 
sense to mention exception chaining in the tutorial and say "read details in 
the reference docs"? Or as you mentioned.. just write a short paragraph on 
exception chaining and give an example in the tutorial?

--
nosy: +shireenrao

___
Python tracker 

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



[issue37899] test_xmlrpc hangs on an IPv6-only host

2019-08-20 Thread Gregory P. Smith


New submission from Gregory P. Smith :

test_404 (test.test_xmlrpc.SimpleServerTestCase) ... Exception in thread 
Thread-1:
Traceback (most recent call last):
  File "/home/greg/oss/cpython/Lib/threading.py", line 938, in _bootstrap_inner
self.run()
  File "/home/greg/oss/cpython/Lib/threading.py", line 876, in run
self._target(*self._args, **self._kwargs)
  File "/home/greg/oss/cpython/Lib/test/test_xmlrpc.py", line 619, in 
http_server
serv.server_bind()
  File "/home/greg/oss/cpython/Lib/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 99] Cannot assign requested address

I'm preparing an IPv6-only buildbot.  There is no IPv4 localhost.

--
assignee: gregory.p.smith
components: Tests
messages: 350035
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: test_xmlrpc hangs on an IPv6-only host
versions: 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



[issue37898] test_httpservers hangs on an IPv6-only host

2019-08-20 Thread Gregory P. Smith


New submission from Gregory P. Smith :

test_err (test.test_httpservers.RequestHandlerLoggingTestCase) ... Exception in 
thread Thread-1:
Traceback (most recent call last):
  File "/home/greg/oss/cpython/Lib/threading.py", line 938, in _bootstrap_inner
self.run()
  File "/home/greg/oss/cpython/Lib/test/test_httpservers.py", line 50, in run
self.server = HTTPServer(('localhost', 0), self.request_handler)
  File "/home/greg/oss/cpython/Lib/socketserver.py", line 452, in __init__
self.server_bind()
  File "/home/greg/oss/cpython/Lib/http/server.py", line 137, in server_bind
socketserver.TCPServer.server_bind(self)
  File "/home/greg/oss/cpython/Lib/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 99] Cannot assign requested address

I'm preparing an IPv6-only buildbot.  There is no IPv4 localhost.

--
assignee: gregory.p.smith
components: Tests
messages: 350034
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: test_httpservers hangs on an IPv6-only host
type: behavior
versions: 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



[issue37897] test_asyncio hangs on an IPv6-only host

2019-08-20 Thread Gregory P. Smith


New submission from Gregory P. Smith :

test_drain_raises (test.test_asyncio.test_streams.StreamTests) ... Exception in 
thread Thread-20:
Traceback (most recent call last):
  File "/home/greg/oss/cpython/Lib/threading.py", line 938, in _bootstrap_inner
self.run()
  File "/home/greg/oss/cpython/Lib/threading.py", line 876, in run
self._target(*self._args, **self._kwargs)
  File "/home/greg/oss/cpython/Lib/test/test_asyncio/test_streams.py", line 
951, in server
with socket.create_server(('localhost', 0)) as sock:
  File "/home/greg/oss/cpython/Lib/socket.py", line 804, in create_server
raise error(err.errno, msg) from None
OSError: [Errno 99] Cannot assign requested address (while attempting to bind 
on address ('localhost', 0))

I'm preparing an IPv6-only buildbot.  (there is no IPv4 localhost)

--
assignee: gregory.p.smith
components: Tests
messages: 350033
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: test_asyncio hangs on an IPv6-only host
versions: 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



[issue37896] test_multiprocessing_fork hangs on an IPv6-only host

2019-08-20 Thread Gregory P. Smith


New submission from Gregory P. Smith :

It winds up stuck on a leftover process:

test_import (test.test_multiprocessing_fork._TestImportStar) ... ok
Warning -- Dangling processes: {}

Which is likely related to one of the other numerous failure ERRORs further up 
in the log.

I'm preparing an IPv6-only buildbot

--
assignee: gregory.p.smith
components: Tests
messages: 350032
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: test_multiprocessing_fork hangs on an IPv6-only host
type: behavior
versions: 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



[issue37895] test_logging hangs on an IPv6-only host

2019-08-20 Thread Gregory P. Smith


New submission from Gregory P. Smith :

test_logging hangs when run on an IPv6-only host.  (127.0.0.1 isn't even 
available)

test_listen_config_10_ok (test.test_logging.ConfigDictTest) ... Exception in 
thread Thread-3:
Traceback (most recent call last):
  File "/home/greg/oss/cpython/Lib/threading.py", line 938, in _bootstrap_inner
self.run()
  File "/home/greg/oss/cpython/Lib/logging/config.py", line 918, in run
server = self.rcvr(port=self.port, handler=self.hdlr,
  File "/home/greg/oss/cpython/Lib/logging/config.py", line 885, in __init__
ThreadingTCPServer.__init__(self, (host, port), handler)
  File "/home/greg/oss/cpython/Lib/socketserver.py", line 452, in __init__
self.server_bind()
  File "/home/greg/oss/cpython/Lib/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 99] Cannot assign requested address

possibly more, but it's hung here.

I'm preparing an IPv6-only buildbot.

--
assignee: gregory.p.smith
components: Tests
messages: 350031
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: test_logging hangs on an IPv6-only host
type: behavior
versions: 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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

> I guess I'm just not used to 0 being a multiplicative identity.

Yes, there's a whole generation of mathematicians who believe (wrongly) that "0 
!= 1" is one of the ring axioms. But it turns out that excluding the zero ring 
from the category of (commutative, unital) rings isn't helpful, and causes all 
sorts of otherwise universal constructs (quotients, localizations, categorical 
limits in general) to have only conditional existence. So nowadays most (but 
not all) people accept that the zero ring has the same right to exist as any 
other commutative ring.

Integral domains are another matter, of course: there you really _do_ want to 
insist that 1 != 0, though what you're really insisting is that any finite 
product of nonzero elements should be nonzero, and 1 != 0 is just the special 
case of that rule for the empty product, while x*y !=0 for x != 0 and y != 0 is 
the special case for two arguments.

--

___
Python tracker 

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



[issue37890] Modernize several tests in test_importlib

2019-08-20 Thread Brett Cannon


Brett Cannon  added the comment:

What Serhiy said. :) There's code to be able to easily test both 
builtins.__import__ and importlib.__import__ in tests so that there's no drift 
between the two implementations.

--

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-08-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I'm not a fan of CVE numbers in general, people have been creating too many of 
those.  But that also means I just don't care if someone does.  Having a CVE 
entry is not a way to claim something is important.

This issue is still open and can be used to track dealing with the host.

--
assignee: larry -> 
keywords: +security_issue
stage: patch review -> needs patch

___
Python tracker 

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



[issue32793] smtplib: duplicated debug message

2019-08-20 Thread miss-islington


miss-islington  added the comment:


New changeset 46a7564578f208df1e0c54fc0520d3b7ca32c981 by Miss Islington (bot) 
(Zackery Spytz) in branch 'master':
bpo-32793: Fix a duplicate debug message in smtplib (GH-15341)
https://github.com/python/cpython/commit/46a7564578f208df1e0c54fc0520d3b7ca32c981


--
nosy: +miss-islington

___
Python tracker 

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



[issue32793] smtplib: duplicated debug message

2019-08-20 Thread Abhilash Raj


Abhilash Raj  added the comment:

Removing 2.7 which only accepts security patches.

--
nosy: +maxking
versions:  -Python 2.7

___
Python tracker 

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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Tim Peters


Tim Peters  added the comment:

Mark, to save you the hassle, I'm closing this myself now.  Thanks for the 
feedback!

--
assignee:  -> tim.peters
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Tim Peters


Tim Peters  added the comment:

Yup, you have a point there! :-)  I guess I'm just not used to 0 being a 
multiplicative identity.

Don't know what other systems do.  Playing with Maxima, modulo 1 it seems to 
think 0 is the inverse of everything _except_ for 0.  `inv_mod(0, 1)` returns 
`false`.  Modulo -1, everything I tried returned `false`.

Which makes less sense to me.

Fine by me if you want to close this as "not a bug".

--

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 15345 to enhance regrtest timeout: more logs, more timeouts.

--

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-08-20 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Z/1Z is a perfectly-well-defined ring.

More to the point, it's a perfectly well-defined ring in which every element is 
invertible. That's why the Euler phi function has phi(1) = 1 (rather than 
phi(1) = 0), for example.

--

___
Python tracker 

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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

> While I doubt this, he may even argue that it's working correctly already ;-)

Yes, I'd argue exactly that. There's nothing ill-defined about working modulo 
+/-1. Z/1Z is a perfectly-well-defined ring. What's the motivation for this 
change?

--

___
Python tracker 

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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Batuhan


Change by Batuhan :


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

___
Python tracker 

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



[issue37894] [win] shutil.which can not find the path if 'cmd' include directory path and not include extension name

2019-08-20 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:

(I reopen the issue.)

"There are no child processes of the main test process.  There are 5
orphaned processes from multiprocessing.  Their parent process is gone
(assuming the parent_pid argument is correct)."

Oh wow, that's really strange. I would expect that regrtest main process has 
one worker process: "test_concurrent_futures".

https://buildbot.python.org/all/#/builders/130/builds/1050

C:\buildbot.python.org\3.7.kloth-win64\build>"C:\buildbot.python.org\3.7.kloth-win64\build\PCbuild\amd64\python_d.exe"
  -u -Wd -E -bb -m test  -uall -rwW --slowest --timeout 1200 --fail-env-changed 
-j1 -j2 -j4 --timeout 900 
== CPython 3.7.4+ (heads/3.7:02c1457, Aug 20 2019, 00:03:57) [MSC v.1900 64 bit 
(AMD64)]
== Windows-7-6.1.7601-SP1 little-endian
== cwd: C:\buildbot.python.org\3.7.kloth-win64\build\build\test_python_5524
== CPU count: 4
== encodings: locale=cp1252, FS=utf-8
Using random seed 1058030
Run tests in parallel using 4 child processes
0:00:01 load avg: 0.00 [  1/416] test_call passed
0:00:02 load avg: 0.00 [  2/416] test_genexps passed
...
0:12:46 load avg: 2.30 [412/416] test_threaded_import passed -- running: 
test_concurrent_futures (8 min 42 sec)
0:12:47 load avg: 2.30 [413/416] test_email passed -- running: 
test_concurrent_futures (8 min 43 sec)
0:12:50 load avg: 2.19 [414/416] test_bytes passed -- running: 
test_concurrent_futures (8 min 46 sec)
0:12:55 load avg: 2.02 [415/416] test_timeout passed -- running: 
test_concurrent_futures (8 min 52 sec)
running: test_concurrent_futures (9 min 22 sec)
running: test_concurrent_futures (9 min 52 sec)
running: test_concurrent_futures (10 min 22 sec)
...
running: test_concurrent_futures (9 hour 51 min)
running: test_concurrent_futures (9 hour 51 min)
running: test_concurrent_futures (9 hour 52 min)
running: test_concurrent_futures (9 hour 52 min)
running: test_concurrent_futures (9 hour 53 min)

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

___
Python tracker 

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



[issue37894] [win] shutil.which can not find the path if 'cmd' include directory path and not include extension name

2019-08-20 Thread Wator Sead


New submission from Wator Sead :

The current code is:
...
if os.path.dirname(cmd):
if _access_check(cmd, mode):
return cmd
return None
...

In Windows, if 'cmd' include directory path and not include extension name, it 
return 'None'.
e.g. a file's path is 'd:\dir\app.exe', call shutil.which with 
'cmd=="d:\dir\app"'.

How about this patch:
...
if os.path.dirname(cmd):
path, cmd = os.path.split(cmd)
...

--
components: Library (Lib)
messages: 350019
nosy: seahoh
priority: normal
severity: normal
status: open
title: [win] shutil.which can not find the path if 'cmd' include directory path 
and not include extension name
type: behavior
versions: Python 3.5, 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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Tim Peters


Tim Peters  added the comment:

@Batuhan, fine by me if you want to take this on!  It should be relatively 
easy.  But Mark wrote the code, so it's really up to him.  While I doubt this, 
he may even argue that it's working correctly already ;-)

--

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-08-20 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

> Can you check the process hierarchy? I would like to know how many worker 
> processes are still running under the main regrtest process. I expect to see 
> exactly one. I don't know how to investigate more on such issue on Windows.

There are no child processes of the main test process.  There are 5
orphaned processes from multiprocessing.  Their parent process is gone
(assuming the parent_pid argument is correct).  There is also an
orphaned typeperf.exe process, probably also from the killed process.

--
nosy: +jeremy.kloth

___
Python tracker 

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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Batuhan


Batuhan  added the comment:

Can i work on this?

--
nosy: +BTaskaya

___
Python tracker 

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



[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Tim Peters


New submission from Tim Peters :

For example, these should all raise ValueError instead:

>>> pow(2, -1, 1)
0
>>> pow(1, -1, 1)
0
>>> pow(0, -1, 1)
0
>>> pow(2, -1, -1)
0
>>> pow(1, -1, -1)
0
>>> pow(0, -1, -1)
0

--
components: Library (Lib)
messages: 350015
nosy: mark.dickinson, tim.peters
priority: normal
severity: normal
stage: needs patch
status: open
title: pow() should disallow inverse when modulus is +-1
type: behavior
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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:

> I can leave it "stuck" if there is some diagnostics that would be beneficial.

Can you check the process hierarchy? I would like to know how many worker 
processes are still running under the main regrtest process. I expect to see 
exactly one. I don't know how to investigate more on such issue on Windows.

--

___
Python tracker 

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



[issue37834] readlink on Windows cannot read app exec links

2019-08-20 Thread Steve Dower


Steve Dower  added the comment:

The latest PR also fixes issue1311 and issue20541 properly 
(os.path.exists("NUL") now returns True).

--

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:

I just tested the 3.7 branch manually: regrtest works as expected.

I'm using this local changes:

diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py
index e7dce180cb..7d996d6918 100644
--- a/Lib/test/libregrtest/runtest.py
+++ b/Lib/test/libregrtest/runtest.py
@@ -119,7 +119,7 @@ def _runtest(ns, test_name):
 
 use_timeout = (ns.timeout is not None)
 if use_timeout:
-faulthandler.dump_traceback_later(ns.timeout, exit=True)
+pass #faulthandler.dump_traceback_later(ns.timeout, exit=True)
 
 start_time = time.perf_counter()
 try:
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 8032da0530..e21399c840 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -89,6 +89,7 @@ class FileTests(unittest.TestCase):
 tearDown = setUp
 
 def test_access(self):
+import time; time.sleep(3600)
 f = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR)
 os.close(f)
 self.assertTrue(os.access(support.TESTFN, os.W_OK))


Then I ran:

vstinner@apu$ ./python -m test -j2 test_os -m test_access --timeout=3
Run tests in parallel using 2 child processes
0:00:04 load avg: 0.59 [1/1/1] test_os timed out (4 sec 512 ms)

== Tests result: FAILURE ==

1 test failed:
test_os

Total duration: 4 sec 545 ms
Tests result: FAILURE

As you can see, test_os is killed after 4.5 seconds, as expected (it uses 
timeout x 1.5, since faulthandler is supposed to be first watchdog with timeout 
seconds).

--

Maybe something is wrong with test_concurrent_futures on Windows. Maybe 
subprocess.Popen.kill() is unable to kill the process immediately for an 
unknown reason?

Or maybe subprocess.Popen.communicate(timeout=self.timeout) didn't fail with 
TimeoutExpired?

Sadly, libregrtest is quite when it kills a worker process because of timeout, 
since the following output should be enough to understand what happened. But 
here the worker was not killed, or failed to be killed, or something else...

--

___
Python tracker 

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



[issue37754] Persistence of Shared Memory Segment after process exits

2019-08-20 Thread Eryk Sun


Eryk Sun  added the comment:

> PS: I personally believe from my experience that shared memory 
> segments should outlive the process, unless specified otherwise. 
> Also, a argument persist=True, can be added which can ensure 
> that the shared_memory segment outlives the process, and can be 
> used by processes which are spawned later.

In terms of providing "consistent behavior across platforms that can be 
reasonably supported", the behavior suggested above could not reasonably be 
supported in Windows. 

The Section (shared memory) object itself is not a file. It gets created in the 
object namespace, either globally in "\BaseNamedObjects" or in an interactive 
session's "\Sessions\\BaseNamedObjects". 

By default, kernel objects are temporary. Creating permanent named objects 
requires SeCreatePermanentPrivilege, which by default is only granted to SYSTEM 
(sort of like root in Unix). For an object to be accessible across sessions and 
outlive an interactive session, it needs to be global. Creating global Section 
objects requires SeCreateGlobalPrivilege, which by default is only granted to 
administrators and service accounts.

Also, the Windows API has no capability to create permanent objects, so this 
would require the NT API functions NtMakePermanentObject (undocumented, added 
in NT 5.1) and NtMakeTemporaryObject.

--
nosy: +eryksun

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for spotting this omission.  Would you like to submit a PR with a short 
paragraph on exception chaining and "raise from"?

--
nosy: +rhettinger

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-08-20 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

It seems that an issue still exists.

https://buildbot.python.org/all/#/builders/130/builds/1050

has been running for nearly 9 hours at this point.  I can leave it "stuck" if 
there is some diagnostics that would be beneficial.  But I would prefer not to 
have this impeding other testing for too long.

--

___
Python tracker 

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



[issue15913] Add PyBuffer_SizeFromFormat() C helper for struct.calcsize()

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:

Joannah Nanjekye implemented the function, thanks.

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



[issue15913] Add PyBuffer_SizeFromFormat() C helper for struct.calcsize()

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9e66aba99925eebacfe137d9deb0ef1fdbc2d5db by Victor Stinner 
(Joannah Nanjekye) in branch 'master':
bpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)
https://github.com/python/cpython/commit/9e66aba99925eebacfe137d9deb0ef1fdbc2d5db


--
nosy: +vstinner

___
Python tracker 

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



[issue37732] Possible uninitialized variable in Objects/obmalloc.c

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Joannah for the bug report. I fixed the warning on 3.7, 3.8 and master 
branches.

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



[issue37732] Possible uninitialized variable in Objects/obmalloc.c

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c9a484a1e76384680b90454018389465760dbeae by Victor Stinner in 
branch '3.7':
bpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333) (GH-15342) 
(GH-15343)
https://github.com/python/cpython/commit/c9a484a1e76384680b90454018389465760dbeae


--

___
Python tracker 

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



[issue37884] Optimize Fraction() and statistics.mean()

2019-08-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

> This issue if for optimization only. It does not expand the math module API.

I think it does, though. The PR adds something to the math module that's 
tested, that needs to be maintained for other modules to work, and that's 
imported for use in another module; that smells like an element of the API to 
me, even with the leading underscore in the name. Other Python implementations 
would also need to implement math._as_integer_ratio for the pure Python 
fractions code to continue working. If we're going to expand the math module 
API to include such a function (and I don't think we should), we should do it 
properly: remove the leading underscore, and add documentation. But as you say, 
that's a separate issue.

I'm with Raymond here; I don't think this change is desirable for the math 
module, either with or without the leading underscore in the name.

--

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-08-20 Thread Riccardo Schirone


Riccardo Schirone  added the comment:

Will the flaw outlined in https://bugs.python.org/issue30458#msg347282 be fixed 
in python itself? If so, I think a CVE for python should be requested to MITRE 
(I can request one, in that case).

Moreover, does it make sense to create a new bug to track the new issue? This 
bug already references 3 CVEs and it would probably just create more confusion 
to reference a 4th. What do you think?

--

___
Python tracker 

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



[issue37732] Possible uninitialized variable in Objects/obmalloc.c

2019-08-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15060
pull_request: https://github.com/python/cpython/pull/15343

___
Python tracker 

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



[issue37732] Possible uninitialized variable in Objects/obmalloc.c

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 30e5aff5fb0e3841107ddd4539a1f5b8521c80fb by Victor Stinner in 
branch '3.8':
bpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333) (GH-15342)
https://github.com/python/cpython/commit/30e5aff5fb0e3841107ddd4539a1f5b8521c80fb


--

___
Python tracker 

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



[issue37754] Persistence of Shared Memory Segment after process exits

2019-08-20 Thread Vinay Sharma


Change by Vinay Sharma :


--
type: enhancement -> behavior

___
Python tracker 

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



[issue37732] Possible uninitialized variable in Objects/obmalloc.c

2019-08-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15059
pull_request: https://github.com/python/cpython/pull/15342

___
Python tracker 

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



[issue7676] IDLE shell shouldn't use TABs

2019-08-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I think that using tabs for Shell indents is IDLE's current worst design wart.  
But I agree with KBK (#1196946) that merely replacing tabs with spaces does not 
really solve the problem, which is the jagged physical margin consequent on 
physically indenting only the first line with a prompt. 

#37892 proposes to stop using tabs by implementing updated versions of the 
alternate fixes, 3 and 1, mentioned in msg151418 below. The alternate proposal 
will fix some other issues as well.

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



[issue37892] IDLE Shell: isolate user code input

2019-08-20 Thread Terry J. Reedy


New submission from Terry J. Reedy :

The main operational difference between the standard Python REPL and IDLE's 
Shell is that the latter operates with complete Python statements rather than 
physical lines.  Shell keeps the '>>>' prompt, but with the expanded meaning of 
"Enter a complete Python statement" rather than just "Enter the first line of a 
Python statement".  It omits the consequently superfluous continuation prompts, 
which would mostly be a nuisance if left.

Currently, the prompt precedes and indents the first line of code.  This causes 
multiple problems.  Internally, first lines have to be treated differently from 
the rest.  This has lead to bugs, mostly but not all fixed.  Externally, 
indentation depends on the prompt and does not look right or work right, 
compared to the same code in a proper editor.  And it lead to the use of Tab 
for indents.

The use of Tab for Shell indents was recognized as a problem by 2005.  #1196946 
proposed using the same space indents as in the editor, resulting, for 
instance, in
>>> if a:
if b:
print(a+b)
KBK rejected this with "Doesn't really solve the problem."

In 2010, #7676 suggested 4 space indents again and added 2 variations:  8 space 
indents, and 8 followed by 4, etc. OP Cherniavsky Beni noted that Tab indents 
are "inconsistent with PEP 8; what's worse, it's makes copy-paste code between 
the shell and editor windows confusing and dangerous!"  Raymond Hettinger later 
added that tabs are a "major PITA" and "a continual source of frustration for 
students".

Starting with msg151418 in 1212, my response was much the same as KBK's.  To 
me, the underlying problem is having the prompt physically indent the first 
physical line relative to the following lines.  I consider this IDLE's single 
biggest design wart.  I proposed then 3 possible solutions to avoid the first 
line non-significant indent.  They are, with current comments, ...

1. Prompt on a line by itself (vertical separation).

This is easy, and allows for an expanded active prompt, such as
  >>> Enter a complete Python statement on the lines below.
This says exactly what the user should do and should help avoid confusion with 
a command-line prompt.  ("I entered 'cd path' and got 'SyntaxError'".)

Once a statement is entered, the instruction is obsolete. Only '>>>' is needed, 
to identify input from output. I think putting '>>>' above past input works 
less well than for current input.  I will come back to this proposal below, 
after 3.

2. No input prompt; instead mark output (with #, for instance).

Possible, but confronting beginners with no prompt would likely leave them 
wondering what to do.  But this is a possible savefile format, one that could 
be run or edited.  (A savefile with only the code would do the same.)

3. Prompt in a margin, as with line numbers (horizontal separation).

In 1214, I realized that the 'margin' should be implemented as a separate 
sidebar widget, which was initially being developed for editor line numbers.  
We now have that, and a shell sidebar should be fairly easy.  I will open a 
separate issue with a fairly specific design.  Basically, the first lines of 
input, stderr output, and stdout output would be flagged with, for instance, 
'>>>', 'err', and 'out'.  This should be done before the additional proposal 
below. 


IDLE's Shell should isolate user input not only from prompts.  Debug on/off 
messages, warnings, and delayed program output can also interfere.  I think 
that IDLE's Shell should consist of an input and output history area with 
sidebar, fixed prompt and separator line such as in 1. above, and active input 
area.

The history area, as now, would be read-only except when responding to input() 
in the running code.  The change is that it would receive all messages from 
IDLE and asynchronous program output.  The input area would be a specialized 
editor area.  When input code is run, it would be copied above the separator 
prompt with '>>>' added to the sidebar, opposite the first line.

I believe that the easiest implementation would be to use a label for the fixed 
prompt line and a specialized editor that runs statements as entered.  The 
editing and smart indents would be the same as in a regular editor.  Once this 
is done, we could discuss refinements such as allowing pasting of multiple 
statements.

--
assignee: terry.reedy
components: IDLE
messages: 35
nosy: cheryl.sabella, rhettinger, taleinat, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE Shell: isolate user code input
type: behavior
versions: 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



[issue37887] some leak in the compiler_assert function

2019-08-20 Thread hai shi


hai shi  added the comment:

Ok, got it.

--

___
Python tracker 

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



[issue37732] Possible uninitialized variable in Objects/obmalloc.c

2019-08-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 18f8dcfa10d8a858b152d12a9ad8fa83b7e967f0 by Victor Stinner in 
branch 'master':
bpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333)
https://github.com/python/cpython/commit/18f8dcfa10d8a858b152d12a9ad8fa83b7e967f0


--

___
Python tracker 

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



[issue32793] smtplib: duplicated debug message

2019-08-20 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
type:  -> behavior
versions: +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



[issue32793] smtplib: duplicated debug message

2019-08-20 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +15058
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15341

___
Python tracker 

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



[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2019-08-20 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
Removed message: https://bugs.python.org/msg349997

___
Python tracker 

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



[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2019-08-20 Thread Printer Setup


Printer Setup  added the comment:

Fix Canon Printer Offline Windows 10 issues by following simple steps. Feel 
free to reach techies at Canon Support to resolve Canon Printer Offline issues. 
For more info: https://printeroffline.co/canon-printer/

--
nosy: +Printer Setup

___
Python tracker 

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



[issue37882] Code folding in IDLE

2019-08-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> rejected
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



[issue37884] Optimize Fraction() and statistics.mean()

2019-08-20 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> our needs tend to be much different from end-users

This issue is about fractions and statistics, which are closer to typical user 
libraries than CPython libraries. In fact, both could easily be packages on 
PyPI instead of part of the standard library.

> no end-user has ever requested this ever.

If math.as_integer_ratio() existed, probably SageMath would use it. On the 
other hand, the code for math.as_integer_ratio() is simple enough that SageMath 
could easily implement it if needed.

--

___
Python tracker 

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



[issue37884] Optimize Fraction() and statistics.mean()

2019-08-20 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> AFAICT, no end-user has ever requested this ever.

What do you mean with "this"?

(A) A public function like math.as_integer_ratio()

(B) Using as_integer_ratio() in the fractions.Fraction() constructor

(C) The optimization of the fractions.Fraction() constructor

For SageMath, (B) would be very useful. See 
https://discuss.python.org/t/pep-3141-ratio-instead-of-numerator-denominator/2037/24?u=jdemeyer
 (replace __ratio__ by as_integer_ratio)

--

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Niels Albers


Change by Niels Albers :


--
type:  -> enhancement

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Niels Albers


New submission from Niels Albers :

raise  from  has been in the language since 
python 3, yet the tutorial page teaching about exceptions does not mention it. 
(see https://docs.python.org/3.7/tutorial/errors.html#raising-exceptions)
It would be especially helpful to language newcomers to touch on the 
possibility of passing error context when raising a new exception in an 
exception handler.

--
assignee: docs@python
components: Documentation
messages: 349994
nosy: Niels Albers, docs@python
priority: normal
severity: normal
status: open
title: Exceptions tutorial page does not mention raise from
versions: Python 3.5, 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



[issue37890] Modernize several tests in test_importlib

2019-08-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

1) __import__() can be used for purpose. I would not change this.

3) How would you distinguish the case when the module have an attribute with 
the value is None and when it does not have the attribute at all? This 
information would lost with your change.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37887] some leak in the compiler_assert function

2019-08-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your patch hai shi. But note that assertion_error is a static 
variable. It is initialized only once. Your change makes it holding a borrowed 
reference after first call of compiler_assert(). This does not look reliable.

In any case assertion_error will gone after resolving issue34880, so I am 
closing this issue in favor of that.

If not issue34880, it would be better to use a private API for _Py_IDENTIFIER 
here.

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



[issue37868] `is_dataclass` returns `True` if `getattr` always succeeds.

2019-08-20 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue37868] `is_dataclass` returns `True` if `getattr` always succeeds.

2019-08-20 Thread miss-islington


miss-islington  added the comment:


New changeset 02c1457a036c2af3e91beb952afdb66d9c806435 by Miss Islington (bot) 
in branch '3.7':
bpo-37868: Improve is_dataclass for instances. (GH-15325)
https://github.com/python/cpython/commit/02c1457a036c2af3e91beb952afdb66d9c806435


--

___
Python tracker 

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



[issue37868] `is_dataclass` returns `True` if `getattr` always succeeds.

2019-08-20 Thread miss-islington


miss-islington  added the comment:


New changeset 1271ee8187df31debda7c556882a51ec356ca534 by Miss Islington (bot) 
in branch '3.8':
bpo-37868: Improve is_dataclass for instances. (GH-15325)
https://github.com/python/cpython/commit/1271ee8187df31debda7c556882a51ec356ca534


--
nosy: +miss-islington

___
Python tracker 

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