[issue10740] sqlite3 module breaks transactions and potentially corrupts data

2015-08-25 Thread Aymeric Augustin

Aymeric Augustin added the comment:

Since a better solution seems to be around the corner, I'm withdrawing my 
proposal.

I'm attaching the current state of my patch. It isn't functional. Mostly it 
proves that my API proposal is very inconvenient to implement in C. That's why 
I kept it around for over a year without completing it.

--
Added file: http://bugs.python.org/file40252/issue10740-aaugustin.patch

___
Python tracker 

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



[issue24902] http.server: on startup, show host/port as URL

2015-08-25 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +martin.panter

___
Python tracker 

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



[issue14534] Add means to mark unittest.TestCases as "do not load".

2015-08-25 Thread Martin Panter

Martin Panter added the comment:

Issue 22680, about blacklisting FunctionTestCase, was closed as a duplicate of 
this. However the patch there has a useful test case for FunctionTestCase that 
could be merged with any future work here.

--
stage: patch review -> needs patch
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue22680] Blacklist FunctionTestCase from test discovery

2015-08-25 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +Add means to mark unittest.TestCases as "do not load".

___
Python tracker 

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



[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2015-08-25 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

ok, thanks. I'll remove the is tty ans push docs changes on a new patch. 
I'll see if I can figure out how to enable DW by default in unittest and 
doctest. 

Thanks !

--

___
Python tracker 

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2015-08-25 Thread Andrey Wagin

New submission from Andrey Wagin:

In [1]: import socket

In [2]: sks = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)

In [3]: sks[1].send("asdfasdfsadfasdfsdfsadfsdfasdfsdfasdfsadfa")
Out[3]: 42

In [4]: sks[0].recv(1, socket.MSG_PEEK | socket.MSG_TRUNC)
Out[4]: 
'a\x00\x00\x00\xc0\xbf8\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

recv() returns a buffer. The size of this buffer is equal to the size of 
transferred data, but only the first symbol was initialized. What is the idea 
of this behavior.

Usually recv(sk, NULL, 0, socket.MSG_PEEK | socket.MSG_TRUNC) is used to get a 
message size. What is the right way to get a message size in Python?

--
components: Library (Lib)
messages: 249114
nosy: Andrey Wagin
priority: normal
severity: normal
status: open
title: socket.recv(size, MSG_TRUNC) returns more than size bytes
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



[issue24790] Idle: improve stack viewer

2015-08-25 Thread Can İbanoğlu

Can İbanoğlu added the comment:

First of all, sorry for the late reply.

I did try the solution you have proposed which removes the need to click to 
expand the items under globals/locals but as I understand it, you have 
something more in mind for the whole stackviewer UI. Should I still submit a 
patch for this?

As far as the bug is concerned I will look into that next.

--

___
Python tracker 

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



[issue24850] syslog.syslog() does not return error when unable to send the log

2015-08-25 Thread R. David Murray

R. David Murray added the comment:

Ah, in that case there aren't any errors for us to return, so this is moot.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict

2015-08-25 Thread R. David Murray

Changes by R. David Murray :


--
keywords: +easy
stage:  -> needs patch
versions: +Python 3.5, Python 3.6 -Python 2.7

___
Python tracker 

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



[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2015-08-25 Thread R. David Murray

R. David Murray added the comment:

I'm not sure that is acceptable.  "Just changing it to a file" could break an 
application's structure that is depending on being able to use stdin to run 
scripts.  As one example, vim scripts can embed python code...now, what VIM 
does behind the scenes with that I don't know, and it might be able to write it 
out to a file or put somewhere in memory for the embedded interpreter to run, 
but the point is that here is a an application whose API is embedded scripts 
that get fed into python, not independent files that python gets called on.  
I'm guessing there are other applications out there that *would* be affected by 
this, even if vim itself isn't (and I don't know if it is or not).

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



[issue24808] PyTypeObject fields have incorrectly documented types

2015-08-25 Thread R. David Murray

R. David Murray added the comment:

Congratulation on your first commit, Martin :)

Dropping the python2 reference was the right call: the python3 docs are 
supposed to be a "fresh start" and there are very few places where they mention 
python2.

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



[issue24934] django_v2 benchmark not working in Python 3.6

2015-08-25 Thread Florin Papa

New submission from Florin Papa:

Hi All,

My name is Florin Papa and I work in the Server Languages Optimizations Team at 
Intel Corporation.

I would like to submit a patch that solves compatibility issues of the 
django_v2 benchmark in the Grand Unified Python Benchmark. The django_v2 
benchmark uses inspect.getargspec(), which is deprecated and was removed in 
Python 3.6. Therefore, it crashes with the message "ImportError: cannot import 
name 'getargspec'" when using the latest version of Python on the default 
branch.

The patch modifies the benchmark to use inspect.signature() when Python version 
is 3.6 or above and keep using inspect.getargspec() otherwise.
 

Regards,
Florin

--
components: Benchmarks
files: django_v2_compat_3_6.patch
keywords: patch
messages: 249119
nosy: florin.papa
priority: normal
severity: normal
status: open
title: django_v2 benchmark not working in Python 3.6
type: crash
versions: Python 3.6
Added file: http://bugs.python.org/file40253/django_v2_compat_3_6.patch

___
Python tracker 

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



[issue10466] locale.py resetlocale throws exception on Windows (getdefaultlocale returns value not usable in setlocale)

2015-08-25 Thread Gabi Davar

Changes by Gabi Davar :


--
nosy: +Gabi.Davar

___
Python tracker 

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



[issue3548] subprocess.pipe function

2015-08-25 Thread Matheus Vieira Portela

Matheus Vieira Portela added the comment:

I just found this open issue and I can work on it. What is left to do before 
closing it?

--
nosy: +matheus.v.portela

___
Python tracker 

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2015-08-25 Thread Andrey Wagin

Andrey Wagin added the comment:

sendto(4, "asdfasdfsadfasdfsdfsadfsdfasdfsd"..., 42, 0, NULL, 0) = 42
recvfrom(3, 
"a\0n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\0\0\0\0\2\0\0\0"..., 1, 
MSG_TRUNC, NULL, NULL) = 42

I think the exit code is interpreted incorrectly. In this case it isn't equal 
to the number of bytes received. Then python copies this number of bytes from 
the buffer with smaller size, so it may access memory which are not allocated 
or allocated by someone else.

valgrind detects this type of errors:
[avagin@localhost ~]$ cat sock.py 
import socket, os, sys

sks = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)
pid = os.fork()
if pid == 0:
sks[1].send("\0" * 4096)
sys.exit(0)
sk = sks[0]
print sk.recv(1, socket.MSG_TRUNC )

[avagin@localhost ~]$ valgrind python sock.py
==25511== Memcheck, a memory error detector
==25511== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==25511== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==25511== Command: python sock.py
==25511== 
==25511== Syscall param write(buf) points to uninitialised byte(s)
==25511==at 0x320B4F0940: __write_nocancel (in /usr/lib64/libc-2.20.so)
==25511==by 0x320B478D2C: _IO_file_write@@GLIBC_2.2.5 (in 
/usr/lib64/libc-2.20.so)
==25511==by 0x320B4794EE: _IO_file_xsputn@@GLIBC_2.2.5 (in 
/usr/lib64/libc-2.20.so)
==25511==by 0x320B46EE68: fwrite (in /usr/lib64/libc-2.20.so)
==25511==by 0x369CC90210: ??? (in /usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CC85EAE: ??? (in /usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CC681AB: PyFile_WriteObject (in 
/usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCE08F9: PyEval_EvalFrameEx (in 
/usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCE340F: PyEval_EvalCodeEx (in 
/usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCE3508: PyEval_EvalCode (in 
/usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCFC91E: ??? (in /usr/lib64/libpython2.7.so.1.0)
==25511==by 0x369CCFDB41: PyRun_FileExFlags (in 
/usr/lib64/libpython2.7.so.1.0)

--

___
Python tracker 

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



[issue24769] Interpreter doesn't start when dynamic loading is disabled

2015-08-25 Thread Jeffrey Armstrong

Jeffrey Armstrong added the comment:

I pulled the 3.5 branch a few minutes ago, and the patch isn't present.  Has it 
not been pushed to hg.python.org?

--

___
Python tracker 

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



[issue24769] Interpreter doesn't start when dynamic loading is disabled

2015-08-25 Thread Larry Hastings

Larry Hastings added the comment:

That's correct, it's just in 3.5.0 at the moment.

--

___
Python tracker 

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



[issue3548] subprocess.pipe function

2015-08-25 Thread R. David Murray

R. David Murray added the comment:

Thanks for being willing to work on it.

If what is wanted is a way to pipeline shell commands, Python already has that 
functionality in the pipes module.

So the interesting thing here would be pipelining *non* shell commands, to 
avoid the shell exploits that using a shell pipeline invites.

The pipes module already has a worked out API, so perhaps it would be useful to 
see about re-implementing pipe's command execution using subprocess, and expand 
the API to allow for argv style command specification that would be fed to 
subprocess using the default shell=False.  This would also presumably allow 
pipes to be used when there's no bash shell available.

The downside is that we might break current uses of pipes if we replace the 
shell version of the pipelining with subprocess shell=True, while using 
subprocess only if the command specifications are argv lists would result in 
code with a split personality.  But if I were working on it I'd experiment with 
that approach to see if it made sense.

Other core devs may have other opinions on this :)

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



[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2015-08-25 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

# unittest 

(Pending)DeprecationWarning are already enabled if no -W flags are given. 

# doctest

We enable the DW in REPL only if originate from `__main__`, this seem to be 
painful to do in doctest, as each doctest execute in a module that have the 
name of the file it is executed in. Should I enable globally regardless of 
where the DW comes from, or explore more ?

Should the doctest fail if such a warning is raised, or actually just print it 
to the output, letting the doctest pass ?

--

___
Python tracker 

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



[issue24913] newblock() Uninitialized Variable

2015-08-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue24913] newblock() Uninitialized Variable

2015-08-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'm find the "exception analysis" to be unreadable.  Have you found any place 
in the deque code where the uninitialized memory actually gets accessed?

--
priority: normal -> low

___
Python tracker 

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



[issue24933] socket.recv(size, MSG_TRUNC) returns more than size bytes

2015-08-25 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Evidently, the recv code doesn't know anything about MSG_TRUNC, which causes it 
to do incorrect things when the output length is greater than the buffer length.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-25 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


Added file: http://bugs.python.org/file40255/python3.5-pgo-v03.patch

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-25 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

I modified the patches to be compatible with both environments. The new 
versions modify the configure.ac file also, therefore you will need to run 
"autoconf" by hand. Also, in case of MaOS you will need to have llvm-profdata 
installed and in your path.

I kept the expanded form of regrtest (/Lib/test/regrtest.py) because this way 
it is clearer to the user what is the main file that runs the training 
workload. 

Also, the "|| true" is necessary also, due to the nature of regrtest. This test 
suite is designed to return a fail code if a test is not ok, even for tests 
that do not comply with certain dependencies (meaning users that didn't 
installed any other libraries).

--

___
Python tracker 

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



[issue24935] LDSHARED is not set according when CC is set.

2015-08-25 Thread yunlian

New submission from yunlian:

On linux, when CC is set, we expect that the LDSHARED is set accordingly.
Currently, only on OS X, the LDSHARED is set properly.

Below is the proposed patch

--- a/Lib/distutils/sysconfig.py2015-08-24 11:58:37.265683872 -0700
+++ b/Lib/distutils/sysconfig.py2015-08-24 11:57:29.673945173 -0700
@@ -180,9 +180,9 @@
 if _USE_CLANG:
 newcc = 'clang'
 if newcc:
-# On OS X and linux, if CC is overridden, use that as the default
+# On OS X, if CC is overridden, use that as the default
 #   command for LDSHARED as well
-if ((sys.platform == 'darwin' or sys.platform.startswith('linux'))
+if (sys.platform == 'darwin'
 and 'LDSHARED' not in os.environ
 and ldshared.startswith(cc)):
 ldshared = newcc + ldshared[len(cc):]

--
components: Distutils
messages: 249129
nosy: dstufft, eric.araujo, yunlian
priority: normal
severity: normal
status: open
title: LDSHARED is not set according when CC is set.
type: behavior

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-25 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


Added file: http://bugs.python.org/file40254/python2.7-pgo-v03.patch

___
Python tracker 

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



[issue24913] newblock() Uninitialized Variable

2015-08-25 Thread John Leitch

John Leitch added the comment:

The "exception analysis" is output from the WinDbg !analyze command run on a 
crash where access to the uninitialized memory ultimately corrupted the 
instruction pointer, leading to a data execution prevention crash. That's why 
the disassembly is junk--the IP is not pointing to valid instructions. This 
crash was provided as an example because it demonstrates that the issue is 
likely exploitable, and can probably be used to achieve code execution.

Here is an example of a crash where execution halts immediately upon attempted 
to dereference a corrupted pointer. Note that the pointer is 0xC0C0C0C0--a fill 
pattern indicative of uninitialized memory. 

0:000> r
eax=02a2 ebx=551160a8 ecx=c0c0c0c0 edx=07e538e0 esi=07e538e0 edi=c0c0c0c0
eip=54f25a55 esp=004cf6e4 ebp=004cf6f4 iopl=0 nv up ei ng nz na pe cy
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=00010287
python35!do_richcompare+0x15:
54f25a55 8b4704  mov eax,dword ptr [edi+4] ds:002b:c0c0c0c4=
0:000> k
ChildEBP RetAddr  
004cf6f4 54f25be3 python35!do_richcompare+0x15 
[c:\build\cpython\objects\object.c @ 659]
004cf700 54e453fc python35!PyObject_RichCompare+0x53 
[c:\build\cpython\objects\object.c @ 718]
(Inline)  python35!PyObject_RichCompareBool+0x14 
[c:\build\cpython\objects\object.c @ 739]
004cf738 54f232d3 python35!deque_index+0xac 
[c:\build\cpython\modules\_collectionsmodule.c @ 933]
004cf754 54f8442f python35!PyCFunction_Call+0x113 
[c:\build\cpython\objects\methodobject.c @ 109]
004cf788 54f818ec python35!call_function+0x2ff [c:\build\cpython\python\ceval.c 
@ 4651]
004cf800 54f8339f python35!PyEval_EvalFrameEx+0x232c 
[c:\build\cpython\python\ceval.c @ 3184]
004cf84c 54fba0b2 python35!_PyEval_EvalCodeWithName+0x82f 
[c:\build\cpython\python\ceval.c @ 3962]
(Inline)  python35!PyEval_EvalCodeEx+0x21 
[c:\build\cpython\python\ceval.c @ 3983]
(Inline)  python35!PyEval_EvalCode+0x21 
[c:\build\cpython\python\ceval.c @ 777]
004cf888 54fb9f45 python35!run_mod+0x42 [c:\build\cpython\python\pythonrun.c @ 
970]
004cf8b4 54fb8fba python35!PyRun_FileExFlags+0x85 
[c:\build\cpython\python\pythonrun.c @ 923]
004cf8f8 54e8f1f7 python35!PyRun_SimpleFileExFlags+0x20a 
[c:\build\cpython\python\pythonrun.c @ 396]
(Inline)  python35!PyRun_AnyFileExFlags+0x4e 
[c:\build\cpython\python\pythonrun.c @ 80]
004cf924 54e8fb33 python35!run_file+0xe7 [c:\build\cpython\modules\main.c @ 318]
004cf9c8 1cd4143f python35!Py_Main+0x913 [c:\build\cpython\modules\main.c @ 768]
(Inline)  python!invoke_main+0x1d 
[f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 89]
004cfa14 75463744 python!__scrt_common_main_seh+0xff 
[f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 264]
004cfa28 76f0a064 KERNEL32!BaseThreadInitThunk+0x24
004cfa70 76f0a02f ntdll!__RtlUserThreadStart+0x2f
004cfa80  ntdll!_RtlUserThreadStart+0x1b
0:000> !analyze -v -nodb
***
* *
*Exception Analysis   *
* *
***


FAULTING_IP: 
python35!do_richcompare+15 [c:\build\cpython\objects\object.c @ 659]
54f25a55 8b4704  mov eax,dword ptr [edi+4]

EXCEPTION_RECORD:   -- (.exr 0x)
ExceptionAddress: 54f25a55 (python35!do_richcompare+0x0015)
   ExceptionCode: c005 (Access violation)
  ExceptionFlags: 
NumberParameters: 2
   Parameter[0]: 
   Parameter[1]: c0c0c0c4
Attempt to read from address c0c0c0c4

CONTEXT:   -- (.cxr 0x0;r)
eax=02a2 ebx=551160a8 ecx=c0c0c0c0 edx=07e538e0 esi=07e538e0 edi=c0c0c0c0
eip=54f25a55 esp=004cf6e4 ebp=004cf6f4 iopl=0 nv up ei ng nz na pe cy
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=00010287
python35!do_richcompare+0x15:
54f25a55 8b4704  mov eax,dword ptr [edi+4] ds:002b:c0c0c0c4=

FAULTING_THREAD:  4a48

DEFAULT_BUCKET_ID:  INVALID_POINTER_READ

PROCESS_NAME:  python.exe

ERROR_CODE: (NTSTATUS) 0xc005 - The instruction at 0x%p referenced memory 
at 0x%p. The memory could not be %s.

EXCEPTION_CODE: (NTSTATUS) 0xc005 - The instruction at 0x%p referenced 
memory at 0x%p. The memory could not be %s.

EXCEPTION_PARAMETER1:  

EXCEPTION_PARAMETER2:  c0c0c0c4

READ_ADDRESS:  c0c0c0c4 

FOLLOWUP_IP: 
python35!do_richcompare+15 [c:\build\cpython\objects\object.c @ 659]
54f25a55 8b4704  mov eax,dword ptr [edi+4]

NTGLOBALFLAG:  200

APPLICATION_VERIFIER_FLAGS:  0

APP:  python.exe

ANALYSIS_VERSION: 6.3.9600.17029 (debuggers(dbg).140219-1702) x86fre

PRIMARY_PROBLEM_CLASS:  INVALID_POINTER_READ

BUGCHECK_STR:  APPLICATION_FAULT_INVALID_POINTER_R

[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-25 Thread Brett Cannon

Brett Cannon added the comment:

Any specific reason the v3 patch, Alecsandru, is listed as against 3.5 in the 
filename? Or is that just a typo?

P.S.: I did another review asking about explicit Clang support and also 
supporting Greg's request to use `-m test` instead of the explicit file 
execution.

--

___
Python tracker 

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



[issue24913] newblock() Uninitialized Variable

2015-08-25 Thread Stefan Krah

Stefan Krah added the comment:

I guess that in the test case the stop parameter is set to 4 in
deque_index(), but it should be clamped to 3.

--
nosy: +skrah

___
Python tracker 

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



[issue24929] _strptime.TimeRE should not enforce range in regex

2015-08-25 Thread Brett Cannon

Brett Cannon added the comment:

Do realize that the strptime code is shared with time.strptime() and so this 
change would have to make sense in both contexts.

This change can also only happen in Python 3.6 because it is 
backwards-incompatible due to people potentially already catching the previous 
exception.

--
nosy: +brett.cannon
priority: normal -> low
stage:  -> test needed
versions: +Python 3.6 -Python 2.7

___
Python tracker 

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



[issue24932] Migrate _testembed to a C unit testing library

2015-08-25 Thread Brett Cannon

Brett Cannon added the comment:

Someone is going to think of [googletest] 
(https://github.com/google/googletest) and then realize that it is a C++ test 
suite and thus won't work unless you explicitly compile Python for C++.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue24935] LDSHARED is not set according when CC is set.

2015-08-25 Thread Mike Frysinger

Changes by Mike Frysinger :


--
nosy: +vapier

___
Python tracker 

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



[issue24934] django_v2 benchmark not working in Python 3.6

2015-08-25 Thread Brett Cannon

Brett Cannon added the comment:

The proposed patch directly modifies the copy of Django in the benchmark suite 
which isn't acceptable; we purposefully don't modify the project code we pull 
in for benchmark consistency and ease of maintenance.

It would be better to make sure a newer version of Django is fixed upstream, 
pull in the newer version to the benchmark suite, and then create a django_v3 
benchmark using that newer version while removing the django_v2 benchmark from 
the default set of benchmarks (if not fully remove it).

And can you sign the contributor agreement, Florin?

--
nosy: +brett.cannon, pitrou
stage:  -> patch review
type: crash -> 

___
Python tracker 

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



[issue24935] LDSHARED is not set according when CC is set.

2015-08-25 Thread Mike Frysinger

Mike Frysinger added the comment:

looks like the patch was reversed, but otherwise should be clear what we're 
going for

--

___
Python tracker 

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



[issue24937] Multiple problems in getters & setters in capsulethunk.h

2015-08-25 Thread Petr Viktorin

New submission from Petr Viktorin:

In https://docs.python.org/3/howto/cporting.html#cobject-replaced-with-capsule 
(added in issue13053):

1) __PyCapsule_GetField is defined as::

#define __PyCapsule_GetField(capsule, field, default_value) ...

but called as::

__PyCapsule_GetField(capsule, field)


2) __PyCapsule_SetField returns the wrong value (1 for success, 0 for failure).

3) Both the getter and setter don't set the exception on failure, leading to 
"SystemError: error return without exception set".

Here's a patch.

--
assignee: docs@python
components: Documentation
files: capsulethunk.patch
keywords: patch
messages: 249138
nosy: docs@python, encukou, larry, ncoghlan
priority: normal
severity: normal
status: open
title: Multiple problems in getters & setters in capsulethunk.h
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40256/capsulethunk.patch

___
Python tracker 

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



[issue24936] Idle: handle 'raise' properly when running with subprocess (2.7)

2015-08-25 Thread Terry J. Reedy

New submission from Terry J. Reedy:

With one process (installed 2.7.10, -n option):
>>> raise
Traceback (most recent call last):
  File "", line 2, in 
TypeError: exceptions must be old-style classes or derived from BaseException, 
not NoneType

With subprocess (default option):
>>> raise

Traceback (most recent call last):
** IDLE Internal Exception: 
  File "C:\Programs\Python27\lib\idlelib\run.py", line 325, in runcode
exec code in self.locals
  File "C:\Programs\Python27\lib\idlelib\run.py", line 111, in main
seq, request = rpc.request_queue.get(block=True, timeout=0.05)
  File "C:\Programs\Python27\lib\Queue.py", line 176, in get
raise Empty
Empty

The 2.7.10 says " If no exception is active in the current scope, a TypeError 
exception is raised indicating that this is an error (if running under IDLE, a 
Queue.Empty exception is raised instead)."  The comment is not true with -n.  
But adding changing 'IDLE' to 'IDLE without -n' might encourage people to think 
that they should use '-n'.

A workaround fix might be to add a special check to the internal error handling 
code to print the TypeError instead. I do not know of any other open issues 
about Internal Exceptions being printed.

This is a low priority issue, but it is peculiar that this seems to be the only 
exception so mangled. The only issue issue I found related to this section of 
the Idle code is #1190163.

This is a 2.7 issue only. In 3.4+, console or Idle in either mode:
>>> raise
Traceback (most recent call last):
  File "", line 1, in 
raise
RuntimeError: No active exception to reraise

--
messages: 249137
nosy: terry.reedy
priority: low
severity: normal
stage: needs patch
status: open
title: Idle: handle 'raise' properly when running with subprocess (2.7)
type: behavior
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



[issue24937] Multiple problems in getters & setters in capsulethunk.h

2015-08-25 Thread Petr Viktorin

Petr Viktorin added the comment:

Note:
I'm including a tested (+fixed, now) copy of capsulethunk.h in my set of 
Python3 C extension porting helpers, http://py3c.readthedocs.org

Unfortunately the tests can't be added to CPython, because they need to run on 
Python 2.6 to be useful. That makes me think an external project might make a 
better home for this piece of code.
If you agree, I can take over maintainership of capsulethunk, and make py3c the 
canonical home for it.

--

___
Python tracker 

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



[issue24937] Multiple problems in getters & setters in capsulethunk.h

2015-08-25 Thread Larry Hastings

Larry Hastings added the comment:

Given that capsulethunk is only needed for 2.6 (and previous), and those 
versions are no longer maintained by the Python core community, yes I'd be 
happy for you to take over maintainership and host it externally.  I'm sure we 
could change the documentation in 2.7, 3.4, and 3.5 to reflect this.

--

___
Python tracker 

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



[issue24929] _strptime.TimeRE should not enforce range in regex

2015-08-25 Thread R. David Murray

R. David Murray added the comment:

And it does not make sense for time, since time.strptime does no additional 
validation, it just returns the result returned by _strptime.

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



[issue24934] django_v2 benchmark not working in Python 3.6

2015-08-25 Thread R. David Murray

R. David Murray added the comment:

Florin is covered by the Intel corporate agreement.  I've updated his user 
record accordingly.

--
nosy: +r.david.murray
stage: patch review -> 
type:  -> crash

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-25 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Sorry, it was a typo. I made a correction to it. I will also modify to -m flag, 
instead of the explicit file execution. 

Regarding the clang/gcc support, in v03 version of patches, GCC is supported. 
On Linux is straightforward. On Mac I see that the default development 
environment also has the "gcc" command, but it is a binary stub that calls 
clang in backend, so the flags are adjusted for clang-in-gcc-clothing. You say 
to support clang explicitly as a compiler in 2.7 and 3.6?

--

___
Python tracker 

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



[issue24829] Use interactive input even if stdout is redirected

2015-08-25 Thread Adam Bartoš

Adam Bartoš added the comment:

I really don't know how stdio in console in Linux works. In my package 
https://github.com/Drekin/win-unicode-console I set custom sys.std* streams and 
a custom readline hook to support Unicode in Python run in Windows console. If 
I run `py` with my fixes enabled, >>> "α" really yields "α", but when I run `py 
-i > output.txt`, >>> "α" yields "?" (written to the file of course) same as 
when my fixes are disabled. From this point of view it seemed wrong that 
redirection of output affects how a line is read.

Regarding the prompt, I think it should be always written to sys.stdout, so we 
may hypothetically add a wrapper around GNU readline writing the prompt to 
sys.stdout and calling the actual readline with empty prompt.

So you are telling me that the characters displayed in console when entering 
input are actually written to stdout in Linux (I think it's not the case in 
Windows)? Maybe it woudn't matter if they were written to console even when 
stdout is redirected.

I'm not saying it is extra useful to redirect stdout while providing 
interactive input, I was just wondering what should be the right behavior. And 
from my point of view motivated as explained above, readlinehook should be used 
even with redirected stdout, at least in Windows.

--

___
Python tracker 

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



[issue24829] Use interactive input even if stdout is redirected

2015-08-25 Thread R. David Murray

R. David Murray added the comment:

The behavior of programs definitely differs if stdout is redirected.  For 
example on linux a program might output color codes to stdout normally, but if 
it is redirected to a non-tty, no color codes would be output.

Windows console handling of unicode is an entirely separate problem for which 
there are open issues and some possible solutions being worked on.

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-25 Thread Brett Cannon

Brett Cannon added the comment:

I'm asking if that's possible. For instance I set $CC to clang explicitly on OS 
X as I install the latest version of LLVM through Homebrew to get better 
compiler warnings for Python. It would be great if we could avoid leaving all 
clang users out unless they happen to use the stock install on OS X (e.g. cover 
Clang users on Linux).

Basically it would be nice if this is not exclusive to gcc if Clang also 
supports PGO.

--

___
Python tracker 

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



[issue24927] multiprocessing.Pool hangs forever on segfault

2015-08-25 Thread Jonas Obrist

Jonas Obrist added the comment:

I've added a patch that would simply warn the user if a worker exits 
prematurely.

--
keywords: +patch
Added file: http://bugs.python.org/file40257/patch.diff

___
Python tracker 

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



[issue24829] Use interactive input even if stdout is redirected

2015-08-25 Thread Adam Bartoš

Adam Bartoš added the comment:

R. David Murray: I understand that the behavior of programs differ if stdout is 
redirected. I just claim that at least in Windows, stdin and stdout are 
completely independent, so redirecting *stdout* shouldn't affect how data are 
read from *stdin*.

I know that Unicode handling in Windows is a completely different issue. I was 
just explaining how I ran into this issue. During my work on 
`win-unicode-console` I found out there is some (at least for me) suprising 
behavior regarding the stdio implementation in Python. So I raised issues (this 
one, issue17620, issue18597, issue18838).

--

___
Python tracker 

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



[issue24829] Use interactive input even if stdout is redirected

2015-08-25 Thread R. David Murray

R. David Murray added the comment:

Well, I think we're constrained by the behavior of readline here.

--

___
Python tracker 

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



[issue24938] Measure if _warnings.c is still worth having

2015-08-25 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue24938] Measure if _warnings.c is still worth having

2015-08-25 Thread Brett Cannon

New submission from Brett Cannon:

_warnings.c was initially created to help with startup performance. It turned 
out to be a tricky bit of code to get right to continue to support the Python 
version of the module.

But now that we live in a world where we have startup benchmarks instead of 
hunches and we freeze code like importlib, maybe it's time to re-evaluate 
whether warnings.py is such a bad thing to have as part of the startup process? 
I would be curious to know what the performance impact is if we made _warnings 
the frozen version of warnings.py instead of the C code and measured the 
startup performance.

--
messages: 249150
nosy: brett.cannon
priority: low
severity: normal
stage: needs patch
status: open
title: Measure if _warnings.c is still worth having
type: performance
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



[issue24305] The new import system makes it inconvenient to correctly issue a deprecation warning for a module

2015-08-25 Thread Brett Cannon

Brett Cannon added the comment:

So there are two approaches I see to solving this whole thing. One is for there 
to be a slight divergence between the C code and the Python code. For 
_warnings.warn(), nothing changes. For warnings.warn(), though, it does the 
expected frame skipping. This would mean that _warnings.warn() continues to 
exist for startup purposes but then user-level code and non-startup code uses 
the Python version that has the expected semantics. This requires figuring out 
why not importing _warnings.warn in warnings.py causes test failures.

The other option is someone helps me figure out why the C code is causing its 
test failures by triggering a -11 return in threaded/subprocess tests and 
prevent the divergence.

I have opened issue #24938 to actually re-evaluate one of the key points of 
_warnings.c which was startup performance. This was done about 7 years ago 
which pre-dates freezing code and providing simple C wrappers as necessary for 
internal use in Python like we do with importlib.

--

___
Python tracker 

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



[issue24938] Measure if _warnings.c is still worth having

2015-08-25 Thread Brett Cannon

Brett Cannon added the comment:

I should also mention the other motivating factor was providing C access to the 
warnings system, but once again importlib blazed that trail already by 
providing a C API which simply uses the Python code.

--

___
Python tracker 

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



[issue24934] django_v2 benchmark not working in Python 3.6

2015-08-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

According to the docs, getargspec() should be replaced with getfullargspec(), 
which returns a compatible named tuple. This would probably also minimize the 
performance impact of the patch (I'm not sure getargspec() is in the critical 
path, but let's be careful).

--

___
Python tracker 

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



[issue24829] Use interactive input even if stdout is redirected

2015-08-25 Thread Adam Bartoš

Adam Bartoš added the comment:

Behavior of which readline? GNU readline? Note that it is only one particular 
implmentation on one particular platform while Python should be as 
multiplatform as possible / viable.

And what behavior it is? More precisely, what incorrect behavior in Linux would 
it bring if the condition in 

if (!isatty (fileno (sys_stdin)) || !isatty (fileno (sys_stdout)))
rv = PyOS_StdioReadline (sys_stdin, sys_stdout, prompt);
else
rv = (*PyOS_ReadlineFunctionPointer)(sys_stdin, sys_stdout, prompt);

was replaced by `!isatty (fileno (sys_stdin))`?

--

___
Python tracker 

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



[issue24915] Profile Guided Optimization improvements (better training, llvm support, etc)

2015-08-25 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Thank you for the clarifications! Your point make sense, we don't want to 
exclude clang environments. I will analyze this and post some patches once I'm 
done with it.

--

___
Python tracker 

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



[issue24829] Use interactive input even if stdout is redirected

2015-08-25 Thread R. David Murray

R. David Murray added the comment:

It's the one we started with, and the one in most common use.

I don't even know if there would be a problem.  The thing to do would be to try 
it and find out (on both linux and windows).

--

___
Python tracker 

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



[issue24937] Multiple problems in getters & setters in capsulethunk.h

2015-08-25 Thread Petr Viktorin

Petr Viktorin added the comment:

Thanks! I'll take good care of it :)
Give me a few days to prepare the docs change; this isn't very high priority.

--

___
Python tracker 

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



[issue24934] django_v2 benchmark not working in Python 3.6

2015-08-25 Thread Florin Papa

Florin Papa added the comment:

Thank you all for your feedback on this matter.

According to the docs, starting from version 3.4, getfullargspec() is based on 
signature(), therefore the performance impact would not differ from the 
proposed implementation.

I will check if a newer version of django fixes this problem and modify the 
patch accordingly.

--

___
Python tracker 

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



[issue24769] Interpreter doesn't start when dynamic loading is disabled

2015-08-25 Thread Larry Hastings

Larry Hastings added the comment:

I have merged it forward into 3.5.1 and 3.6.

--

___
Python tracker 

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



[issue24939] Remove unicode_fornat.h from stringlib

2015-08-25 Thread Eric V. Smith

New submission from Eric V. Smith:

Objects/stringlib/unicode_format.h does not belong in stringlib. Back when it 
was originally written for 2.x, it used stringlib to provide the str and 
unicode versions of str.format, str.__format__, int.__format__, etc.

However, in 3.x, and especially with PEP 393 (Flexible String Representation), 
not only is the stringlib functionality no longer needed, it's not used at all.

My suggestion is to just copy the source into Objects/unicodeobject.c, which is 
the only place it's used. Then delete the stringlib file.

The only downside of including it in unicodeobject.c is that it makes our 
largest C file about 8% larger:

wc -l says:
1284  Objects/stringlib/unicode_format.h
15414 Objects/unicodeobject.c

There's some argument to be made to separate out the int.__format__, 
float.__format__ etc. code, and move them to some other library. I don't think 
they're a huge part of unicode_format.h. And to separate them out would require 
creating some _Py_* functions to do their work. But it's probably the right 
thing to do. I'll investigate.

--
assignee: eric.smith
components: Interpreter Core
messages: 249160
nosy: eric.smith
priority: normal
severity: normal
status: open
title: Remove unicode_fornat.h from stringlib
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



[issue24769] Interpreter doesn't start when dynamic loading is disabled

2015-08-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 931593401e3e by Larry Hastings in branch '3.5':
Issue #24769: Interpreter now starts properly when dynamic loading
https://hg.python.org/cpython/rev/931593401e3e

--
nosy: +python-dev

___
Python tracker 

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



[issue24867] Asyncio Task.get_stack fails with native coroutines

2015-08-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 595614c08eeb by Yury Selivanov in branch '3.5':
Issue #24867: Fix asyncio.Task.get_stack() for 'async def' coroutines
https://hg.python.org/cpython/rev/595614c08eeb

New changeset 9b28f41f1353 by Larry Hastings in branch '3.5':
Merged in 1st1/cpython350 (pull request #5)
https://hg.python.org/cpython/rev/9b28f41f1353

New changeset ad48d5a4ef40 by Larry Hastings in branch '3.5':
Add missing Misc/NEWS item for merged pull request for issue #24867.
https://hg.python.org/cpython/rev/ad48d5a4ef40

--

___
Python tracker 

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



[issue24847] Can't import tkinter in Python 3.5.0rc1

2015-08-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dc9bdddca59b by Steve Dower in branch '3.5':
Issue #24847: Removes vcruntime140.dll dependency from Tcl/Tk.
https://hg.python.org/cpython/rev/dc9bdddca59b

New changeset b77ceefc34ff by Larry Hastings in branch '3.5':
Merged in stevedower/cpython350 (pull request #6)
https://hg.python.org/cpython/rev/b77ceefc34ff

--

___
Python tracker 

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



[issue21167] float('nan') returns 0.0 on Python compiled with icc

2015-08-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d93bb3d636cf by R David Murray in branch '3.5':
#21167: Fix definition of NAN when ICC used without -fp-model strict.
https://hg.python.org/cpython/rev/d93bb3d636cf

New changeset c1523d5dee3c by Larry Hastings in branch '3.5':
Merged in bitdancer/cpython350 (pull request #4)
https://hg.python.org/cpython/rev/c1523d5dee3c

--

___
Python tracker 

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



[issue24939] Remove unicode_format.h from stringlib

2015-08-25 Thread Eric V. Smith

Changes by Eric V. Smith :


--
title: Remove unicode_fornat.h from stringlib -> Remove unicode_format.h from 
stringlib

___
Python tracker 

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



[issue23144] html.parser.HTMLParser: setting 'convert_charrefs = True' leads to dropped text

2015-08-25 Thread Robert Collins

Robert Collins added the comment:

@ezio - you seem busy, so I'll commit this next week if its still pending.

--

___
Python tracker 

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



[issue24829] Use interactive input even if stdout is redirected

2015-08-25 Thread Martin Panter

Martin Panter added the comment:

In Linux, the original stdin, stdout, stderr file descriptors refer to the same 
console by default, and you use normal file reads and writes on them. In Linux 
when Python uses Gnu Readline, the displayed input characters are indeed 
written to the original stdout file descriptor. For comparison, when Readline 
is not used, the displayed characters go to the original stdin console, because 
they are handled at a lower OS level before they are even read by Python and 
Readline.

By experimentation, the Bash shell seems to work similarly, except it uses 
stderr rather than stdout. You can freely redirect stdout, but if you redirect 
stderr it affects the output seen on the terminal. It may be possible to write 
to stdin to avoid the input and output being split up, but I think writing to 
an input-only file descriptor is a bad idea.

If you dropped the isatty() check for stdout in Linux, you may end up with the 
output of Readline in the file (assuming Readline is okay with this). The file 
would include all the cursor positioning codes, backspaces, etc, that Readline 
generates. But I haven’t actually tried this.

--

___
Python tracker 

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



[issue24788] HTTPException is derived from Exception instead of IOError

2015-08-25 Thread Pastafarianist

Pastafarianist added the comment:

I agree that the five exception types you mentioned (UnknownProtocol, 
UnknownTransferEncoding, IncompleteRead, BadStatusLine, LineTooLong) should be 
derived from IOError. EOFError is probably not a good choice here. It's not 
something I would expect to see in networking code. ValueError may be better, 
but I don't know enough about the library to tell whether it is common to use 
ValueError in similar contexts.

However, ImproperConnectionState (specifically, CannotSendRequest) may be not a 
programmer error, and, thus, it might be better to have it derived from 
IOError. See https://hg.python.org/cpython/file/3.5/Lib/http/client.py#l933. 
Depending on your point of view, you may consider this to be a programmer error 
or not.

--

___
Python tracker 

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



[issue24788] HTTPException is derived from Exception instead of IOError

2015-08-25 Thread Martin Panter

Martin Panter added the comment:

Regarding CannotSendRequest: HTTPConnection will connect again with a new 
socket if a previous response will close the old connection. See a few lines 
below where you linked: “If point (2) is true, then we . . . will open a new 
[socket] when a new request is made.”

--

___
Python tracker 

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



[issue22936] traceback module has no way to show locals

2015-08-25 Thread Robert Collins

Robert Collins added the comment:

This itself is fixed.

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

___
Python tracker 

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



[issue23597] Allow easy display of local variables in log messages?

2015-08-25 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue23552] Have timeit warn about runs that are not independent of each other

2015-08-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2e9cf58c891d by Robert Collins in branch 'default':
Issue #23552: Timeit now warns when there is substantial (4x) variance
https://hg.python.org/cpython/rev/2e9cf58c891d

--
nosy: +python-dev

___
Python tracker 

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



[issue23552] Have timeit warn about runs that are not independent of each other

2015-08-25 Thread Robert Collins

Changes by Robert Collins :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue23183] timeit CLI best of 3: undocumented output format

2015-08-25 Thread Robert Collins

Changes by Robert Collins :


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



[issue21112] 3.4 regression: unittest.expectedFailure no longer works on TestCase subclasses

2015-08-25 Thread Robert Collins

Changes by Robert Collins :


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



[issue24920] shutil.get_terminal_size throws AttributeError

2015-08-25 Thread Isaac Levy

Isaac Levy added the comment:

I guess users need to check standard streams for None. There's not many uses of 
stream attributes in core libs.

Maybe catch should be Exception -- since it's documented to return a fallback 
on error.

--

___
Python tracker 

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



[issue24911] Context manager of socket.socket is not documented

2015-08-25 Thread Martin Panter

Martin Panter added the comment:

IMO the change notice for create_connection() should be moved to apply to the 
“socket” class, perhaps the “Socket Objects” section. Issue 9794 looks like 
context manager support was added specifically for create_connection(), however 
any socket object, no matter what function is used to create it, should be 
usable the same way for free.

Also, we should explicitly document that exiting the context manager (“with” 
statement) invokes close(), since that affects how the underlying socket is 
closed when makefile() has been used.

--
nosy: +martin.panter

___
Python tracker 

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



[issue24790] Idle: improve stack viewer

2015-08-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Please post a 'checkpoint' patch with all changes so far, even though it has 
the 'other globals' problem.

Then look at the UI parts of Debugger.py. It has a Stackviewer class that 
subclasses ScrolledLIst instead of TreeWidget and a Namespaceviewer class 
currently used for both locals and globals.

The Namespace class is a frame containing a label (a labeled frame would work 
as well), a scrollbar, and a canvas containing a frame. The inner frame has a 
two-column grid: labels with names and entry boxes with values.  Currently, the 
entry boxes do nothing other than make values look different from names, as 
editing the entry does nothing. (Ignored entries are a bad UI design.)  Perhaps 
there was once an intention to propagate changes back to the running program. 
This would not apply to post-mortem stack viewing.

Starting with the checkpoint patch, I would like to modify Stackviewer to 
display globals for any item clicked in a separate frame, like Debugger.  This 
would removing the bug in the checkpoint patch and result in a patch that I 
might commit.  It would also be a step toward merging (in a new issue).

One possibility is a tree in a new frame.  Another is to import and reuse 
Debugger.Namespaceviewer.  The issue is whether users should be able to view 
the attributes of value objects (as in Stackviewer) or not (as in Debugger).  I 
previously suggested not, because it makes the interface look busy, but I just 
rediscovered a note based on debugger experience suggesting that it might be a 
good idea.  Lets start with a second tree.

When waiting for me to respond, you could look at #17942, about improving the 
command button part of debugger.

--

___
Python tracker 

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



[issue2786] Names in traceback should have class names, if they're methods

2015-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Moving target version to 3.6 (since we're discussing adding a new public C API).

This is an interesting problem, as seeing an expanding API like this 
(PyEval_EvalCode -> PyEval_EvalCodeEx -> PyEval_EvalCodeEx2) suggests to me 
that we actually have a missing abstraction layer trying to get out.

My first reaction was to say "Hey, let's just make the eval loop function 
aware, and add PyEval_EvalFunction", but that creates a conceptual dependency 
loop we don't really want. 

So I asked myself a different question: why aren't we storing the qualname as a 
code object attribute, even though it's a known constant at compile time?

Looking at PEP 3155 (https://www.python.org/dev/peps/pep-3155/ ) it doesn't 
look like the question came up, and I don't recall it coming up either.

However, looking at https://hg.python.org/cpython/file/default/Python/compile.c 
I also don't see any reason why we *couldn't* provide a qualname field on code 
objects, such that f.__code__.co_qualname would give the same answer as 
f.__qualname__. The compiler already knows the qualname at compile time, we're 
just currently storing it as a separate constant that gets composed together 
with the code object at runtime.

My suspicion is that the reason this *wasn't* done is because it's a slightly 
more intrusive change to the code generation pipeline, but I currently suspect 
following up with that increase in compiler complexity would be a better option 
than making the PyEval_* API more complicated.

--
nosy: +ncoghlan
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue2786] Names in traceback should have class names, if they're methods

2015-08-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Moving this back to patch review while we consider the alternative approach of 
moving qualname storage into code objects, rather than continuing to transport 
qualnames separately.

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



[issue2786] Names in traceback should have class names, if they're methods

2015-08-25 Thread Ben Longbons

Ben Longbons added the comment:

Code objects currently have no mutable fields.

So what are you planning to do about things like:

Foo = namedtuple('Foo', 'x y')
def frob(self):
return self.x + self.y
# probably actually done via a @member(Foo) decorator
# so adding more code here is not a problem.
Foo.frob.__qualname__ = 'Foo.frob'
Foo.frob = frob
del frob

--
nosy: +o11c

___
Python tracker 

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



[issue24912] The type of cached objects is mutable

2015-08-25 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +larry

___
Python tracker 

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



[issue24940] RotatingFileHandler uses tell in non-binary mode to determine size of the file in bytes

2015-08-25 Thread Ilya Kulakov

New submission from Ilya Kulakov:

According to the most recent documentation:

Return the current stream position as an opaque number. The number does not 
usually represent a number of bytes in the underlying binary storage.

Therefore stream should be opened as 'ab' by using value of the encoding 
argument or sys.getdefaultencoding if it's None.

--
messages: 249177
nosy: Ilya.Kulakov
priority: normal
severity: normal
status: open
title: RotatingFileHandler uses tell in non-binary mode to determine size of 
the file in bytes
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue2786] Names in traceback should have class names, if they're methods

2015-08-25 Thread Ben Longbons

Ben Longbons added the comment:

I made a minimal gist of my motivating code:

https://gist.github.com/o11c/ce0c2ff74b87ea71ad46

--

___
Python tracker 

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



[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2015-08-25 Thread Martin Panter

Martin Panter added the comment:

Florent’s manual reproducer is fixed by issue18383_34_2.diff, as is 
test___all__. And I think the new logic for changing the priority of the filter 
entries might be sound now. But it does seem like we are adding unnecessary 
complexity to the implementation just to avoid a quirk of the test suite. Maybe 
it would be better to save and restore the original filters in the test suite, 
with a comment explaining why. Or perhaps set a _warnings._options_processed 
flag to prevent the double initialization?

FTR Alex already hinted at this, but I only now realize 
issue18383_assert_warns_and_dups_v2.patch contains extra fixes for 
assertWarns() that are only applicable to 3.5+. They are basically a followup 
of Issue 16382 and Issue 23027, rather than the original issue here, although 
the symptom is almost the same.

--

___
Python tracker 

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



[issue24912] The type of cached objects is mutable

2015-08-25 Thread Larry Hastings

Larry Hastings added the comment:

As Python 3.5 Release Manager, my official statement is: Eek!

--
priority: high -> release blocker

___
Python tracker 

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



[issue24913] newblock() Uninitialized Variable

2015-08-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file40258/fix_deque_overrun.diff

___
Python tracker 

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



[issue24913] deque.index() overruns deque boundary

2015-08-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Larry, this may need to go into 3.5 if there is still an opportunity.

--
assignee: rhettinger -> larry
nosy: +larry
priority: low -> high
title: newblock() Uninitialized Variable -> deque.index() overruns deque 
boundary
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