[issue32673] update tutorial dict part to reflect dict is ordered

2018-01-25 Thread Xiang Zhang

Xiang Zhang  added the comment:

Thanks for reminding, Martin.

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Dict order is now guaranteed, so add tests and doc for it

___
Python tracker 

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



[issue32673] update tutorial dict part to reflect dict is ordered

2018-01-25 Thread Martin Panter

Martin Panter  added the comment:

See Issue 32337

--
nosy: +martin.panter

___
Python tracker 

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



[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-25 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset e76daebc0c8afa3981a4c5a8b54537f756e805de by INADA Naoki in branch 
'master':
bpo-32571: Fix reading uninitialized memory (GH-5332)
https://github.com/python/cpython/commit/e76daebc0c8afa3981a4c5a8b54537f756e805de


--

___
Python tracker 

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



[issue32674] minor documentation fix for '__import__'

2018-01-25 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Don't worry, but in fact, I did not understand because when you post
your issue, there was no associated PR.

Now, I do understand.

Thank you

--

___
Python tracker 

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



[issue32674] minor documentation fix for '__import__'

2018-01-25 Thread Qian Yun

Qian Yun  added the comment:

Sorry, a typo, it's "minor documentation fix".

See https://github.com/python/cpython/pull/5339

diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index d8971bef2a..80b4f9447c 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -317,7 +317,7 @@ PyDoc_STRVAR(import_doc,
 "__import__(name, globals=None, locals=None, fromlist=(), level=0) -> module\n\
 \n\
 Import a module. Because this function is meant for use by the Python\n\
-interpreter and not for general use it is better to use\n\
+interpreter and not for general use, it is better to use\n\
 importlib.import_module() to programmatically import a module.\n\
 \n\
 The globals argument is only used to determine the context;\n\
@@ -326,8 +326,8 @@ should be a list of names to emulate ``from name import 
...'', or an\n\
 empty list to emulate ``import name''.\n\
 When importing a module from a package, note that __import__('A.B', ...)\n\
 returns package A when fromlist is empty, but its submodule B when\n\
-fromlist is not empty.  Level is used to determine whether to perform \n\
-absolute or relative imports. 0 is absolute while a positive number\n\
+fromlist is not empty.  The level argument is used to determine whether to\n\
+perform absolute or relative imports, 0 is absolute while a positive number\n\
 is the number of parent directories to search relative to the current 
module.");

--

___
Python tracker 

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



[issue32674] minor documentation fix for '__import__'

2018-01-25 Thread Qian Yun

Change by Qian Yun :


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

___
Python tracker 

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



[issue32674] minor documentation fix for '__import__'

2018-01-25 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

minor documentation?

I don't understand, the documentation of __import__ is well done, could you 
explain ?

https://docs.python.org/3/library/functions.html#__import__

thank you

--
nosy: +matrixise

___
Python tracker 

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



[issue32674] minor documentation fix for '__import__'

2018-01-25 Thread Qian Yun

New submission from Qian Yun :

This is a minor documentation for builtin function '__import__'.

--
assignee: docs@python
components: Documentation
messages: 310741
nosy: Qian Yun, docs@python
priority: normal
severity: normal
status: open
title: minor documentation fix for '__import__'
versions: Python 3.7

___
Python tracker 

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



[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 4112c5b97d9c1c7b034653d0e017ffa894a45c74 by Yury Selivanov in 
branch 'master':
bpo-32662: Try making test_asyncio.test_server more reliable (#5338)
https://github.com/python/cpython/commit/4112c5b97d9c1c7b034653d0e017ffa894a45c74


--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-25 Thread Guido van Rossum

Guido van Rossum  added the comment:

Maybe it's better to roll this back and take a deep breath. The feature freeze 
should not be treated as an excuse to cram in things at the last minute. Before 
this week I had never heard of this proposal. And the sarcasm is a bad start of 
your stint as a core dev, Nathaniel.

--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Guido van Rossum

Guido van Rossum  added the comment:

You guys both need to calm down.

Stefan, what's your objection against this, assuming the crash is fixed?

--

___
Python tracker 

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



[issue32673] update tutorial dict part to reflect dict is ordered

2018-01-25 Thread Chason Chaffin

Change by Chason Chaffin :


--
nosy: +chason

___
Python tracker 

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



[issue32673] update tutorial dict part to reflect dict is ordered

2018-01-25 Thread Xiang Zhang

New submission from Xiang Zhang :

Ordered builtin dict is the rule in 3.7, the tutorial part about dict[1] needs 
updating.

[1] https://docs.python.org/3.7/tutorial/datastructures.html#dictionaries

--
assignee: docs@python
components: Documentation
messages: 310737
nosy: docs@python, xiang.zhang
priority: normal
severity: normal
stage: needs patch
status: open
title: update tutorial dict part to reflect dict is ordered
versions: Python 3.7

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-25 Thread Nathaniel Smith

Change by Nathaniel Smith :


--
pull_requests: +5184
stage: resolved -> patch review

___
Python tracker 

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



[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-25 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5185

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-25 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Right, I *knew* I should be nervous about calling into Python from a C-level 
destructor... what's happening is:

- Somehow, that coroutine object is managing to survive until the very, very 
end of the shutdown sequence (PyImport_Cleanup). I'm not sure how exactly; Yury 
suspects it somehow involves _asynciomodule.c holding a reference.

- At the very end of PyImport_Cleanup, there's a final call to the cycle 
collector, which destroys the coroutine object

- _PyGen_Finalize notices it's unawaited, and calls 
_PyErr_WarnUnawaitedCoroutine

- _PyErr_WarnUnawaitedCoroutine attempts to call 
warnings._warn_unawaited_coroutine, in a very careful and defensive manner

- But it doesn't matter how careful and defensive you are, because at this 
stage in the shutdown, we have sys.module = None, which freaks out the import 
system so badly that when we try to look up the warnings module, it doesn't 
even raise an error, it just abort()s the whole interpreter.

We can get a similar crash by doing:

import sys
async def f(): pass
sys.corocycle = [f]
sys.corocycle.append(sys.corocycle)

If you run the same code on 3.6, then it gets collected at the same time, and 
it issues a warning using the regular PyErr_WarnEx. It turns out that code is 
even *more* careful and defensive and notices that the interpreter is being 
shutdown, so it just skips printing the warning entirely.

I guess what we have to do is add a similar check to 
_PyErr_WarnUnawaitedCoroutine.

You can imagine how excited I am that I started working on this patch so I 
could make sure people get more reliable notice of unawaited coroutines 
(bpo-30491), and not only has that been rejected, but now I'm writing code to 
explicitly hide unawaited coroutine warnings. Just saying'...

--

___
Python tracker 

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



[issue29237] Create enum for pstats sorting options

2018-01-25 Thread Ethan Furman

Change by Ethan Furman :


--
pull_requests: +5183

___
Python tracker 

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



[issue29237] Create enum for pstats sorting options

2018-01-25 Thread Ethan Furman

Ethan Furman  added the comment:


New changeset 863b1e4d0e95036bca4e97c1b8b2ca72c19790fb by Ethan Furman 
(mwidjaja) in branch 'master':
bpo-29237: Create enum for pstats sorting options (GH-5103)
https://github.com/python/cpython/commit/863b1e4d0e95036bca4e97c1b8b2ca72c19790fb


--

___
Python tracker 

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



[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-25 Thread Chason Chaffin

Chason Chaffin  added the comment:

> It's probably enough to fix it.  I fear that if we also change them in 
> sendmail we'll break someone's code, but maybe we should do that anyway, for 
> 3.7 only.

Should I make a separate issue for that, or attach it to this PR?

--

___
Python tracker 

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



[issue32672] .then execution of actions following a future's completion

2018-01-25 Thread dancollins34

dancollins34  added the comment:

Okay, I'll post something.

--

___
Python tracker 

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



[issue32672] .then execution of actions following a future's completion

2018-01-25 Thread dancollins34

Change by dancollins34 :


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

___
Python tracker 

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



[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-25 Thread R. David Murray

R. David Murray  added the comment:

It's probably enough to fix it.  I fear that if we also change them in sendmail 
we'll break someone's code, but maybe we should do that anyway, for 3.7 only.

--
versions:  -Python 2.7, Python 3.4, Python 3.5, Python 3.8

___
Python tracker 

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



[issue32672] .then execution of actions following a future's completion

2018-01-25 Thread R. David Murray

R. David Murray  added the comment:

I think this requires a discussion on the python-ideas mailing list, since API 
changes to Future need consideration in the asyncio context as well.

--
components: +Library (Lib) -Interpreter Core
nosy: +r.david.murray
type:  -> enhancement
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue32672] .then execution of actions following a future's completion

2018-01-25 Thread dancollins34

New submission from dancollins34 :

To my knowledge, python currently has no capability to chain future execution, 
requiring another future to begin executing with the result from the first.

I have submitted a pr to enable this functionality with a .then(self, fn) 
method on the concurrent.futures.Future object.

-dancollins34

--
components: Interpreter Core
messages: 310730
nosy: dancollins34
priority: normal
pull_requests: 5181
severity: normal
status: open
title: .then execution of actions following a future's completion
versions: Python 3.7

___
Python tracker 

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



[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-25 Thread Chason Chaffin

Change by Chason Chaffin :


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

___
Python tracker 

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



[issue32640] Python 2.7 str.join documentation is incorrect

2018-01-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

GH-5333 clarifies that str.join can return a Unicode object if iterable 
contains a Unicode object, and that it will raise TypeError if there is any non 
string or non unicode object.

--

___
Python tracker 

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



[issue32640] Python 2.7 str.join documentation is incorrect

2018-01-25 Thread Mariatta Wijaya

Change by Mariatta Wijaya :


--
keywords: +patch
pull_requests: +5179
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



[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-25 Thread INADA Naoki

Change by INADA Naoki :


--
pull_requests: +5178

___
Python tracker 

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



[issue27931] Email parse IndexError <""@wiarcom.com>

2018-01-25 Thread Xiang Zhang

Change by Xiang Zhang :


--
type:  -> behavior
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue23078] unittest.mock patch autospec doesn't work on staticmethods

2018-01-25 Thread Dean Liao

Dean Liao  added the comment:

I planned to upgrade Chromium OS's mock module to 2.0.0. I also encountered the 
issue that classmethod cannot be patched as callable mock.

Reviewers, can we start the review process?

--
nosy: +deanliao

___
Python tracker 

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



[issue2793] Dictionary fails to index when adding list when in a deeply nested loop

2018-01-25 Thread Jay Yin

Change by Jay Yin :


--
pull_requests: +5177

___
Python tracker 

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



[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-25 Thread Chason Chaffin

Chason Chaffin  added the comment:

I'm writing a PR for this right now. Is it worth it to write a test to make 
sure that mail_options isn't being mutated or is it enough just to update the 
code to use non-mutable defaults? Interesting side effect of looking into this 
is #32663 where I found the tests for the UTF8 code weren't being run.

--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-25 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:

The following snippet crashes with SIGABRT:

import asyncio
async def f(): pass
asyncio.gather(f())

llvm tells that the crash is in _PyGen_Finalize/_PyErr_WarnUnawaitedCoroutine

--

___
Python tracker 

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



[issue32304] Upload failed (400): Digests do not match on .tar.gz ending with x0d binary code

2018-01-25 Thread bbayles

Change by bbayles :


--
pull_requests: +5176

___
Python tracker 

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



[issue32304] Upload failed (400): Digests do not match on .tar.gz ending with x0d binary code

2018-01-25 Thread bbayles

Change by bbayles :


--
pull_requests: +5175

___
Python tracker 

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



[issue31972] Inherited docstrings for pathlib classes are confusing

2018-01-25 Thread Chason Chaffin

Change by Chason Chaffin :


--
nosy: +chason

___
Python tracker 

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



[issue32596] Lazy import concurrent.futures.process and thread

2018-01-25 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset 4666ec597c38eea06a22bcfb4157d92a0abf891c by INADA Naoki in branch 
'master':
bpo-32596: Make lazy-load portable (GH-5316)
https://github.com/python/cpython/commit/4666ec597c38eea06a22bcfb4157d92a0abf891c


--

___
Python tracker 

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



[issue27931] Email parse IndexError <""@wiarcom.com>

2018-01-25 Thread Jay Yin

Change by Jay Yin :


--
pull_requests: +5174
stage: commit review -> patch review

___
Python tracker 

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



[issue32671] redesign Windows os.getlogin, and add os.getuser

2018-01-25 Thread Eryk Sun

New submission from Eryk Sun :

os.getlogin() is supposed to return the name of the user logged in on the 
"controlling terminal" of the process. Windows doesn't have POSIX terminals; 
however, every process does belong to a terminal/desktop session that can be 
connected either to the physical console or a remote desktop. A standard user 
can call WTSQuerySessionInformation (an RPC to the Local Session Manager) to 
get the user name (i.e. WTSUserName) for the current session. ISTM that this is 
the closest analog to POSIX getlogin() that exists in Windows.

A caveat is that session 0 ("services") is never connected to the physical 
console. Thus there's no associated user account name.

os.getlogin() currently calls GetUserName (an RPC to the Local Security 
Authority), which returns the user name from the caller's effective token. If 
os.getlogin() is changed to return the session user, posixmodule.c could still 
wrap GetUserName privately as nt._getusername(). 

If the calling thread is impersonating, nt._getusername should temporarily 
revert to the process token (i.e. the real user), since this will usually be 
consistent with USERNAME. That said, getting the effective user can be useful 
for logging, so there should also be an option to return the effective user 
instead of the real user.

Note that the user name of the SYSTEM logon (and thus the USERNAME environment 
variable in a SYSTEM process) is actually "%COMPUTERNAME%$". It's noteworthy 
that GetUserName instead returns "SYSTEM" for this case. The "NETWORK SERVICE" 
logon also uses "%COMPUTERNAME%$", but in this case GetUserName returns 
"%COMPUTERNAME%$" instead of "NETWORK SERVICE".

A pair of high-level Python functions named getuser() and geteuser() could be 
added in os.py. These functions would return the real and effective user name 
of the caller, respectively. In Windows, os.getuser() would return the USERNAME 
environment variable and otherwise fall back on nt._getusername(). In POSIX, it 
would return the value of the first defined variable among LOGNAME, USER, and 
LNAME, and otherwise fall back on pwd.getpwuid(os.getuid()).pw_name. In 
Windows, os.geteuser() would return nt_getusername(effective=True). In POSIX it 
would return pwd.getpwuid(os.geteuid()).pw_name.

Currently getpass.getuser() always looks for environment variables named 
LOGNAME, USER, LNAME, and finally USERNAME. This is an odd choice on Windows. I 
wouldn't expect Windows users to know about and respect the special status of 
the first 3 variable names. getpass.getuser() also falls back on using the pwd 
module, which is another odd choice on Windows. It isn't worth removing or 
modifying this function, but the docs could encourage using the proposed 
os.getuser() and os.geteuser() functions on Windows and new code.

--
components: Library (Lib), Windows
messages: 310724
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: test needed
status: open
title: redesign Windows  os.getlogin, and add os.getuser
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue32660] Solaris should support constants like termios' FIONREAD

2018-01-25 Thread Jesús Cea Avión

Change by Jesús Cea Avión :


--
keywords: +patch
pull_requests: +5173
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



[issue32660] Solaris should support constants like termios' FIONREAD

2018-01-25 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

With this change, a SmarOS native zone exports 206 symbols in Python termios. 
Before it export 201. By comparison, a Linux Ubuntu 16.04 Python provides 244 
symbols.

Some references for the future:

http://www.verycomputer.com/168_45f4bd8c333a252f_1.htm

--

___
Python tracker 

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



[issue4963] mimetypes.guess_extension result changes after mimetypes.init()

2018-01-25 Thread Bert JW Regeer

Change by Bert JW Regeer :


--
nosy: +X-Istence

___
Python tracker 

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



[issue32660] Solaris should support constants like termios' FIONREAD

2018-01-25 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

After doing this change, I see FIVE new symbols in Python's termios:

"""
FIONREAD, FIONCLEX, FIOCLEX, FIOASYNC, FIONBIO.
"""

Good enough for now and me.

--

___
Python tracker 

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



[issue11023] pep 227 missing text

2018-01-25 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Moved to the PEP issue tracker.
https://github.com/python/peps/issues/557

--
nosy: +csabella
resolution:  -> later
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue32304] Upload failed (400): Digests do not match on .tar.gz ending with x0d binary code

2018-01-25 Thread Éric Araujo

Éric Araujo  added the comment:


New changeset 2fc98ae115e2a2095a0bcf388c27a878aafdb454 by Éric Araujo (Bo 
Bayles) in branch 'master':
bpo-32304: Fix distutils upload for sdists ending with \x0d (GH-5264)
https://github.com/python/cpython/commit/2fc98ae115e2a2095a0bcf388c27a878aafdb454


--

___
Python tracker 

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



[issue32660] Solaris should support constants like termios' FIONREAD

2018-01-25 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Solaris has two personalities: System V and BSD. This is not usually an issue 
but sometimes some constants have a different value in a mode or the other.

By default, when including  Solaris is in System V mode. We can 
force BSD mode defining symbol "BSD_COMP". This greatly expand the names 
available but, unfortunately, some values change.

The comment in  is quite clear:

"""
 *  There are some inherent problems in having a single file
 *  ioctl.h, with both System V and BSD flags. Introducing
 *  BSD flags into this file creates compilation problems
 *  with flags such as ECHO, NL1 etc., if termio.h and ioctl.h
 *  are included by the same file. Since these two files can
 *  be only included by System V applications, /usr/inclule/sys/ioctl.h
 *  will be System V mode and all the BSD flags will be turned off
 *  using #ifdef BSD_COMP. This file will also exist in
 *  /usr/ucbinclude/sys/ioctl.h for BSD applications but without the
 *  BSD flags turned off. System V appliactions can use ioctl.h without
 *  any changes, System V applications requiring BSD flags should
 *  -D BSD_COMP when compiling (and be warned about the common
 *  flags between System V and BSD) and BSD applications should
 *  use /usr/ucbinclude/sys/ioctl.h.
"""

Using "gcc -dM -E" we can observe defined symbols.

Ambiguous values when defininf "BSD_COMP" are: BS0, BS1, CR0, CR1, CR2, CR3, 
ECHO, FF0, FF1, FLUSHO, NL0, NL1, NOFLSH, PENDIN, TAB0, TAB1, TAB2, TOSTOP, 
XTABS.

Sounds quite important, actually.

Since I am no aiming to perfection, I would be satisfied making quite a few new 
symbols available, not all of them. A simple approach would be to include 
 and . In those header files there are only 
constants, not functions or data structures.

Just including those headers we get these new symbols (none overlapping other):

_FIO_COMPRESSED
_FIO_COUNT_FILLED
_FIO_GET_TOP_STATS
_FIO_SEEK_DATA
_FIO_SEEK_HOLE
_FIO_SET_LUFS_DEBUG
_FIO_SET_LUFS_ERROR
_FIOAI
_FIODIRECTIO
_FIOFFS
_FIOGDIO
_FIOGETMAXPHYS
_FIOGETSUPERBLOCK
_FIOIO
_FIOISBUSY
_FIOISLOG
_FIOISLOGOK
_FIOLFS
_FIOLFSS
_FIOLOGDISABLE
_FIOLOGENABLE
_FIOLOGRESET
_FIOOBSOLETE67
_FIOSATIME
_FIOSDIO
_FIOSNAPSHOTCREATE
_FIOSNAPSHOTCREATE_MULTI
_FIOSNAPSHOTDELETE
_FIOTUNE
_IO(x,y)
_IOR(x,y,t)
_IORN(x,y,t)
_IOW(x,y,t)
_IOWN(x,y,t)
_IOWR(x,y,t)
_IOWRN(x,y,t)
_SIOCSOCKFALLBACK
_SYS_FILIO_H
_SYS_IOCCOM_H
_SYS_SOCKIO_H
FIOASYNC
FIOCLEX
FIOGETOWN
FIONBIO
FIONCLEX
FIONREAD
FIOSETOWN
IF_UNITSEL
IOC_IN
IOC_INOUT
IOC_OUT
IOC_VOID
IOCPARM_MASK
O_SIOCGIFCONF
O_SIOCGLIFCONF
SIOCADDMULTI
SIOCADDRT
SIOCATMARK
SIOCDARP
SIOCDELMULTI
SIOCDELRT
SIOCDXARP
SIOCGARP
SIOCGDSTINFO
SIOCGENADDR
SIOCGENPSTATS
SIOCGETLSGCNT
SIOCGETNAME
SIOCGETPEER
SIOCGETPROP
SIOCGETSGCNT
SIOCGETSYNC
SIOCGETVIFCNT
SIOCGHIWAT
SIOCGIFADDR
SIOCGIFBRDADDR
SIOCGIFCONF
SIOCGIFDSTADDR
SIOCGIFFLAGS
SIOCGIFHWADDR
SIOCGIFINDEX
SIOCGIFMEM
SIOCGIFMETRIC
SIOCGIFMTU
SIOCGIFMUXID
SIOCGIFNETMASK
SIOCGIFNUM
SIOCGIP6ADDRPOLICY
SIOCGIPMSFILTER
SIOCGLIFADDR
SIOCGLIFBINDING
SIOCGLIFBRDADDR
SIOCGLIFCONF
SIOCGLIFDADSTATE
SIOCGLIFDSTADDR
SIOCGLIFFLAGS
SIOCGLIFGROUPINFO
SIOCGLIFGROUPNAME
SIOCGLIFHWADDR
SIOCGLIFINDEX
SIOCGLIFLNKINFO
SIOCGLIFMETRIC
SIOCGLIFMTU
SIOCGLIFMUXID
SIOCGLIFNETMASK
SIOCGLIFNUM
SIOCGLIFSRCOF
SIOCGLIFSUBNET
SIOCGLIFTOKEN
SIOCGLIFUSESRC
SIOCGLIFZONE
SIOCGLOWAT
SIOCGMSFILTER
SIOCGPGRP
SIOCGSTAMP
SIOCGXARP
SIOCIFDETACH
SIOCILB
SIOCLIFADDIF
SIOCLIFDELND
SIOCLIFGETND
SIOCLIFREMOVEIF
SIOCLIFSETND
SIOCLOWER
SIOCSARP
SIOCSCTPGOPT
SIOCSCTPPEELOFF
SIOCSCTPSOPT
SIOCSENABLESDP
SIOCSETPROP
SIOCSETSYNC
SIOCSHIWAT
SIOCSIFADDR
SIOCSIFBRDADDR
SIOCSIFDSTADDR
SIOCSIFFLAGS
SIOCSIFINDEX
SIOCSIFMEM
SIOCSIFMETRIC
SIOCSIFMTU
SIOCSIFMUXID
SIOCSIFNAME
SIOCSIFNETMASK
SIOCSIP6ADDRPOLICY
SIOCSIPMSFILTER
SIOCSLGETREQ
SIOCSLIFADDR
SIOCSLIFBRDADDR
SIOCSLIFDSTADDR
SIOCSLIFFLAGS
SIOCSLIFGROUPNAME
SIOCSLIFINDEX
SIOCSLIFLNKINFO
SIOCSLIFMETRIC
SIOCSLIFMTU
SIOCSLIFMUXID
SIOCSLIFNAME
SIOCSLIFNETMASK
SIOCSLIFPREFIX
SIOCSLIFSUBNET
SIOCSLIFTOKEN
SIOCSLIFUSESRC
SIOCSLIFZONE
SIOCSLOWAT
SIOCSLSTAT
SIOCSMSFILTER
SIOCSPGRP
SIOCSPROMISC
SIOCSQPTR
SIOCSSDSTATS
SIOCSSESTATS
SIOCSXARP
SIOCTMYADDR
SIOCTMYSITE
SIOCTONLINK
SIOCUPPER
SIOCX25RCV
SIOCX25TBL
SIOCX25XMT
SIOCXPROTO

Not all those symbols are going to be exported in Python.

--

___
Python tracker 

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



[issue32574] asyncio.Queue, put() leaks memory if the queue is full

2018-01-25 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32574] asyncio.Queue, put() leaks memory if the queue is full

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset c47dacb69054f6fe1c2465df585985430f7fe366 by Yury Selivanov (José 
Melero Fernández) in branch 'master':
bpo-32574: Fix leaks in asyncio.Queue.put() and .get() (#5208)
https://github.com/python/cpython/commit/c47dacb69054f6fe1c2465df585985430f7fe366


--

___
Python tracker 

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



[issue31698] Add REQ_NAME to the node.h API

2018-01-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
type:  -> enhancement

___
Python tracker 

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



[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-25 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset c9070d03f5169ad6e171e641b7fa8feab18bf229 by Yury Selivanov in 
branch 'master':
bpo-32662: Implement Server.start_serving() and Server.serve_forever() (#5312)
https://github.com/python/cpython/commit/c9070d03f5169ad6e171e641b7fa8feab18bf229


--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread STINNER Victor

Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Sure, and *I* am the one running the extended decimal test suite as we speak, 
> not Guido.

Thank you.

> You are playing power games here, and you did that from the start by choosing 
> the nosy list.

Please.  I thought it was pretty much decided that we will update decimal if 
there is no significant performance degradation, so there's no need for a 
conspiracy.  I put Guido to the nosy-list not because I want to force 
something, but just because we've discussed decimal and PEP 567/550 with him 
numerous times.

--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Stefan Krah

Stefan Krah  added the comment:

Sure, and *I* am the one running the extended decimal test suite as we speak,
not Guido.

You are playing power games here, and you did that from the start by choosing
the nosy list.

--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:

Stefan, I do think that this is a release blocker.  We want to get this change 
as early as possible to ensure that it's well tested.

AFAIK Guido also wants decimal to be updated and well supported in async/await 
code.

--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Stefan Krah

Change by Stefan Krah :


--
priority: release blocker -> normal

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Yury Selivanov

Change by Yury Selivanov :


--
nosy: +ned.deily
priority: normal -> release blocker

___
Python tracker 

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



[issue32657] Mutable Objects in SMTP send_message Signature

2018-01-25 Thread R. David Murray

R. David Murray  added the comment:

On Thu, 25 Jan 2018 15:18:01 +, Steven D'Aprano  
wrote:
> On Thu, Jan 25, 2018 at 02:28:17PM +, R. David Murray wrote:
> The docstring for send_message does say 
> 
> If the sender or any of the recipient addresses contain non-ASCII
> and the server advertises the SMTPUTF8 capability, the policy is
> cloned with utf8 set to True for the serialization, and SMTPUTF8
> and BODY=8BITMIME are asserted on the send.

"Asserted" means sent with the SMTP commands.  It could be reworded to
be clearer.

> which I don't really understand, but I thought that perhaps it was a 
> typo for *inserted* on the send, in the sense of inserted into the mail 
> options:
> 
> mail_options += ['SMTPUTF8', 'BODY=8BITMIME']

Even if that had been true, it would still be a bug to do it to the
mutable argument :)

> So are we agreed this is a bug? What about the default for rcpt_options 
> being a dict?

I didn't look at that, but it probably is.

--

___
Python tracker 

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



[issue32670] Enforce PEP 479—StopIteration and generators—in Python 3.7 by default

2018-01-25 Thread Yury Selivanov

Change by Yury Selivanov :


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

___
Python tracker 

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



[issue32670] Enforce PEP 479—StopIteration and generators—in Python 3.7 by default

2018-01-25 Thread Yury Selivanov

New submission from Yury Selivanov :

As per PEP 479, in Python 3.7 it should be a RuntimeError when a StopIteration 
exception is raised manually in a generator, a coroutine, or an async generator.

--
assignee: yselivanov
components: Interpreter Core
messages: 310712
nosy: gvanrossum, ncoghlan, ned.deily, yselivanov
priority: release blocker
severity: normal
status: open
title: Enforce PEP 479—StopIteration and generators—in Python 3.7 by default
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread Jay Yin

Jay Yin  added the comment:

no problem, thanks for helping and fixing the issue, I can now help contribute 
to python =D

--

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 255dbd2102d5dec5ffbd0b94084377e98c3b56c4 by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-32667: Fix tests when $PATH contains a file (GH-5322) (#5323)
https://github.com/python/cpython/commit/255dbd2102d5dec5ffbd0b94084377e98c3b56c4


--

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

Thank you Jay Yin for your bug report. I fixed the bug in Python 2.7, 3.6 and 
master.

--

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 6996f284d4d90aa05c46d9fe6f38d1030454b224 by Victor Stinner in 
branch '2.7':
bpo-32667: Fix tests when $PATH contains a file (#5324)
https://github.com/python/cpython/commit/6996f284d4d90aa05c46d9fe6f38d1030454b224


--

___
Python tracker 

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



[issue32669] cgitb file to print OSError exceptions

2018-01-25 Thread R. David Murray

R. David Murray  added the comment:

Yep, this one might get closed as "as designed", too ;)  cgitb has to cope with 
something going wrong with trying to print out values, because there are a 
number of ways to break that in Python, not just the one you are pointing to.

If you have a thought about how to move the exception handling deeper into the 
module in a generalized way, we could consider that option.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue29302] add contextlib.AsyncExitStack

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:

Thank you Alexander and Ilya!

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



[issue29302] add contextlib.AsyncExitStack

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 1aa094f74039cd20fdc7df56c68f6848c18ce4dd by Yury Selivanov (Ilya 
Kulakov) in branch 'master':
bpo-29302: Implement contextlib.AsyncExitStack. (#4790)
https://github.com/python/cpython/commit/1aa094f74039cd20fdc7df56c68f6848c18ce4dd


--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Mark Dickinson

Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread Jay Yin

Change by Jay Yin :


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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread Jay Yin

Change by Jay Yin :


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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread Jay Yin

Change by Jay Yin :


--
resolution:  -> fixed

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread Jay Yin

Change by Jay Yin :


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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:

I pushed a fix (already in the master branch) and rebased the patch once again. 
 I expect it to work now :)

--

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 6ab62920c87930dedc31fe633ecda3e51d3d7503 by Yury Selivanov in 
branch 'master':
bpo-32436: Fix a refleak; var GC tracking; a GCC warning (#5326)
https://github.com/python/cpython/commit/6ab62920c87930dedc31fe633ecda3e51d3d7503


--

___
Python tracker 

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



[issue32669] cgitb file to print OSError exceptions

2018-01-25 Thread steven Michalske

New submission from steven Michalske :

With the source

```
import cgitb
import sys

try:
f = open('non_exitant_file_path.foo')
except Exception as e:
cgitb.text(sys.exc_info())
```

we get the output

```
Traceback (most recent call last):
  File "foo.py", line 22, in 
f = open('non_exitant_file_path.foo')
FileNotFoundError: [Errno 2] No such file or directory: 
'non_exitant_file_path.foo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "foo.py", line 24, in 
cgitb.text(sys.exc_info())
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/cgitb.py", 
line 245, in text
value = pydoc.text.repr(getattr(evalue, name))
AttributeError: characters_written
```

In bug #30554 it was brought up that there are attributes designed as invariant 
os some other as designed behavior.  Unfortunately it was closed "as designed" 

So this means that cgitb has a bug when text formatting a sys_exc traceback of 
an OSError.

This is hidden in the by the hook with this code form cgitb.py
by falling back to the standard formatter...

line 277
```
try:
doc = formatter(info, self.context)
except: # just in case something goes wrong
doc = ''.join(traceback.format_exception(*info))
plain = True
```

--
messages: 310702
nosy: hardkrash
priority: normal
severity: normal
status: open
title: cgitb file to print OSError exceptions
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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:

I think I found what cause this, but I have no idea why it has surfaced only 
now :)

https://github.com/python/cpython/pull/5326/files
(see the added PyType_IS_GC(Py_TYPE(name)) check)

I'll merge that PR and rebase the decimal patch again.

--

___
Python tracker 

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



[issue29708] support reproducible Python builds

2018-01-25 Thread Brett Cannon

Change by Brett Cannon :


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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:

(Just in case I rebased my patch onto the latest master)

--

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-25 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5171

___
Python tracker 

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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-25 Thread Xiang Zhang

Change by Xiang Zhang :


--
pull_requests: +5170

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Yury Selivanov

Yury Selivanov  added the comment:

> I realize that you had to fight massive mailing list distractions
> during the PEP discussions, but this is very close to the beta ...

Oh thanks, but I see no reason for you to be condescending here.

I cannot reproduce this on Mac OS / Linux.  Are you sure you've built your 
Python correctly?  Can you run 'make distclean; ./configure --with-pydebug; 
make -j4'?

--

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +5169

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Stefan Krah

Stefan Krah  added the comment:

I realize that you had to fight massive mailing list distractions
during the PEP discussions, but this is very close to the beta ...


Let's start here:

>>> from decimal import *
==18887== Invalid read of size 8
==18887==at 0x5324E0: contextvar_new (context.c:744)
==18887==by 0x53141A: PyContextVar_New (context.c:137)
==18887==by 0xFED052B: PyInit__decimal (_decimal.c:5542)
==18887==by 0x51FC56: _PyImport_LoadDynamicModuleWithSpec (importdl.c:159)
==18887==by 0x51F29F: _imp_create_dynamic_impl (import.c:2145)
==18887==by 0x51A4BA: _imp_create_dynamic (import.c.h:289)
==18887==by 0x43257A: _PyMethodDef_RawFastCallDict (call.c:530)
==18887==by 0x432710: _PyCFunction_FastCallDict (call.c:582)
==18887==by 0x432DD6: PyCFunction_Call (call.c:787)
==18887==by 0x4FAA44: do_call_core (ceval.c:4659)
==18887==by 0x4F58CC: _PyEval_EvalFrameDefault (ceval.c:3232)
==18887==by 0x4E7F99: PyEval_EvalFrameEx (ceval.c:545)
==18887==  Address 0xcf589a8 is 8 bytes before a block of size 64 alloc'd
==18887==at 0x4C2A9A1: malloc (vg_replace_malloc.c:299)
==18887==by 0x470498: _PyMem_RawMalloc (obmalloc.c:75)
==18887==by 0x470FFC: PyMem_RawMalloc (obmalloc.c:503)
==18887==by 0x471DEF: _PyObject_Malloc (obmalloc.c:1560)
==18887==by 0x471312: PyObject_Malloc (obmalloc.c:616)
==18887==by 0x4A35D6: PyUnicode_New (unicodeobject.c:1293)
==18887==by 0x4CA16B: _PyUnicodeWriter_PrepareInternal 
(unicodeobject.c:13423)
==18887==by 0x4B1843: PyUnicode_DecodeUTF8Stateful (unicodeobject.c:4806)
==18887==by 0x4A5E67: PyUnicode_FromString (unicodeobject.c:2105)
==18887==by 0x5313F5: PyContextVar_New (context.c:133)
==18887==by 0xFED052B: PyInit__decimal (_decimal.c:5542)
==18887==by 0x51FC56: _PyImport_LoadDynamicModuleWithSpec (importdl.c:159)
==18887==

--

___
Python tracker 

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



[issue32654] Fixes Python for Android API 19

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

By the way, I started to take notes on Python on Android, since the topic is 
wide and complex:
http://vstinner.readthedocs.io/python_android.html

--

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5168

___
Python tracker 

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



[issue32654] Fixes Python for Android API 19

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

Another example of platform with best effort support is AIX. Until very 
recently, ctypes.util.find_library() didn't work on AIX which causes many tests 
failure. The AIX buildbot is red as far as I can remember. *Many* tests are 
failing on AIX for various reasons. While a few people sometimes propose fixes, 
basically the AIX support didn't evolved much last years in AIX...

AIX is a platform with a buildbot, but no real dedicated developer to fix all 
AIX specific issues.

--

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset b31206a223955d614d7769f95fb979d60f77bf87 by Victor Stinner in 
branch 'master':
bpo-32667: Fix tests when $PATH contains a file (#5322)
https://github.com/python/cpython/commit/b31206a223955d614d7769f95fb979d60f77bf87


--

___
Python tracker 

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



[issue32654] Fixes Python for Android API 19

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

Ned Deily: "I don't think we should be adding this platform-version-specific 
code unless we are going to fully support that particular platform and version."

I know the theory and I know the practice :-)

I started to list platforms that are "supported" by Python, with various 
support levels:
http://vstinner.readthedocs.io/cpython.html#supported-platforms

For example, Linux has an excellent support, whereas OpenBSD is more on the 
"best effort" side. "grep OpenBSD" in CPython shows me at least 51 lines of 
code, whereas OpenBSD has no buildbot and no dedicated developer to handle 
OpenBSD specific issues. For example, test_crypt is broken since at least 2 
years on OpenBSD, as many test_socket tests.

For OpenBSD, IMHO it's ok to have a best effort support, basically apply 
proposed patches.

For Android, the situation is somehow different. There are more and more people 
working on supporting officially Python on Android, like Xavier de Gaye and me 
who are core developers. Xavier is working on that for 2 years, and IMHO the 
port is done at 95%. The last part is just to setup a buildbot for Android API 
24.

The question is the added maintenance cost of Android API 19 #ifdef code, 
compared to pain of building Python on Android.

Technically, it should be possible to setup a buildbot for Android API 19, but 
only with a subset of tests. Either explicitly only run a subset of tests on 
this hypothetic buildbot, or even modify the Python test suite to skip some 
tests on Android API 19. While I expect a few patches for fix Python 
compilation on Android API 19, I do expect a lot of @skipIf() in tests, since 
API 19 has many broken or missing features. The thing is that most people don't 
care of these missing or broken features, it's not an issue for most 
applications on Android.

Note: Kivy is using Python on Android for years, but they use CrystaX NDK and 
not Google NDK. This issue is about supporting Google NDK: have the maximum 
compatibility.

--

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

Attached PR 5322 fixes the issue.

Example to reproduce the bug:

$ touch file
$ PATH=$PATH:$PWD/file ./python -m test test_subprocess -m test_invalid_args -v
(...)
==
ERROR: test_invalid_args (test.test_subprocess.ContextManagerTests)
--
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/test/test_subprocess.py", line 
3050, in test_invalid_args
stderr=subprocess.PIPE) as proc:
  File "/home/vstinner/prog/python/master/Lib/subprocess.py", line 743, in 
__init__
restore_signals, start_new_session)
  File "/home/vstinner/prog/python/master/Lib/subprocess.py", line 1431, in 
_execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'nonexisting_i_hope'
(...)


With PR 5322 applied, the whole Python test suite pass with 
PATH=$PATH:$PWD/file.

--

___
Python tracker 

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



[issue32654] Fixes Python for Android API 19

2018-01-25 Thread Chih-Hsuan Yen

Chih-Hsuan Yen  added the comment:

Agree with Ned Deily here. If CPython is going to be support android-19, it's 
better to fully support it. I'm optimistic here - I believe there won't be many 
android-19-specific patches beyond locale-related ones. Once android-24 is 
done, we can revisit this part and see how many patches are needed.

--

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32667] test_subprocess and test_dtrace fails if the last entry of $PATH is a file

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

I discussed with Jay Yin on IRC and we understood the issue on his setup: the 
last entry of his PATH environment variable is a path to an existing *file*, 
not a directory.

In this case, subprocess.Popen() fails with ENOTDIR if the program cannot be 
found in any other directory of the PATH.

Copy of _posixmodule.c:
---
/* This loop matches the Lib/os.py _execvpe()'s PATH search when */
/* given the executable_list generated by Lib/subprocess.py. */
saved_errno = 0;
for (i = 0; exec_array[i] != NULL; ++i) {
const char *executable = exec_array[i];
if (envp) {
execve(executable, argv, envp);
} else {
execv(executable, argv);
}
if (errno != ENOENT && errno != ENOTDIR && saved_errno == 0) {
saved_errno = errno;
}
}
/* Report the first exec error, not the last. */
if (saved_errno)
errno = saved_errno;
---

If the first execv() calls with ENOENT and the last one fails with ENOTDIR, the 
function fails with ENOTDIR.

--
nosy: +vstinner
title: Failing test_dtrace and test_subprocess on Ubuntu 16.04 on master -> 
test_subprocess and test_dtrace fails if the last entry of $PATH is a file

___
Python tracker 

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



[issue32640] Python 2.7 str.join documentation is incorrect

2018-01-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Oops.
Thanks, I will work on reverting the change later today.

--
assignee: docs@python -> Mariatta

___
Python tracker 

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



[issue32654] Fixes Python for Android API 19

2018-01-25 Thread pmpp

pmpp  added the comment:

Thanks ! I tested your PR it just built out of the box with the help of a one 
line change to Xavier de Gaye's android build support tool ( configure-android 
script + Android folder from bpo-30386 ). 

I'll forward to you the result of testsuite on a $10 Arm cortex-a7 board 
running Android kitkat 4.4.2 ( H3droid ) as soon as it finishes as i run a 
testbot on it.

My point of view is that "out of date" doesn't mean people don't actually *use* 
it : vstinner is indeed right , vendors provides almost no updates for hardware 
which actually can live long and have the power of some low power i** cpu but 
without the actual drawbacks we heard about recently.

--

___
Python tracker 

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



[issue10381] Add timezone support to datetime C API

2018-01-25 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, PR 5317 title mentionned this bpo number, but the merged change omits the 
bpo number and so wasn't mentioned on this issue.

PR 5317 added:

commit 58dc03c737a71de93edef7723c9f6186116288ef (upstream/master, master)
Author: Paul Ganssle 
Date:   Thu Jan 25 08:58:07 2018 -0500

Cleanup dangling reference in get_timezone_utc_capi (#5317)

--

___
Python tracker 

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



[issue32654] Fixes Python for Android API 19

2018-01-25 Thread Ned Deily

Ned Deily  added the comment:

I don't think we should be adding this platform-version-specific code unless we 
are going to fully support that particular platform and version.  That means at 
a minimum adding a buildbot for it and then having a core developer signed up 
to maintain the platform version.  It's not fair to other code developers and 
to downstream users to falsely imply that we support something that we are not 
set up to support, especially an already out-of-date version when we don't yet 
support any version of Android.  We will end up with another support headache 
as has been the case with other non-mainstream (with regard to Python) 
platforms.

--
nosy: +ned.deily

___
Python tracker 

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



[issue32668] deepcopy() fails on ArgumentParser instances

2018-01-25 Thread Martin Kolman

New submission from Martin Kolman :

We (the Anaconda OS intaller team) are in the process of switching to a new 
version of a library (Pykickstart), which among other things switched from 
using optparse to argparse. And during this endeavour we found that it's 
apparently not possible to deepcopy ArgumentParser instances:


$ ipython3
Python 3.6.3 (default, Oct  9 2017, 12:07:10) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import argparse

In [2]: from copy import deepcopy

In [3]: parser = argparse.ArgumentParser()

In [4]: deepcopy(parser)
---
TypeError Traceback (most recent call last)
 in ()
> 1 deepcopy(parser)

/usr/lib64/python3.6/copy.py in deepcopy(x, memo, _nil)
178 y = x
179 else:
--> 180 y = _reconstruct(x, memo, *rv)
181 
182 # If is its own copy, don't memoize.

/usr/lib64/python3.6/copy.py in _reconstruct(x, memo, func, args, state, 
listiter, dictiter, deepcopy)
278 if state is not None:
279 if deep:
--> 280 state = deepcopy(state, memo)
281 if hasattr(y, '__setstate__'):
282 y.__setstate__(state)

/usr/lib64/python3.6/copy.py in deepcopy(x, memo, _nil)
148 copier = _deepcopy_dispatch.get(cls)
149 if copier:
--> 150 y = copier(x, memo)
151 else:
152 try:

/usr/lib64/python3.6/copy.py in _deepcopy_dict(x, memo, deepcopy)
238 memo[id(x)] = y
239 for key, value in x.items():
--> 240 y[deepcopy(key, memo)] = deepcopy(value, memo)
241 return y
242 d[dict] = _deepcopy_dict

/usr/lib64/python3.6/copy.py in deepcopy(x, memo, _nil)
148 copier = _deepcopy_dispatch.get(cls)
149 if copier:
--> 150 y = copier(x, memo)
151 else:
152 try:

/usr/lib64/python3.6/copy.py in _deepcopy_list(x, memo, deepcopy)
213 append = y.append
214 for a in x:
--> 215 append(deepcopy(a, memo))
216 return y
217 d[list] = _deepcopy_list

/usr/lib64/python3.6/copy.py in deepcopy(x, memo, _nil)
178 y = x
179 else:
--> 180 y = _reconstruct(x, memo, *rv)
181 
182 # If is its own copy, don't memoize.

/usr/lib64/python3.6/copy.py in _reconstruct(x, memo, func, args, state, 
listiter, dictiter, deepcopy)
278 if state is not None:
279 if deep:
--> 280 state = deepcopy(state, memo)
281 if hasattr(y, '__setstate__'):
282 y.__setstate__(state)

/usr/lib64/python3.6/copy.py in deepcopy(x, memo, _nil)
148 copier = _deepcopy_dispatch.get(cls)
149 if copier:
--> 150 y = copier(x, memo)
151 else:
152 try:

/usr/lib64/python3.6/copy.py in _deepcopy_dict(x, memo, deepcopy)
238 memo[id(x)] = y
239 for key, value in x.items():
--> 240 y[deepcopy(key, memo)] = deepcopy(value, memo)
241 return y
242 d[dict] = _deepcopy_dict

/usr/lib64/python3.6/copy.py in deepcopy(x, memo, _nil)
178 y = x
179 else:
--> 180 y = _reconstruct(x, memo, *rv)
181 
182 # If is its own copy, don't memoize.

/usr/lib64/python3.6/copy.py in _reconstruct(x, memo, func, args, state, 
listiter, dictiter, deepcopy)
278 if state is not None:
279 if deep:
--> 280 state = deepcopy(state, memo)
281 if hasattr(y, '__setstate__'):
282 y.__setstate__(state)

/usr/lib64/python3.6/copy.py in deepcopy(x, memo, _nil)
148 copier = _deepcopy_dispatch.get(cls)
149 if copier:
--> 150 y = copier(x, memo)
151 else:
152 try:

/usr/lib64/python3.6/copy.py in _deepcopy_dict(x, memo, deepcopy)
238 memo[id(x)] = y
239 for key, value in x.items():
--> 240 y[deepcopy(key, memo)] = deepcopy(value, memo)
241 return y
242 d[dict] = _deepcopy_dict

/usr/lib64/python3.6/copy.py in deepcopy(x, memo, _nil)
159 copier = getattr(x, "__deepcopy__", None)
160 if copier:
--> 161 y = copier(memo)
162 else:
163 reductor = dispatch_table.get(cls)

TypeError: cannot deepcopy this pattern object


This should either be fixed or documented in proper places (the argparse 
documentation does not mention any pottential deepcopy issues as far as we can 
tell).

--
components: Library (Lib)
messages: 310686
nosy: mkolman
priority: normal
severity: normal
status: open
title: deepcopy() fails on ArgumentParser instances
type: crash
versions: Python 3.6

___

[issue32667] Failing test_dtrace and test_subprocess on Ubuntu 16.04 on master

2018-01-25 Thread Zachary Ware

Change by Zachary Ware :


--
nosy: +lukasz.langa, zach.ware

___
Python tracker 

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



[issue32654] Fixes Python for Android API 19

2018-01-25 Thread Chih-Hsuan Yen

Chih-Hsuan Yen  added the comment:

Here's another argument for supporting android < 21: according to Google [1], 
12.8% devices on the world run android-19. Furthermore, upgrading Android OS 
for a device is almost impossible for non-hackers unless the manufacturer 
provides an image for newer Android, and it's common for manufacturers not 
upgrading a phone soon after its debut.

--
nosy: +yan12125

___
Python tracker 

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



  1   2   >