[issue22964] dbm.open(..., "x")

2019-05-12 Thread Antony Lee


Change by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

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



[issue13474] Mention of "-m" Flag Missing From Doc on Execution Model

2019-05-12 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2019-05-12 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@eric.smith   Can you take a look at this when you get a chance?  Thanks!

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue36895] time.clock() marked for removal in 3.8 – still there.

2019-05-12 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

> If we find a _good_ reason to delay this removal a cycle during the 3.8 betas 
> we can bring it back.
> thanks for staying on top of the removal plan!

Thanks to you for the quick integration; I'm happy if we need to bring it back, 
but at least having it removed during betas/alphas will nudge people toward 
updating their code.

--

___
Python tracker 

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



[issue32832] doctest should support custom ps1/ps2 prompts

2019-05-12 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thank you for the suggestion, but per the discussion with Tim, I am closing as 
rejected.

--
nosy: +cheryl.sabella
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



[issue23896] lib2to3 doesn't provide a grammar where exec is a function

2019-05-12 Thread Batuhan


Change by Batuhan :


--
keywords: +patch
pull_requests: +13178
stage: needs patch -> patch review

___
Python tracker 

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



[issue22964] dbm.open(..., "x")

2019-05-12 Thread Batuhan


Batuhan  added the comment:

Python directly passes flags to gdbm (or whatever the dbm interface is). 

gdbm_open((char *)file, 0, flags, mode, NULL)) # _gdbmmodule.c:76

I dont think it is good idea to wrap gdbm for just a flag.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2019-05-12 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
versions: +Python 3.8 -Python 2.7, 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



[issue36728] Remove PyEval_ReInitThreads() from the public C API

2019-05-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

fwiw - i agree that this can be removed.  it has no reason to ever be called 
directly.  i double checked in our massive internal codebase at work and found 
no calls other than python interpreters themselves.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue36895] time.clock() marked for removal in 3.8 – still there.

2019-05-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I saw the PR before the bug comment.  merged.  if we find a _good_ reason to 
delay this removal a cycle during the 3.8 betas we can bring it back.

thanks for staying on top of the removal plan!

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

___
Python tracker 

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



[issue36895] time.clock() marked for removal in 3.8 – still there.

2019-05-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset e2500610c62673f42371b54fb0e4de83e4b33146 by Gregory P. Smith 
(Matthias Bussonnier) in branch 'master':
bpo-36895: remove time.clock() as per removal notice. (GH-13270)
https://github.com/python/cpython/commit/e2500610c62673f42371b54fb0e4de83e4b33146


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue36897] shlex doesn't differentiate escaped characters in output

2019-05-12 Thread Matthew Gamble


New submission from Matthew Gamble :

The output of the following invocations are exactly the same:

list(shlex.shlex('a ; b', posix=True, punctuation_chars=True))

list(shlex.shlex('a \; b', posix=True, punctuation_chars=True))

They both output the following:

['a', ';', 'b']

This makes it impossible to determine when the user wanted to escape the 
semi-colon for some reason, such as if they were using find's `-exec` argument.

--
components: Library (Lib)
messages: 342276
nosy: Matthew Gamble
priority: normal
severity: normal
status: open
title: shlex doesn't differentiate escaped characters in output
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue36807] IDLE doesn't call os.fsync()

2019-05-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

@Terry please see my comment on the PR.

--

___
Python tracker 

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



[issue36807] IDLE doesn't call os.fsync()

2019-05-12 Thread Dan Halbert


Dan Halbert  added the comment:

Fix tested and works! Comment from PR duplicated here.

I tested this fix by editing the 3.7.3 IDLE code by hand, and editing this test 
program as code.py on a CIRCUITPY drive on Windows 10:

import time
i = 0
while True:
print(i)
i += 1
print("""\
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
""")
time.sleep(1)

I typically test write flushing by editing a short program like this, and 
duplicating the print lines so that the size of the program grows by >512 
bytes. This forces a rewrite of the FAT12 information because the program has 
increased in size by one or more filesystem blocks. Then I shrink it back down 
again. If file flushing doesn't happen immediately, the program will often 
throw a syntax error (because it's missing some blocks), or CircuitPython will 
get an I/O error, which is what happened before I patched IDLE.

So this looks good!

--

___
Python tracker 

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



[issue36896] clarify in types.rst that FunctionTypes & co constructors don't have stable signature

2019-05-12 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
keywords: +patch
pull_requests: +13177
stage:  -> patch review

___
Python tracker 

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



[issue36689] docs: os.path.commonpath raises ValueError for different drives

2019-05-12 Thread Windson Yang


Windson Yang  added the comment:

An easy fix would be 

"Raise ValueError if paths contain (note: use contain instead of contains) both 
absolute and relative pathnames or the path are on the different drives."

--
nosy: +Windson Yang

___
Python tracker 

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



[issue36886] Failed to construct CodeType on Python-3.8.0a4

2019-05-12 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Thanks for the update to the what's new Pablo. 

> let's open a new issue for the notice in types.rst to keep the discussion 
> isolated.

See bpo-36896

--

___
Python tracker 

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



[issue36896] clarify in types.rst that FunctionTypes & co constructors don't have stable signature

2019-05-12 Thread Matthias Bussonnier


New submission from Matthias Bussonnier :

>From bpo-36886, 

IT is unclear the FunctionTypes, CodeTypes ... etc are not stable between 
python versions, and the recent addition of `:=` change some of the signatures. 
 


This suggest 2 things: 
 - A CYA sentence in types.rst "These types are not supposed to be instantiated 
outside of CPython internals and constructor signatures will vary between 
python versions." or alike
 - As many people don't read online documentation but on the docstring via 
calling `help()`, to add something similar to all the docstrings of 
said-objects constructors.

--
assignee: docs@python
components: Documentation
messages: 342271
nosy: docs@python, mbussonn
priority: normal
severity: normal
status: open
title: clarify in types.rst that FunctionTypes & co  constructors don't have 
stable signature
versions: Python 3.8

___
Python tracker 

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



[issue36895] time.clock() marked for removal in 3.8 – still there.

2019-05-12 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
keywords: +patch
pull_requests: +13176
stage:  -> patch review

___
Python tracker 

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



[issue36894] test_multiprocessing_spawn regression on Windows

2019-05-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Indeed, this is failing as well in all buildbots but has not been reported 
because fails in the setUp and therefore is counted as "RUN NO TESTS". Example:

https://buildbot.python.org/all/#/builders/58/builds/2368/steps/3/logs/stdio

--
nosy: +pablogsal

___
Python tracker 

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



[issue36886] Failed to construct CodeType on Python-3.8.0a4

2019-05-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5d23e282af69d404a3430bb95aefe371112817b3 by Pablo Galindo in 
branch 'master':
bpo-36886: Document changes in code object in What's new section (GH-13255)
https://github.com/python/cpython/commit/5d23e282af69d404a3430bb95aefe371112817b3


--

___
Python tracker 

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



[issue36886] Failed to construct CodeType on Python-3.8.0a4

2019-05-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue22135] allow to break into pdb with Ctrl-C for all the commands that resume execution

2019-05-12 Thread Chun-Yu Tseng


Change by Chun-Yu Tseng :


--
pull_requests: +13175
stage:  -> patch review

___
Python tracker 

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



[issue36895] time.clock() marked for removal in 3.8 – still there.

2019-05-12 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Vstiner, added you as you added the deprecation notice. I'm happy to take care 
of the removal and/or update the deprecation warning to 3.9.

--
nosy: +vstinner

___
Python tracker 

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



[issue36895] time.clock() marked for removal in 3.8 – still there.

2019-05-12 Thread Matthias Bussonnier

New submission from Matthias Bussonnier :

Deprecation message in `timemodule.c` says:

> "time.clock has been deprecated in Python 3.3 and will be removed from Python 
> 3.8: use time.perf_counter or time.process_time instead"

Should be bumped to 3.9 – or time.clock should be removed.

Deprecation was added by Victor Stinner.

--
components: Library (Lib)
messages: 342267
nosy: mbussonn
priority: normal
severity: normal
status: open
title: time.clock() marked for removal in 3.8 – still there.
versions: Python 3.8

___
Python tracker 

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



[issue35924] curses segfault resizing window

2019-05-12 Thread Toshio Kuratomi


Toshio Kuratomi  added the comment:

Hi Josiah, I've tested my sample program and it looks like the segmentation 
fault is fixed with ncurses-6.1-20190511: 
http://lists.gnu.org/archive/html/bug-ncurses/2019-05/msg00013.html

Are you able to give that a try and see whether it resolves the issue for you 
as well?

For the Core devs; Assuming this is fixed in a newer ncurses, how would you 
like to proceed with this bug?  I have a documentation PR to tell people about 
the bug in ncurses and the workaround: 
https://github.com/python/cpython/pull/13209  I can update that to mention the 
version of ncurses that this is fixed in if you want that.  Other than that, 
I'm not sure what more we can do.

--

___
Python tracker 

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



[issue14353] Proper gettext support in locale module

2019-05-12 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 24ff9a44ac5f0653df4c1d92c2a99fab286fcc15 by Benjamin Peterson 
(Toshio Kuratomi) in branch '2.7':
[2.7] closes bpo-14353: Fix detection of bind_textdomain_codeset in libintl. 
(GH-13265)
https://github.com/python/cpython/commit/24ff9a44ac5f0653df4c1d92c2a99fab286fcc15


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



[issue36027] Support negative exponents in pow() where a modulus is specified.

2019-05-12 Thread Mark Dickinson


Change by Mark Dickinson :


--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue36027] Support negative exponents in pow() where a modulus is specified.

2019-05-12 Thread Mark Dickinson


Change by Mark Dickinson :


--
keywords: +patch
pull_requests: +13174
stage:  -> patch review

___
Python tracker 

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



[issue14353] Proper gettext support in locale module

2019-05-12 Thread Toshio Kuratomi


Change by Toshio Kuratomi :


--
pull_requests: +13173
stage:  -> patch review

___
Python tracker 

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



[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-12 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Thank you Jake for your contribution!

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



[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-12 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 4959c33d2555b89b494c678d99be81a65ee864b0 by Antoine Pitrou (Jake 
Tesler) in branch 'master':
bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)
https://github.com/python/cpython/commit/4959c33d2555b89b494c678d99be81a65ee864b0


--

___
Python tracker 

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



[issue36894] test_multiprocessing_spawn regression on Windows

2019-05-12 Thread Antoine Pitrou


New submission from Antoine Pitrou :

After bpo-36867, test_multiprocessing_spawn fails running any test on Windows 
(but it isn't noticed as a fail build).

https://ci.appveyor.com/project/python/cpython/builds/24485897#L1264

0:04:05 load avg: 5.39 [389/421] test_multiprocessing_spawn run no tests
ERROR
==
ERROR: setUpModule (test.test_multiprocessing_spawn)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\_test_multiprocessing.py", line 5498, in 
setUpModule
multiprocessing.set_forkserver_preload(PRELOAD)
  File "C:\projects\cpython\lib\multiprocessing\context.py", line 183, in 
set_forkserver_preload
from .forkserver import set_forkserver_preload
  File "C:\projects\cpython\lib\multiprocessing\forkserver.py", line 14, in 

from . import resource_tracker
  File "C:\projects\cpython\lib\multiprocessing\resource_tracker.py", line 24, 
in 
import _posixshmem
ModuleNotFoundError: No module named '_posixshmem'
--
Ran 0 tests in 0.005s
FAILED (errors=1)

--
components: Library (Lib), Tests
messages: 342262
nosy: pierreglaser, pitrou
priority: deferred blocker
severity: normal
stage: needs patch
status: open
title: test_multiprocessing_spawn regression on Windows
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-12 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

As documentation reader I have a mental problem to figure out when use 
non-default `wait_at_exit=False` flag and when don't.

The rule like: "if you tried to call `executor.shutdown(wait=False)` and it 
still hangs try `executor.shutdown(wait=False, wait_at_exit=False)`, maybe it 
can help" doesn't sound too robust.

--

___
Python tracker 

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



[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-12 Thread Hrvoje Nikšić

Hrvoje Nikšić  added the comment:

@asvetlov The idea of the new flag is to disable any subsequent waiting for 
futures after ThreadPoolExecutor.shutdown(wait=False) returns.

Currently the additional waiting is implemented using "atexit", so I assumed it 
referred to process exit. (The documentation at 
https://docs.python.org/3/library/atexit.html doesn't seem to specify precisely 
when the callbacks are executed.) But looking at the implementation of atexit, 
it seems that the atexit callbacks are actually called from Py_FinalizeEx.

I think wait_at_exit is descriptive because in most cases the process exit and 
interpreter shutdown will correlate, but I can still update the docs to make it 
clearer what "exit" refers to. We should just avoid the word "shutdown" in the 
flag name to avoid confusion with executor shutdown.

--

___
Python tracker 

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



[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-12 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Should wait_on_exit be True only on application exit?
Do application exit means interpreter shutdown (sys.is_finalizing() == True)?

--
nosy: +asvetlov

___
Python tracker 

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



[issue20044] gettext.install() ignores previous call to locale.setlocale()

2019-05-12 Thread Toshio Kuratomi

Toshio Kuratomi  added the comment:

I tested a small C program and found that setlocale takes precedence for 
LC_ALL, LC_MESSAGES, and LANG but not for LANGUAGE.

int main(int argc, char **argv) {
char *message1;

//setlocale (LC_ALL, "");
setlocale (LC_ALL, "pt_BR.utf-8");
bindtextdomain ("testc", "/srv/python/cpython/tmp");
textdomain ("testc");

message1 = gettext("lemon");
printf("%s\n", message1);
return 0;
}

$ LC_ALL=es_MX.utf-8 LANGUAGE= LC_MESSAGES=es_MX.utf-8 LANG=es_MX.utf-8 ./test
limão

$ LANGUAGE=es_MX  LANG=es_MX.utf-8 ./test
limón


So this could be considered a bug in the stdlib's gettext.  If we fix it, we'll 
need to make sure that we continue to honor LANGUAGE, though.

--
nosy: +a.badger

___
Python tracker 

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



[issue35431] Add a function for computing binomial coefficients to the math module

2019-05-12 Thread Yash Aggarwal


Yash Aggarwal  added the comment:

@mark.dickinson both pr's are more or less same. Keller was offline for some 
time so I made the new issue. They were merged later. Only difference is in 
unittests. I'd say it's up to you to decide which one to keep.

--

___
Python tracker 

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



[issue36893] email.headerregistry.Address blocks Unicode local part addr_spec accepted elsewhere

2019-05-12 Thread R. David Murray


R. David Murray  added the comment:

In order to legitimately have a non-ascii localpart, you *must* be using 
RFC6532 and RFC6531.  In the email package you do this by using 
policy=SMTPUTF8, or setting utf8=True in your custom Policy.  In smtplib you do 
this by specifying smtputf8 in the mail_options list to sendmail, or passing a 
message with a policy that has utf8=True to send_message.

I notice in answering this report that this is not really documented clearly.  
The information is there, but only if you already know how the RFCs work.  Some 
variation of the text above should be added to the smtplib documentation, and 
an example of using SMTPUTF8 should be added to the email examples chapter.

However, you are correct, there are couple of bugs here.

The rendering done by as_string (and as_bytes) is the best that we can do 
without raising an error...but we should probably be raising an error if the 
rendering policy does not have utf8=True and we don't have an "original source 
line" from parsing a message (which is the case here), rather than using the 
incorrect RFC2047 encoding.

The second bug, the one you are reporting, is that we apparently missed the 
constructor of Address when we were adding RFC6532 support.  If you look at the 
comment above that code, it is purposefully trying to raise an error if the 
addr_spec is invalid and it was provided by the *application* (as opposed to 
email.Parser).  But with RFC6532 support, it should be valid to have a local 
part that has non-ascii in an Address, and the error, as I noted above, should 
be raised only at serialization time and when we don't have an original source 
string.  So that raise should be modified to explicitly ignore the 
NonASCIILocalPartDefect.  (Really, Address should take a policy argument.  
That's a bigger change, but it would be the "right way" to fix this.)

Raising the error on serialization could cause some breakage if existing 
programs are "getting away" with specifying non-ascii local parts but not doing 
it via addr_spec.  It is breakage that should happen, I think, but we may want 
to only do it in a feature release.

--

___
Python tracker 

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



[issue36865] FileInput does not allow 'rt' mode, but all its existing delegates do

2019-05-12 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you for the report and the PR!

I think accepting 'rt' mode is a good idea. However, it's a new feature and it 
can only go into 3.8.

It seems to me that the root cause of the issue is that the fileinput module 
wasn't properly converted to support Python 3. Perhaps we could change 'r' to 
'rt' in FileInput.__init__() or hook_compressed() to make it work properly, so 
the example in issue 5758 would work as expected without changing any user code:

# test.py

import fileinput

for line in fileinput.FileInput(openhook=fileinput.hook_compressed):
print(line.rstrip())


$ ./python.exe test.py mike.txt mike.txt.gz
Hello from Mike.
This is the second line.
Why did the robot cross the road?
Hello from Mike.
This is the second line.
Why did the robot cross the road?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36893] email.headerregistry.Address blocks Unicode local part addr_spec accepted elsewhere

2019-05-12 Thread Matthew

New submission from Matthew :

The parser for passing an addr_spec to email.headerregistry.Address does not 
allow non-ASCII local parts, but the rest of the email package handles them 
fine, either straight (with explicit references to RFC6532 and SMTPUTF8), or 
encoding as expected. Apologies if I've misunderstood something.

>>> from email.message import EmailMessage
>>> msg = EmailMessage()
>>> msg['To'] = 'Matthéw '
>>> msg.as_string()
'To: =?utf-8?q?Matth=C3=A9w?= <=?utf-8?q?a=C3=A9?=@example.com>\n\n'
>>> msg['To'].addresses[0]
Address(display_name='Matthéw', username='aé', domain='example.com')
>>> msg['To'].addresses[0].addr_spec
'aé@example.com'
>>> email.headerregistry.Address(addr_spec=msg['To'].addresses[0].addr_spec)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/headerregistry.py",
 line 48, in __init__
raise a_s.all_defects[0]
email.errors.NonASCIILocalPartDefect: local-part contains non-ASCII characters)
>>>

--
components: email
messages: 342254
nosy: barry, dracos, r.david.murray
priority: normal
severity: normal
status: open
title: email.headerregistry.Address blocks Unicode local part addr_spec 
accepted elsewhere
versions: Python 3.6

___
Python tracker 

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



[issue35431] Add a function for computing binomial coefficients to the math module

2019-05-12 Thread Mark Dickinson


Mark Dickinson  added the comment:

@kellerfuchs @FR4NKESTI3N

We seem to have two open PRs for this feature, both with some review comments. 
Which is the one true PR? Can we close the other one?

--

___
Python tracker 

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



[issue35996] Optional modulus argument for new math.prod() function

2019-05-12 Thread Mark Dickinson


Mark Dickinson  added the comment:

Put me down for a -1, too.

> One would also be able to things like prod(range(1, n), n) == n - 1 for 
> Wilson's primality test.

That's not the most convincing use-case, since that's a _horribly_ inefficient 
way to do a primality test in the first place (worse than trial division, even 
if you take that trial division all the way up to `n - 1` instead of the square 
root of `n`).

--

___
Python tracker 

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



[issue36865] FileInput does not allow 'rt' mode, but all its existing delegates do

2019-05-12 Thread SilentGhost


Change by SilentGhost :


--
nosy: +berker.peksag
versions:  -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30464] gammavariate has a wrong comment

2019-05-12 Thread Mark Dickinson


Mark Dickinson  added the comment:

That should clearly have been "different stream" rather than "difference 
stream".

--

___
Python tracker 

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



[issue36791] sum() relies on C signed overflow behaviour

2019-05-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue36791] sum() relies on C signed overflow behaviour

2019-05-12 Thread miss-islington


miss-islington  added the comment:


New changeset b7e483b6d07081d5f81860258e95785975a7cbf8 by Miss Islington (bot) 
in branch '3.7':
bpo-36791: Safer detection of integer overflow in sum(). (GH-13080)
https://github.com/python/cpython/commit/b7e483b6d07081d5f81860258e95785975a7cbf8


--
nosy: +miss-islington

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-05-12 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +lisroach

___
Python tracker 

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



[issue36791] sum() relies on C signed overflow behaviour

2019-05-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13172

___
Python tracker 

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



[issue30464] gammavariate has a wrong comment

2019-05-12 Thread Mark Dickinson


Mark Dickinson  added the comment:

This was fixed in PRs GH-1798 and GH-1934. Closing.

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



[issue36791] sum() relies on C signed overflow behaviour

2019-05-12 Thread Mark Dickinson


Mark Dickinson  added the comment:

Can this be closed, or does the fix need to be backported?

--

___
Python tracker 

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



[issue30464] gammavariate has a wrong comment

2019-05-12 Thread SilentGhost


SilentGhost  added the comment:

Does "a difference stream" in PR 1934 (news entry):

> It does however produce a difference stream of random variables than it used 
> to.

make some sense? Sentence doesn't seem grammatical.

--
nosy: +SilentGhost
resolution:  -> fixed

___
Python tracker 

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



[issue36867] Make semaphore_tracker track other system resources

2019-05-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Since the commit there is a warning in CI and locally while running tests.

Travis CI : 

* https://travis-ci.org/python/cpython/jobs/531304357#L2099 
(test_multiprocessing_forkserver)
* https://travis-ci.org/python/cpython/jobs/531304357#L2296 
(test_multiprocessing_fork)

Before commit : 

./python.exe -X tracemalloc -m test --fail-env-changed 
test_multiprocessing_forkserver
Run tests sequentially
0:00:00 load avg: 4.71 [1/1] test_multiprocessing_forkserver
test_multiprocessing_forkserver passed in 2 min 21 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 2 min 21 sec
Tests result: SUCCESS

After commit f22cc69b012f52882d434a5c44a004bc3aa5c33c : 

./python.exe -X tracemalloc -m test --fail-env-changed 
test_multiprocessing_forkserver
Run tests sequentially
0:00:00 load avg: 4.08 [1/1] test_multiprocessing_forkserver
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/multiprocessing/resource_tracker.py:198:
 UserWarning: resource_tracker: There appear to be 1 leaked shared_memory 
objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/case.py:683: 
ResourceWarning: unclosed file <_io.BufferedReader name=7>
  testMethod()
Object allocated at (most recent call last):
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/subprocess.py", 
lineno 819
self.stdout = io.open(c2pread, 'rb', bufsize)
test_multiprocessing_forkserver passed in 2 min 20 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 2 min 20 sec
Tests result: SUCCESS

== Tests result: SUCCESS ==

1 test OK.

Total duration: 2 min 26 sec
Tests result: SUCCESS

--
nosy: +xtreak

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-05-12 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I have created a PR for this. My approach is that when 
mock_thing.assert_has_calls(mock.call.method1(1, 2)) is made the 
assert_has_calls is made against mock_thing whose spec_signature (constructor 
signature) is always used. But there is _mock_children, a dictionary which has 
signature for the methods. Thus method1 can be used as key for _mock_children 
to get correct signature. 

Where it gets tricky is that if there is a nested class whose method is called 
like Foo.Bar.meth1 as below then the dictionary has only 'Bar' from which the 
children has to be obtained to get meth1 signature like {'Foo': {'bar1': 
signature}} and it's not stored with the key 'Foo.Bar.meth1' resulting in 
iteration. There could be a better way or some edge case not covered so I have 
opened up PR for review but if someone else has better approach then that would 
be great too since this is a long standing issue resulting autospec needing to 
be turned off.

class Foo:
class Bar:
def meth1(self, a): pass


This PR also solves the case at https://bugs.python.org/issue26752#msg287728. 
There is a test failure caught by doctest for nested calls without spec and not 
by unittest :) I have converted the doctest as a unittest.

--
nosy: +cjw296, mariocj89, michael.foord

___
Python tracker 

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



[issue33303] ElementTree Comment text isn't escaped

2019-05-12 Thread Stefan Behnel

Stefan Behnel  added the comment:

I'm really sorry again, but I only consulted the XML spec on this now (and also 
the way libxml2 does it), and I found that XML comment text actually does not 
get escaped. It's not character data, and, in fact, "--" is not even allowed at 
all inside of comments. (Funny enough, the HTML serialiser does escaping for 
both comments and PIs, but, well, that's HTML, I guess…)

https://www.w3.org/TR/REC-xml/#sec-comments

Sorry, Jeffrey, I should have looked that up in the spec much earlier, before 
you invested so much time into this.

There are two disallowed cases: "--" in the text content, and "-" at the end of 
the text (which would lead to an "--->"). Now, the thing is, such validation is 
currently unprecedented in ElementTree, so I don't know if we should start 
raising exceptions from the serialiser for this case, and if yes, which. Since 
comments are rare, it won't hurt performance to do that, but once we get 
started on this, users would probably also want their text and attribute 
content and their tag and attribute names to be validated, and that would hurt 
then.

So, I will have to reject the PR and this ticket.

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-05-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
keywords: +patch
pull_requests: +13171
stage: needs patch -> patch review

___
Python tracker 

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



[issue33303] ElementTree Comment text isn't escaped

2019-05-12 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

I backed-out the Processing Instruction changes.

--

___
Python tracker 

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



[issue36886] Failed to construct CodeType on Python-3.8.0a4

2019-05-12 Thread Big Stone


Big Stone  added the comment:

I found a third project that is impacted 
https://github.com/microsoft/python-language-server/issues/1070.

--

___
Python tracker 

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