[issue31877] Build fails on Cygwin since issue28180

2017-10-26 Thread Mark Dickinson

Change by Mark Dickinson :


--
title: Build fails on Cython since issue28180 -> Build fails on Cygwin since 
issue28180

___
Python tracker 

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



[issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows

2017-10-26 Thread Akos Kiss

Akos Kiss  added the comment:

And I thought that my analysis was thorough... Exit code 1 is the way to go, I 
agree now.

--

___
Python tracker 

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



[issue31053] Unnecessary argument in command example

2017-10-26 Thread Berker Peksag

Berker Peksag  added the comment:

Thank you!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue31053] Unnecessary argument in command example

2017-10-26 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset 37d1d967eed4018ef397dd9d1515683e5b6b55e7 by Berker Peksag (Miss 
Islington (bot)) in branch '3.6':
bpo-31053: Remove redundant 'venv' argument in venv example (GH-2907)
https://github.com/python/cpython/commit/37d1d967eed4018ef397dd9d1515683e5b6b55e7


--

___
Python tracker 

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



[issue31053] Unnecessary argument in command example

2017-10-26 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue31053] Unnecessary argument in command example

2017-10-26 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset d609b0c24ebdb748cabcc6c062dfc86f9000e6c4 by Berker Peksag 
(cocoatomo) in branch 'master':
bpo-31053: Remove redundant 'venv' argument in venv example (GH-2907)
https://github.com/python/cpython/commit/d609b0c24ebdb748cabcc6c062dfc86f9000e6c4


--
nosy: +berker.peksag

___
Python tracker 

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



[issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows

2017-10-26 Thread Eryk Sun

Eryk Sun  added the comment:

A C/C++ program returns EXIT_FAILURE for a generic failure. Microsoft defines 
this macro value as 1. Most tools that a user might use to forcibly terminate a 
process don't allow specifying the reason; they just use the generic value of 
1. This includes Task Manager, taskkill.exe /f, the WDK's kill.exe -f, and 
Sysinternals pskill.exe and Process Explorer. subprocess and multiprocessing 
should also use 1 to be consistent.

The system itself doesn't distinguish a forced termination from a normal exit. 
Ultimately every thread and process gets terminated by the system calls 
NtTerminateThread and NtTerminateProcess (or the equivalent Process Manager 
private functions PspTerminateThreadByPointer, PspTerminateProcess, etc). 
Windows API TerminateThread and TerminateProcess are light wrappers around the 
corresponding system calls.

ExitThread and ExitProcess (actually implemented as RtlExitUserThread and 
RtlExitUserProcess in ntdll.dll) are within-process calls that integrate with 
the loader's LdrShutdownThread and LdrShutdownProcess routines. This allows the 
loader to call the entry points for loaded DLLs with DLL_THREAD_DETACH or 
DLL_PROCESS_DETACH, respectively. ExitThread also handles deallocating the 
thread's stack. Beyond that, the bulk of the work is handled by 
NtTerminateThread and NtTerminateProcess. For ExitProcess, NtTerminateProcess 
is actually called twice -- the first time it's called with a NULL process 
handle to kill the other threads in the current process. After 
LdrShutdownProcess returns, NtTerminateProcess is called again to truly 
terminate the process.

> PowerShell and .NET ... `System.Diagnostics.Process.Kill()` ... 
> `TerminateProcess` is called with -1

.NET is in its own (cross-platform) managed-code universe. I don't know why the 
developers decided to make Kill() use -1 (0x) as the exit code. I can 
guess that they negated the conventional EXIT_FAILURE value to indicate a 
signal-like kill. I think it's an odd decision, and I'm not inclined to favor 
it over behaviors that predate the existence of .NET. 

Making the ExitCode property a signed integer in .NET is easy to understand, 
and not a cause for concern since it's only a matter of interpretation. Note 
that the return value from wmain() or wWinMain() is a signed integer. Also, the 
two fundamental status result types in Windows -- NTSTATUS [1] and HRESULT [2] 
-- are 32-bit signed integers (warnings and errors are negative). Internally, 
the NT Process object's EPROCESS structure defines ExitStatus as an NTSTATUS 
value. You can see in a kernel debugger that it's a 32-bit signed integer 
(Int4B):

lkd> dt nt!_eprocess ExitStatus
   +0x624 ExitStatus : Int4B

Python also wants the exit code to be a signed value. If we try to exit with an 
unsigned value that exceeds 0x7FFF_, it instead uses a default code of -1 
(0x_). For example:

>>> hex(subprocess.call('python -c "raise SystemExit(0x8000_)"'))
'0x'

Using the corresponding signed integer works fine:

>>> 0x8000_ - 2**32
-2147483648
>>> hex(subprocess.call('python -c "raise SystemExit(-2_147_483_648)"'))
'0x8000'

[1]: https://msdn.microsoft.com/en-us/library/cc231200
[2]: https://msdn.microsoft.com/en-us/library/cc231198


> termination by a signal "terminates the calling program with 
> exit code 3"

MS C raise() defaults to calling exit(3). I don't know why it uses the value 3; 
it's a legacy value from the MS-DOS era. Python doesn't directly expose C 
raise(), so this exit code only occurs in rare circumstances.

Note that SIGINT and SIGBREAK are based on console control events, and in this 
case the default behavior (i.e. SIG_DFL) is not to call exit(3) but rather to 
continue to the next registered console control handler. This is normally the 
Windows default handler (i.e. kernelbase!DefaultHandler), which calls 
ExitProcess with STATUS_CONTROL_C_EXIT. When closing the console itself (i.e. 
CTRL_CLOSE_EVENT), if a control handler in a console client returns TRUE, the 
default handler doesn't get called, but (starting with NT 6.0) the process 
still has to be terminated. In this case the session server, csrss.exe, calls 
NtTerminateProcess with STATUS_CONTROL_C_EXIT.

The exit code also isn't normally 3 for SIGABRT when abort() (i.e. os.abort in 
Python) gets called. In a release build, abort() defaults to using the 
__fastfail intrinsic (i.e. INT 0x29 on x64 systems) with the code 
FAST_FAIL_FATAL_APP_EXIT. This terminates the process with a 
STATUS_STACK_BUFFER_OVERRUN exception. By design, a __fastfail exception cannot 
be handled. An attached debugger only sees it as a second-chance exception. 
(Ideally they should have split this functionality into multiple status codes, 
since a __fastfail isn't necessarily due to a stack buffer overrun.) The 
error-reporting dialog may change the exit status to 255 in this case, but you 
can suppress this dialog 

[issue31860] IDLE: Make font sample editable

2017-10-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Thanks for the patch.  Adding the feature is somehow easier than I expected.  
After moving the sample text to module level, which I considered doing before, 
saving edits for the duration of an IDLE session turned out to also be easy.  

With 11 point Lucida Console, there is room for 5 more lines, without erasing 
anything, before anything scrolls off the top.

I expect that saving changes across IDLE sessions would be much harder and 
likely not worth the effort.  I think that exploring font choices is likely 
rare enough that there is little need to do so.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue31881] subprocess.returncode not set depending on arguments to subprocess.run

2017-10-26 Thread Nick

Nick  added the comment:

I have verified that

$ mpirun -np 4 myexe.x moreargs; echo $?
1

--

___
Python tracker 

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



[issue31858] IDLE: cleanup use of sys.ps1 and never set it.

2017-10-26 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
pull_requests: +4109
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



[issue31881] subprocess.returncode not set depending on arguments to subprocess.run

2017-10-26 Thread R. David Murray

R. David Murray  added the comment:

If you run

  mpirun -np 4 myexe.x moreargs; echo $?

in /bin/sh, what do you see?  You also might try to make sure it is the same 
mpirun and the same myexe.x that is being called in both cases (it is the 
mpirun return code you are seeing).

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



[issue31858] IDLE: cleanup use of sys.ps1 and never set it.

2017-10-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I put the new shell variables into PyShell itself.  There is usually only one 
instance created in a session.

I tested the patch manually in both shell and editor with both the default 
prompt and with sys.ps1 set before importing idlelib.idle.  Beginning to 
automate tests for editor and shell is a project in itself.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue31858] IDLE: cleanup use of sys.ps1 and never set it.

2017-10-26 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
keywords: +patch, patch
pull_requests: +4107, 4108
stage: test needed -> patch review

___
Python tracker 

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



[issue31858] IDLE: cleanup use of sys.ps1 and never set it.

2017-10-26 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +4107
stage: test needed -> patch review

___
Python tracker 

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



[issue31881] subprocess.returncode not set depending on arguments to subprocess.run

2017-10-26 Thread Nick

New submission from Nick :

If subprocess.run is called with a single string, say:

completed_ps = subprocess.run('mpirun -np 4 myexe.x moreargs', shell=True)

and 'myexe.x moreargs' fails with a returncode of 1, then 
'completed_ps.returncode' is None. However, if we split the args with shlex, we 
obtain the desired result, which is a returncode of 1:

import shlex
args = shlex.split('mpirun -np 4 myexe.x moreargs')
completed_ps = subprocess.run(args)
# now completed_ps.returncode = 1 if myexe.x moreargs fails.

Reproduced on Mac, Ubuntu 17.04, Python 3.6.1 and Python 3.6.3.

--
messages: 305094
nosy: nthompson
priority: normal
severity: normal
status: open
title: subprocess.returncode not set depending on arguments to subprocess.run
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



[issue31415] Add -X option to show import time

2017-10-26 Thread INADA Naoki

INADA Naoki  added the comment:

Does it worth enough?
I didn't think it's worth enough because import will be much slower than one 
dict lookup.

--

___
Python tracker 

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



[issue24459] Mention PYTHONFAULTHANDLER in the man page

2017-10-26 Thread Berker Peksag

Change by Berker Peksag :


--
versions:  -Python 3.5

___
Python tracker 

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



[issue24459] Mention PYTHONFAULTHANDLER in the man page

2017-10-26 Thread Berker Peksag

Change by Berker Peksag :


--
pull_requests: +4106

___
Python tracker 

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



[issue30989] Sort only when needed in TimedRotatingFileHandler's getFilesToDelete

2017-10-26 Thread Berker Peksag

Change by Berker Peksag :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you for your patch Ivan.

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 8c83c23fa32405aa9212f028d234f4129d105a23 by Serhiy Storchaka 
(Ivan Levkivskyi) in branch 'master':
bpo-28936: Detect lexically first syntax error first (#4097)
https://github.com/python/cpython/commit/8c83c23fa32405aa9212f028d234f4129d105a23


--

___
Python tracker 

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



[issue25729] update pure python datetime.timedelta creation

2017-10-26 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Brian, is this still relevant?  If so, cab you submit a pull request?

--
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

> Is it correct that the parameter can be annotated in the function body?

I agree with Guido, this is rather a task for type checkers.

--

___
Python tracker 

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



[issue31803] time.clock() should emit a DeprecationWarning

2017-10-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

On 26.10.2017 13:46, Serhiy Storchaka wrote:
> 
> It is very bad, that the function with such attractive name has different 
> meaning on Windows and Unix. I'm sure that virtually all uses of clock() are 
> broken because its behavior on other platform than used by the author of the 
> code.

Not really, no. People who write cross-platform code are well
aware of the differences of time.clock() and people who just
write for one platform know how the libc function of the same
function works on their platform.

Unix: http://man7.org/linux/man-pages/man3/clock.3.html
Windows: https://msdn.microsoft.com/en-us/library/4e2ess30.aspx

--

___
Python tracker 

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



[issue31430] [Windows][2.7] Python 2.7 compilation fails on mt.exe crashing with error code C0000005

2017-10-26 Thread David Bolen

David Bolen  added the comment:

Sure, I can certainly do that.

Does "basically a requirement" mean it should have been there all along (with 
the VC9 installation), or just that trying to use VC9 on a recent system like 
Win 10 safely requires it installed separately?  I guess Win 8 was the first 
version to default to only having 4+ already installed.

Oh, any preference between using the OS component setup (windows features) to 
install vs. downloading an installer?  I was thinking of using the features 
approach since it's easy to document as a requirement for anyone else.  I doubt 
there's much difference in the end result.

--

___
Python tracker 

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



[issue20486] msilib: can't close opened database

2017-10-26 Thread Berker Peksag

Change by Berker Peksag :


--
pull_requests: +4105

___
Python tracker 

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

Those seem things that the type checker should complain about, but I don't 
think Python should.

--

___
Python tracker 

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



[issue28281] Remove year limits from calendar

2017-10-26 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:


New changeset 66c88ce30ca2b23daa37038e1a3c0de98f241f50 by Alexander Belopolsky 
in branch 'master':
Closes bpo-28281: Remove year (1-) limits on the weekday() function. (#4109)
https://github.com/python/cpython/commit/66c88ce30ca2b23daa37038e1a3c0de98f241f50


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



[issue24920] shutil.get_terminal_size throws AttributeError

2017-10-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Uh, sorry for the noise. I see now that shutil was already patched by Victor 
and you in #26801, so that it already works with IDLE started from an icon.  So 
now I don't understand your last comment, "Patching shutil will help for 
pandas."

--
resolution:  -> duplicate
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue24920] shutil.get_terminal_size throws AttributeError

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think it is better to open a new issue for a new feature. The bug reported in 
this issue two years ago already is fixed.

--

___
Python tracker 

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



[issue24920] shutil.get_terminal_size throws AttributeError

2017-10-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I am preparing a PR for shutil.get_window_size.  Pyplot should probably call 
that instead of the os version.

--

___
Python tracker 

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



[issue30553] Add HTTP Response code 421

2017-10-26 Thread Berker Peksag

Berker Peksag  added the comment:

Thank you Julien (for the report) and Vitor (for the patch)

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue30553] Add HTTP Response code 421

2017-10-26 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset 52ad72dd0a5a56414cc29b7c9b03259169825f35 by Berker Peksag (Vitor 
Pereira) in branch 'master':
bpo-30553: Add status code 421 to http.HTTPStatus (GH-2589)
https://github.com/python/cpython/commit/52ad72dd0a5a56414cc29b7c9b03259169825f35


--
nosy: +berker.peksag

___
Python tracker 

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



[issue24920] shutil.get_terminal_size throws AttributeError

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Patching shutil will help for pandas.

--

___
Python tracker 

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



[issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols

2017-10-26 Thread Zachary Ware

Change by Zachary Ware :


--
pull_requests:  -4103

___
Python tracker 

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



[issue24920] shutil.get_terminal_size throws AttributeError

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What do you want to do Terry?

--

___
Python tracker 

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



[issue31811] async and await missing from keyword list in lexical analysis doc

2017-10-26 Thread Tom Floyer

Tom Floyer  added the comment:

I've added those keywords to documentation master branch.

--
nosy: +tomfloyer
pull_requests: +4104

___
Python tracker 

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



[issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols

2017-10-26 Thread Tom Floyer

Change by Tom Floyer :


--
pull_requests: +4103

___
Python tracker 

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



[issue24920] shutil.get_terminal_size throws AttributeError

2017-10-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

If one starts IDLE from a command-line console (python -m idlelib) or Python 
console (import idlelib.idle), sys.__stdout__ is the TextIOWraper for that 
console and .fileno() returns 1.  .get_terminal_size() will then return the 
console size.  The exception occurs when IDLE is  started from an icon.

Implementing David's suggestion for shutil will be easy: insert just before the 
fileno call
if not sys.__stdout__: raise ValueError()
This is what os.get_terminal_size() raises on IDLE.  Comments in the code in 
posixpath.c make it clear that this is intended guis and the low_level os 
function.

This came up today on Stackoverflow when someone tried to use 
matplotlib.pyplot, which calls os.get_terminal_size, on IDLE.
https://stackoverflow.com/questions/46921087/pyplot-with-idle
(Patching shutil will not help for the os call.)

--
resolution: out of date -> 
stage: resolved -> test needed
status: closed -> open

___
Python tracker 

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



[issue20486] msilib: can't close opened database

2017-10-26 Thread xoviat

xoviat  added the comment:

Unfortunately, this issue has taken on a much lower importance for me, and
as such, I won't be able to address it. Sorry about that.

2017-10-26 0:01 GMT-05:00 Berker Peksag :

>
> Berker Peksag  added the comment:
>
> xoviat, would you like to send your patch as a pull request on GitHub? It
> would be nice to add a simple test that the new Close() works correctly. I
> can do that if you don't have time, thank you!
>
> Steve, can we apply this to bugfix branches?
>
> --
> versions:  -Python 3.5
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue16135] Removal of OS/2 support

2017-10-26 Thread Erik Bray

Change by Erik Bray :


--
pull_requests: +4102

___
Python tracker 

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



[issue31430] [Windows][2.7] Python 2.7 compilation fails on mt.exe crashing with error code C0000005

2017-10-26 Thread Steve Dower

Steve Dower  added the comment:

Are you able to install .NET 3.5 on the Windows 10 machine? This is basically a 
requirement for the VC9 toolset (it's compatible with .NET 2.0 so should fulfil 
that requirement).

--

___
Python tracker 

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



[issue31880] subprocess process interaction with IDLEX GUI causes pygnuplot silent failures

2017-10-26 Thread John Brearley

New submission from John Brearley :

There is an interesting interaction between the IDLEX GUI and subprocess module 
that causes pygnuplot silent failures. The example.py script below works fine 
when run from the WinPython Command Prompt.exe terminal window. The script will 
popup a new window from gnuplot with the desired graph, and in the same 
directory save the generated raw data as example.out and the generated graph as 
example.pdf. If you erase the generated files and then run the same script via 
the IDLEX GUI, there is no graph window created and only the raw data 
example.out file is created. There are no error messages.

The PyGnuplot module sets up a subprocess.Popen pipe as persistant connection 
to the gnuplot.exe utility. This allows the top level script to send multiple 
commands to gnuplot to compose the desired graph, and then finally save the 
file to disk. This all works fine when run from the WinPython Command 
Prompt.exe terminal window. However something subtle is breaking when the same 
script is run from the IDLEX GUI environment. It is not at all obvious if the 
subprocess module is not as forgiving as it needs to be of the IDLEX GUI input 
or if the IDLEX GUI is breaking the rules somewhere. I will start by asking the 
subprocess module team to comment.

I did try adding some trace code to the PyGnuplot.py module. In particular I 
turned on stdout=subprocess.PIPE  and stderr=subprocess.PIPE. I did proc.poll() 
before/after the command is sent to gnuplot. Interestingly, when I did 
proc.communicate(timeout=0) to do an immediate read for any stdout/err data, 
this seems to cause the
 subsequent write to the pipe.stdin to fail, saying the file is already closed. 
In another learning exercise script for subprocess, the communicate() method 
does not seem to interfere with the pipe behavior.

This issue is quite repeatable on demand. I set up a second PC and reproduced 
the issue on demand on the second PC. I am using WinPython 3.6.1 on Windows 7 
with gnuplot 5.2.0 on both PC.

Here are the links to the various components needed to setup the environment to 
reproduce this issue:
1) gnuplot 5.2.0   https://sourceforge.net/projects/gnuplot/files/gnuplot/5.2.0/
2) pygnuplot 0.10.0  https://pypi.python.org/pypi/PyGnuplot/0.10.0
3) There is a one-line fix to PyGnuplot.py needed   
https://github.com/benschneider/PyGnuplot/blob/master/PyGnuplot.py
4) example.py script  
https://github.com/benschneider/PyGnuplot/blob/master/example.py

WinPython 3.6.1 installer comes with subprocess.py as part of the package, no 
version info that I can find.

When installing gnuplot there is an advanced option to check on that will 
automatically update your PATH variable. If you dont do this, then you must 
manully add "C:\gnuplot\bin" (or whatever the directory is)
 to your PATH variable. To check if gnuplot is correctly installed, from a DOS 
prompt terminal window, type "gnuplot -V". You should get a one line response 
"gnuplot 5.2 patchlevel 0".

--
components: Interpreter Core, Windows
messages: 305073
nosy: jbrearley, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: subprocess process interaction with IDLEX GUI causes pygnuplot silent 
failures
type: behavior
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



[issue30904] Python 3 logging HTTPHandler sends duplicate Host header

2017-10-26 Thread Vinay Sajip

Change by Vinay Sajip :


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



[issue31879] Launcher fails on custom command starting with "python"

2017-10-26 Thread Robert

New submission from Robert :

In the "py.ini" file it is possible to specifiy customized commands (see 
https://www.python.org/dev/peps/pep-0397/#customized-commands).

Unfortunately it is not possible to specify custom commands beginning with  one 
of the buildin names (i.e. "python" or "/usr/bin/python"). 

This means that if I want to provide a virtual command like "python-xyz" I get 
an error message "Invalid version specification: '-xyz'" instead of running the 
executable assigned to python-xyz.

I would provide a Pullrequest if you accept this change in behaviour.

--
components: Windows
messages: 305072
nosy: mrh1997, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Launcher fails on custom command starting with "python"
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The importtime option is cached only if it is set. If it is not set (the common 
case), it is not cached.

PR 4138 makes it be cached in the common case and improves errors handling.

--
status: closed -> open

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-10-26 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4101

___
Python tracker 

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



[issue23990] Callable builtin doesn't respect descriptors

2017-10-26 Thread Ionel Cristian Mărieș

Ionel Cristian Mărieș  added the comment:

Alright, now it makes sense. Thank you for writing a thoughtful response.

--

___
Python tracker 

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



[issue23990] Callable builtin doesn't respect descriptors

2017-10-26 Thread R. David Murray

R. David Murray  added the comment:

Ionel please give commenters the benefit of the doubt.  In this case, Raymond 
is merely articulating our policy: if something is in pre-PEP stage we don't 
generally keep issues open in the tracker.  We open issues for PEPs when they 
get to the implementation stage.

So, if you want to pursue this, the best forum is the python-ideas mailing 
list, followed eventually by the python-dev mailing list.  That is the best way 
to get visibility, not through a bug tracker with thousands of open issues.

--
status: open -> closed

___
Python tracker 

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



[issue31873] Inconsistent capitalization of proper noun - Unicode.

2017-10-26 Thread R. David Murray

R. David Murray  added the comment:

In this case I think the cost of editing for consistency may be higher than the 
value, especially since as you say there are ambiguous cases.

--

___
Python tracker 

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



[issue31877] Build fails on Cython since issue28180

2017-10-26 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> ncoghlan
components: +Interpreter Core, Windows
nosy: +paul.moore, steve.dower, tim.golden

___
Python tracker 

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



[issue22898] segfault during shutdown attempting to log ResourceWarning

2017-10-26 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Fixed by issue 30697.

--
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.5

___
Python tracker 

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



[issue31828] Support Py_tss_NEEDS_INIT outside of static initialisation

2017-10-26 Thread Erik Bray

Change by Erik Bray :


--
nosy: +erik.bray

___
Python tracker 

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



[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-10-26 Thread Xavier de Gaye

Change by Xavier de Gaye :


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



[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-10-26 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset 4b27d51222be751125e6800453a39360a2dec11d by xdegaye in branch 
'3.6':
[3.6] bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327). 
(#4135)
https://github.com/python/cpython/commit/4b27d51222be751125e6800453a39360a2dec11d


--

___
Python tracker 

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



[issue31878] Cygwin: _socket module does not compile due to missing ioctl declaration

2017-10-26 Thread Erik Bray

Change by Erik Bray :


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

___
Python tracker 

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



[issue31878] Cygwin: _socket module does not compile due to missing ioctl declaration

2017-10-26 Thread Erik Bray

New submission from Erik Bray :

On Cygwin, ioctl() is found in sys/ioctl.h (as on Darwin).  Without adding 
something to the effect of

#ifdef __CYGWIN__
# include 
#endif

the _socket module cannot compile on Cygwin.  A fix was this was included in 
the (rejected) https://bugs.python.org/issue29718; this issue is just as a 
reminder that it remains an issue and to have a bug report to attach a more 
focused PR to.

--
messages: 305065
nosy: erik.bray
priority: normal
severity: normal
status: open
title: Cygwin: _socket module does not compile due to missing ioctl declaration
type: compile error

___
Python tracker 

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



[issue2445] Use The CygwinCCompiler Under Cygwin

2017-10-26 Thread Erik Bray

Change by Erik Bray :


--
pull_requests: +4099
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



[issue23990] Callable builtin doesn't respect descriptors

2017-10-26 Thread Ionel Cristian Mărieș

Ionel Cristian Mărieș  added the comment:

It should be open for getting some visibility, as I need some help here -  
Raymond, I hope you can find a way to be hospitable here and stop with the 
kindergarten behavior.

--
status: closed -> open

___
Python tracker 

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



[issue31877] Build fails on Cython since issue28180

2017-10-26 Thread STINNER Victor

Change by STINNER Victor :


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



[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-10-26 Thread Xavier de Gaye

Change by Xavier de Gaye :


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

___
Python tracker 

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



[issue23990] Callable builtin doesn't respect descriptors

2017-10-26 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Marking as closed.  This can be reopened if a PEP is submitted and is favorably 
received.

--
assignee: rhettinger -> 
status: open -> closed
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



[issue31877] Build fails on Cython since issue28180

2017-10-26 Thread Zachary Ware

Change by Zachary Ware :


--
nosy: +haypo, ncoghlan, zach.ware

___
Python tracker 

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



[issue31873] Inconsistent capitalization of proper noun - Unicode.

2017-10-26 Thread David Antonini

David Antonini  added the comment:

Does the Unicode documentation currently conform to that convention, or does it 
require editing? 

It appears to me that a lot of cases where reference to "Unicode object" is 
currently capitalised (most of them, in fact) may need to be modified. 
However, it would seem that there is a grey area in making a distinction 
between reference to the unicode type as implemented in Python and reference to 
the standard as a descriptor of the format of an object? The way I read there a 
lot of the cases are in essence a reference to both.

--

___
Python tracker 

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



[issue31877] Build fails on Cython since issue28180

2017-10-26 Thread Erik Bray

Change by Erik Bray :


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

___
Python tracker 

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



[issue31877] Build fails on Cython since issue28180

2017-10-26 Thread Erik Bray

New submission from Erik Bray :

I'm trying once again to get the test suite up to snuff on Cygwin so I can 
start running a buildbot (particularly now that PEP 539 is done).  However, as 
of issue28180 the build fails with:

gcc-o python.exe Programs/python.o libpython3.7m.dll.a -lintl -ldl-lm
Programs/python.o: In function `main':
./Programs/python.c:81: undefined reference to `_Py_LegacyLocaleDetected'
./Programs/python.c:81:(.text.startup+0x86): relocation truncated to fit: 
R_X86_64_PC32 against undefined symbol `_Py_LegacyLocaleDetected'
./Programs/python.c:82: undefined reference to `_Py_CoerceLegacyLocale'
./Programs/python.c:82:(.text.startup+0x19f): relocation truncated to fit: 
R_X86_64_PC32 against undefined symbol `_Py_CoerceLegacyLocale'
collect2: error: ld returned 1 exit status

It seems _Py_LegacyLocaleDetected and _PyCoerceLegacyLocale are missing the 
necessary PyAPI_FUNC declarations in pylifecycle.h.

--
messages: 305061
nosy: erik.bray
priority: normal
severity: normal
status: open
title: Build fails on Cython since issue28180
type: compile error

___
Python tracker 

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



[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The current code OBVIOUSLY is wrong. Bytes are erased if q == oldq && nbytes < 
original_nbytes. But q == oldq only if realloc() returns the new address 
2*sizeof(size_t) bytes larger than its argument. This is virtually never happen 
on other platforms because _PyMem_DebugRawRealloc() usually used with blocks 
larger than 2*sizeof(size_t) bytes and the system realloc() don't shrink the 
block at left (this is implementation detail). Thus this code is virtually dead 
on other platforms. It doesn't detect shrinking memory block in-place.

After fixing *this* bug, we have encountered with *other* bug, related to 
overwriting the freed memory.

I don't see reasons of keeping an obviously wrong code. When fix the first bug 
we will need to fix the other bug.

--

___
Python tracker 

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



[issue31876] python363.chm includes gibberish

2017-10-26 Thread Hery

New submission from Hery :

Just Open https://www.python.org/ftp/python/3.6.3/python363.chm 

And click the first page, it says "What抯 New in Python". And most of pages the 
chm file include some gibberish.

--
assignee: docs@python
components: Documentation
messages: 305059
nosy: Nim, docs@python
priority: normal
severity: normal
status: open
title: python363.chm includes gibberish
type: behavior
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



[issue31875] Error 0x80070642: Failed to install MSI package.

2017-10-26 Thread Gareth Moger

Change by Gareth Moger :


Added file: https://bugs.python.org/file47241/Python 3.6.1 
(32-bit)_20171026151143.log

___
Python tracker 

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



[issue31875] Error 0x80070642: Failed to install MSI package.

2017-10-26 Thread Gareth Moger

New submission from Gareth Moger :

I had my work computer re-imaged this week but Python 3.6.1 is gone and I am 
unable to install.

I have tried to completely remove it with CCleaner and any other references I 
found but it still will not install.  I am installing the same version as 
before.

Following the advice from another post, I installed on another machine and then 
copied the folder onto my work machine but was unable to uninstall/repair as 
described.

Attached is the log file.

--
components: Installation
files: Python 3.6.1 (32-bit)_20171026151143.log
messages: 305058
nosy: Gareth Moger
priority: normal
severity: normal
status: open
title: Error 0x80070642: Failed to install MSI package.
versions: Python 3.6
Added file: https://bugs.python.org/file47240/Python 3.6.1 
(32-bit)_20171026151143.log

___
Python tracker 

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



[issue31874] [feature] runpy.run_module should mimic script launch behavior for sys.path

2017-10-26 Thread Jason R. Coombs

Change by Jason R. Coombs :


--
components: +Library (Lib)

___
Python tracker 

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



[issue31874] [feature] runpy.run_module should mimic script launch behavior for sys.path

2017-10-26 Thread Jason R. Coombs

Change by Jason R. Coombs :


--
type:  -> enhancement

___
Python tracker 

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



[issue31874] [feature] runpy.run_module should mimic script launch behavior for sys.path

2017-10-26 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

At first, I didn't understand why one wouldn't simply omit sys.path[0], similar 
to what scripts do, but then I realized that Nick was aware of a common 
use-case that I was overlooking - that `python -m` may be used to launch 
behavior in a local package - in which case it's relevant and important that 
sys.path[0] == ''.

--

___
Python tracker 

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



[issue23990] Callable builtin doesn't respect descriptors

2017-10-26 Thread Ionel Cristian Mărieș

Ionel Cristian Mărieș  added the comment:

Hello everyone,

Is anyone still interested in fixing this bug and help with whatever PEP 
drafting was needed for convincing people?

I would sketch up a draft but for me at least it's not clear what are the 
disadvantages of not fixing this, so I could use some help making a unbiased 
document that won't attract tons of negativity and contempt (yet again).

--
status: closed -> open

___
Python tracker 

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



[issue16737] Different behaviours in script run directly and via runpy.run_module

2017-10-26 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I've filed a separate request here for the sys.path[0] aspect: 
https://bugs.python.org/issue31874

--

___
Python tracker 

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



[issue31874] [feature] runpy.run_module should mimic script launch behavior for sys.path

2017-10-26 Thread Jason R. Coombs

New submission from Jason R. Coombs :

In [this comment](https://bugs.python.org/issue16737#msg282872) I describe an 
issue whereby launching an application via runpy.run_module (aka python -m) 
produces different and unexpected behavior than running the same app via an 
entry script.

In [this followup comment](https://bugs.python.org/issue16737#msg304662), I 
provide more detail on why a user might expect for run_module to mimic the 
behavior of launching a script.

[Nick suggests](https://bugs.python.org/issue16737#msg304707):

> Update sys.path[0] based on __main__.__spec__.origin after [resolving] 
> __main__.__spec__. That way it will only stay as the current directory if the 
> module being executed is in a subdirectory of the current directory, and will 
> otherwise be updated appropriately for wherever we actually found the main 
> module.

--
messages: 305054
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: [feature] runpy.run_module should mimic script launch behavior for 
sys.path
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



[issue31873] Inconsistent capitalization of proper noun - Unicode.

2017-10-26 Thread R. David Murray

R. David Murray  added the comment:

It may be a proper noun, but it is conventionally spelled with a lowercase 
letter when referring to the type/object.  It would be spelled with an upper 
case letter when referring to the *standard*.

--

___
Python tracker 

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



[issue16737] Different behaviours in script run directly and via runpy.run_module

2017-10-26 Thread Isaiah Peng

Isaiah Peng  added the comment:

Not sure if it's stated before, this difference of behavior also has other 
effects, e.g.

$ python -m test.test_traceback

# Ran 61 tests in 0.449s
# FAILED (failures=5)

This is because the loader associated with the module get confused, it loaded 
the original module as the proper module and then the module changed name to 
__main__ but the loader is still associated with the old module name, so call 
to `get_source` fails.

$ cat > test_m.py
print(__loader__.get_source(__name__))

$ python -m test_m

# ImportError: loader for test_m cannot handle __main__

--
nosy: +isaiah

___
Python tracker 

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



[issue31873] Inconsistent capitalization of proper noun - Unicode.

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I agree that the inconsistency should be fixed. But I'm not sure that we should 
use the words "an Unicode object" in Python 3.

In many similar cases ("a bytes object", "a type object", "a module object") 
the name of Python type is used. "unicode" was a name of Python type in Python 
2. In Python 3 it is "str". The term "Unicode string" also is widely used. 
Should not we use "a str object", "a string object", "a Unicode string" or "a 
Unicode string object" in the C API documentation?

--
components: +Unicode
nosy: +benjamin.peterson, ezio.melotti, haypo, lemburg, martin.panter, 
r.david.murray, serhiy.storchaka
stage:  -> patch review
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



[issue31873] Inconsistent capitalization of proper noun - Unicode.

2017-10-26 Thread David Antonini

New submission from David Antonini :

Make 'unicode'/'Unicode' capitalization consistent.
'Unicode' is a proper noun, and as such should be capitalized. 

I submitted a pull request correcting the inconsistent capitalization in the 
Unicode page of the Documentation - Doc/c-api/unicode.rst - capitalizing 12 
errant instances to reflect the correct capitalization in most of the document. 
I was then requested to open an issue here for discussion.

--
assignee: docs@python
components: Documentation
messages: 305050
nosy: docs@python, toonarmycaptain
priority: normal
pull_requests: 4096
severity: normal
status: open
title: Inconsistent capitalization of proper noun - Unicode.
type: enhancement

___
Python tracker 

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



[issue31811] async and await missing from keyword list in lexical analysis doc

2017-10-26 Thread Tom Floyer

Change by Tom Floyer :


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



[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-10-26 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset 56d1f5ca32892c7643eb8cee49c40c1644f1abfe by xdegaye in branch 
'master':
bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327)
https://github.com/python/cpython/commit/56d1f5ca32892c7643eb8cee49c40c1644f1abfe


--

___
Python tracker 

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



[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-10-26 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Checking the test_exceptions test cases that are added by PR 2327 on the 
current master branch, before the merge of PR 2327:
* test_recursion_normalizing_exception still fails (SIGABRT on a debug build 
and SIGSEGV otherwise)
* test_recursion_normalizing_infinite_exception is ok as expected
* test_recursion_normalizing_with_no_memory still fails with a SIGSEGV

The attached script except_raises_except.py exercises case 3) described in 
msg231933. The output is as follows when PR 2327 is applied and confirms that 
the ResourceWarning is now printed:

Traceback (most recent call last):
  File "except_raises_except.py", line 11, in 
generator.throw(MyException)
  File "except_raises_except.py", line 7, in gen
yield
  File "except_raises_except.py", line 3, in __init__
raise MyException
  File "except_raises_except.py", line 3, in __init__
raise MyException
  File "except_raises_except.py", line 3, in __init__
raise MyException
  [Previous line repeated 495 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
sys:1: ResourceWarning: unclosed file <_io.FileIO 
name='except_raises_except.py' mode='rb' closefd=True>

--
versions:  -Python 3.5
Added file: https://bugs.python.org/file47239/except_raises_except.py

___
Python tracker 

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



[issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows

2017-10-26 Thread Akos Kiss

Akos Kiss  added the comment:

A follow-up: in addition to `taskkill`, I've taken a look at another "official" 
way for killing processes, the `Stop-Process` PowerShell cmdlet 
(https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/stop-process?view=powershell-5.1).
 Yet again, documentation is scarce on what the exit code of the terminated 
process will be. But PowerShell and .NET code base is open sourced, so I've dug 
a bit deeper and found that `Stop-Process` is based on 
`System.Diagnostics.Process.Kill()` 
(https://github.com/PowerShell/PowerShell/blob/master/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs#L1240),
 while `Process.Kill()` uses the `TerminateProcess` Win32 API 
(https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs#L93).
 Interestingly, `TerminateProcess` is called with -1 (this was surprising, to 
me at least, as exit code is unsigned on Windows AFAIK).

Therefore, I've added two new "kill" implementations to my original code 
experiment (wont repeat the whole code here, just the additions):

```py
def kill_with_taskkill(proc):
print('kill child with taskkill /F')
subprocess.run(['taskkill', '/F', '/pid', '%s' % proc.pid], check=True)

def kill_with_stopprocess(proc):
print('kill child with powershell stop-process')
subprocess.run(['powershell', 'stop-process', '%s' % proc.pid], check=True)
```

And I got:

```
run subprocess child with subprocess-taskkill
child process started with subprocess-taskkill
kill child with taskkill /F
SUCCESS: The process with PID 4024 has been terminated.
child terminated with 1
run subprocess child with subprocess-stopprocess
child process started with subprocess-stopprocess
kill child with powershell stop-process
child terminated with 4294967295

run multiprocessing child with multiprocessing-taskkill
child process started with multiprocessing-taskkill
kill child with taskkill /F
SUCCESS: The process with PID 5988 has been terminated.
child terminated with 1
run multiprocessing child with multiprocessing-stopprocess
child process started with multiprocessing-stopprocess
kill child with powershell stop-process
child terminated with 4294967295
```

My takeaways from the above are that
1) Windows is not consistent across itself,
2) 1 is not the only "valid" "terminated forcibly" exit code, and
3) negative exit code does not work, even if MS itself tries to use it.

BTW, I really think that killing a process with a code of 1 is questionable, as 
quite some apps return 1 themselves just to signal error (but proper 
termination). This makes it hard to tell applications' own error signaling and 
forced kills apart. But that's a personal opinion.

--

___
Python tracker 

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



[issue31803] time.clock() should emit a DeprecationWarning

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It is very bad, that the function with such attractive name has different 
meaning on Windows and Unix. I'm sure that virtually all uses of clock() are 
broken because its behavior on other platform than used by the author of the 
code. Adding a DeprecationWarning and finally removing it looks right thing to 
me. But we should keep it while 2.7 and versions older than 3.3 are in use.

--

___
Python tracker 

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is it correct that the parameter can be annotated in the function body?

def f(x):
x: int

Or that the local variable can be annotated after assignment?

def f():
x = 1
x: int

--

___
Python tracker 

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



[issue31872] SSL BIO is broken for internationalized domains

2017-10-26 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
type:  -> behavior

___
Python tracker 

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



[issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows

2017-10-26 Thread Akos Kiss

Akos Kiss  added the comment:

`taskkill /F` sets exit code to 1, indeed. (Confirmed by experiment. Cannot 
find this behaviour documented, though.)

On the other hand, MS Docs state 
(https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/signal#remarks)
 that termination by a signal "terminates the calling program with exit code 
3". (So, there may be other "valid" exit codes, too.)

--

___
Python tracker 

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



[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-26 Thread STINNER Victor

STINNER Victor  added the comment:

"PR 4119 is too complex for a bugfix (especially if backport it to 3.5 and 
3.4). It can introduce other regressions."

Which kind of regression do you expect? Something like a crash?


"The performance hit is not the only issue. Allocating a temporary buffer can 
change the structure of "holes" in memory. As result some memory related bugs 
can be reproducible only in release mode."

Can you please elaborate how the exact memory layout can trigger or not bugs in 
the code?

I'm not saying that you are right or wrong. I just fail to see why the memory 
address and "holes" would trigger or not bugs.

What I can understand is a subtle behaviour change if realloc() returns the 
same memory block or a new memory block. But we cannot control that.

I'm not sure that allocating "copy" before realloc() would impact the behaviour 
of realloc(). The common case is that a memory block is a few bytes smaller, 
and so the realloc returns the same memory block, but now becomes able to use 
the unallocated bytes for a new allocation later, no?


"Maybe it is enough to erase only few bytes at the start and end of the freed 
area. The copy can be saved in local variables, without involving the heap. 
This solution still will be enough complex, and I think it can be applied only 
to 3.7. But the bug should be fixed in all affected versions."

If we must make a choice, I would prefer to keep the current behaviour: make 
sure that unallocated bytes are erased. Catching code reading unallocated bytes 
is the most important feature of debug hooks, no?

I dislike the idea of only erasing "some" bytes: this change may prevent to 
detect some bugs.

--

___
Python tracker 

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



[issue31872] SSL BIO is broken for internationalized domains

2017-10-26 Thread Andrew Svetlov

New submission from Andrew Svetlov :

`SSLContext.wrap_bio` creates a new `SSLObject` instance with passed 
`server_hostname`.
The name becomes IDNA-decoded: `'xn--2qq421aovb6v1e3pu.xn--j6w193g'` is 
converted to `'雜草工作室.香港'` by `SSLObject` constructor.

Than on SSL handshake `ssl.match_hostname()` is called with 
`sslobject.server_hostname` parameter (`'雜草工作室.香港'` in my example).

But certificate for the site is contains IDNA-encoded DNS names:
```
{'OCSP': ('http://ocsp.comodoca4.com',),
 'caIssuers': 
('http://crt.comodoca4.com/COMODOECCDomainValidationSecureServerCA2.crt',),
 'crlDistributionPoints': 
('http://crl.comodoca4.com/COMODOECCDomainValidationSecureServerCA2.crl',),
 'issuer': ((('countryName', 'GB'),),
(('stateOrProvinceName', 'Greater Manchester'),),
(('localityName', 'Salford'),),
(('organizationName', 'COMODO CA Limited'),),
(('commonName',
  'COMODO ECC Domain Validation Secure Server CA 2'),)),
 'notAfter': 'Mar 28 23:59:59 2018 GMT',
 'notBefore': 'Sep 19 00:00:00 2017 GMT',
 'serialNumber': 'FBFE0BF7CACA6DDC15968410BAA1908D',
 'subject': ((('organizationalUnitName', 'Domain Control Validated'),),
 (('organizationalUnitName', 'PositiveSSL Multi-Domain'),),
 (('commonName', 'sni38752.cloudflaressl.com'),)),
 'subjectAltName': (('DNS', 'sni38752.cloudflaressl.com'),
('DNS', '*.1km.hk'),
('DNS', '*.acg-cafe.com'),
('DNS', '*.acgapp.moe'),
('DNS', '*.acgapp.net'),
('DNS', '*.cosmatch.org'),
('DNS', '*.dirimusik.com'),
('DNS', '*.dirimusik.info'),
('DNS', '*.downloadlagi.club'),
('DNS', '*.downloadlaguaz.info'),
('DNS', '*.farmprecision.com'),
('DNS', '*.glowecommercialphotography.co.uk'),
('DNS', '*.hypertechglobal.com'),
('DNS', '*.hypertechglobal.hk'),
('DNS', '*.infoku.download'),
('DNS', '*.inimp3.com'),
('DNS', '*.luciafitness.com.au'),
('DNS', '*.merdeka.news'),
('DNS', '*.promisecos.com'),
('DNS', '*.promisecos.hk'),
('DNS', '*.ps9architects.com'),
('DNS', '*.rubaxeu.gq'),
('DNS', '*.ruth-fox.com'),
('DNS', '*.simmit.net.au'),
('DNS', '*.startss.today'),
('DNS', '*.xn--2qq421aovb6v1e3pu.xn--j6w193g'),
('DNS', '*.xn--hhrw16aw6jizf.xn--j6w193g'),
('DNS', '1km.hk'),
('DNS', 'acg-cafe.com'),
('DNS', 'acgapp.moe'),
('DNS', 'acgapp.net'),
('DNS', 'cosmatch.org'),
('DNS', 'dirimusik.com'),
('DNS', 'dirimusik.info'),
('DNS', 'downloadlagi.club'),
('DNS', 'downloadlaguaz.info'),
('DNS', 'farmprecision.com'),
('DNS', 'glowecommercialphotography.co.uk'),
('DNS', 'hypertechglobal.com'),
('DNS', 'hypertechglobal.hk'),
('DNS', 'infoku.download'),
('DNS', 'inimp3.com'),
('DNS', 'luciafitness.com.au'),
('DNS', 'merdeka.news'),
('DNS', 'promisecos.com'),
('DNS', 'promisecos.hk'),
('DNS', 'ps9architects.com'),
('DNS', 'rubaxeu.gq'),
('DNS', 'ruth-fox.com'),
('DNS', 'simmit.net.au'),
('DNS', 'startss.today'),
('DNS', 'xn--2qq421aovb6v1e3pu.xn--j6w193g'),
('DNS', 'xn--hhrw16aw6jizf.xn--j6w193g')),
 'version': 3}
```

Match `'雜草工作室.香港'` to `('DNS', 'xn--2qq421aovb6v1e3pu.xn--j6w193g')` obviously 
fails.

I see two possible solutions:

1. Always do IDNA encoding for `server_hostname` stored in ssl object.
2. Do two checks for both IDNA and original server hostname values. I don't 
sure if certificates always use IDNA-encoded DNS names only.

The fix is trivial, I'll make a Pull Request after choosing what option we want 
to support. Personally I'm inclined to second one.

P.S.
`requests` library is not affected because it uses `ssl.wrap_socket`.
The bug is reproducible for `asyncio` only (and maybe Tornado with `asyncio` 
`IOLoop`).

--
assignee: christian.heimes
components: SSL
messages: 305042
nosy: asvetlov, christian.heimes, pitrou
priority: normal
severity: normal
status: open
title: SSL BIO is broken for internationalized domains
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

_

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-26 Thread STINNER Victor

STINNER Victor  added the comment:

"the bug should be fixed in all affected versions"

I don't understand why you insist to change Python 3.4 and Python 3.5. IMHO 
this issue only impacts OpenBSD.


"The current code in not correct on all platforms. We don't know how many of 
random bugs, hangs and crashes on other platforms are caused by this bug. I'm 
not surprised that it was caught on OpenBSD since the robustness and security 
of software is the goal of OpenBSD."

I'm not aware of these "random bugs, hangs and crashes on other platforms". Did 
you hear someone complaining about random crashes in Python?

We are running the Python suite multiple times per time on a large farm of 
buildbot workers. I  never saw the crashes that you mentionned.

IMHO it's very unlikely or impossible that _PyMem_DebugRawRealloc() erases 
bytes of a memory block that was just unallocated while another thread uses 
this new memory block for a new allocation. Most, if not all, calls to 
_PyMem_DebugRawRealloc() are protected by the GIL. If there is a single thread 
using the memory block, I think that it's perfectly fine to write after it's 
deallocated.

Well, maybe I'm plain wrong, and it's possible that shrinking a memory block 
makes the unallocator memory block really unaccessible, and that the memcpy() 
after the realloc() triggers a big crash. But I would like to *see* such crash 
to really be convinced :-)

--

___
Python tracker 

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



[issue31803] time.clock() should emit a DeprecationWarning

2017-10-26 Thread STINNER Victor

STINNER Victor  added the comment:

Alexander Belopolsky: "I was not aware of time.clock() depreciation before 
Victor brought this issue to my attention."

That's why the function now emits a DeprecationWarning :-)


Alexander Belopolsky: "time.clock() is a very well-known API eponymous to a 
venerable UNIX system call.  Its limitations and platform dependencies are very 
well-known as well."

I'm not sure with "platform dependencies are very well-known".

"clock" is a the most common name to "get the current time". The problem is 
that the exact clock used by time.clock() depends on the platforms, and that 
each clock has a different behaviour. That's where the PEP 418 tried to define 
correctly what are "clocks" when you care of the portability.


I'm not sure that we can find an agreement. This issue becomes annoying. I 
don't know what do do. Close the issue? Revert my commit? Ignore the discussion 
and work on something else? :-(

--

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-26 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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 2b5cbbb13c6c9138d04c3ca4eb7431f8c65d8e65 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-21720: Restore the Python 2.7 logic in handling a fromlist. (GH-4118) 
(#4128)
https://github.com/python/cpython/commit/2b5cbbb13c6c9138d04c3ca4eb7431f8c65d8e65


--

___
Python tracker 

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



[issue30937] csv module examples miss newline='' when opening files

2017-10-26 Thread Berker Peksag

Berker Peksag  added the comment:

Good catch, Pavel. Thanks! This is now fixed in 3.6 and 3.7 docs. Thanks for 
the patch, Ammar.

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



[issue30937] csv module examples miss newline='' when opening files

2017-10-26 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset 614ea48986f80d361043510ac3945f3dcd666c31 by Berker Peksag (Miss 
Islington (bot)) in branch '3.6':
bpo-30937: Make usage of newline='' consistent in csv docs (GH-2730)
https://github.com/python/cpython/commit/614ea48986f80d361043510ac3945f3dcd666c31


--

___
Python tracker 

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



[issue30949] Provide assertion functions in unittest.mock

2017-10-26 Thread Berker Peksag

Berker Peksag  added the comment:

Thank you for the report. This is a duplicate of issue 24651.

--
components: +Library (Lib) -Tests
nosy: +berker.peksag
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Mock.assert* API is in user namespace
type:  -> enhancement

___
Python tracker 

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



[issue30937] csv module examples miss newline='' when opening files

2017-10-26 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4094

___
Python tracker 

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



[issue30937] csv module examples miss newline='' when opening files

2017-10-26 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset 275d2d9c4663a1ea8d1f7c8778567a735b0372c1 by Berker Peksag (Ammar 
Askar) in branch 'master':
bpo-30937: Make usage of newline='' consistent in csv docs (GH-2730)
https://github.com/python/cpython/commit/275d2d9c4663a1ea8d1f7c8778567a735b0372c1


--
nosy: +berker.peksag

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-26 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4093
stage: backport needed -> patch review

___
Python tracker 

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



  1   2   >