[issue24800] exec docs should note that the no argument form in a local scope is really the two argument form

2015-08-05 Thread eryksun

eryksun added the comment:

 If exec gets two separate objects as globals and locals, 
 the code will be executed as if it were embedded in a 
 class definition.

Probably there needs to be more clarification of the compilation context. Class 
definitions support lexical closures, whereas source code passed to exec is 
compiled at the time of the call, independent of the lexical context. 

In the following example, the code objects for both the class body and the 
comprehension can access the free variable a. In CPython, the class body 
references the free variable via the LOAD_CLASSDEREF op, and the comprehension 
uses the LOAD_DEREF op.

def f():
   a = 5
   class C:
   print(a)
   print([a for i in range(5)])


 f()
5
[5, 5, 5, 5, 5]
 
 dis.dis(f.__code__.co_consts[2])
  3   0 LOAD_NAME0 (__name__)
  3 STORE_NAME   1 (__module__)
  6 LOAD_CONST   0 ('f.locals.C')
  9 STORE_NAME   2 (__qualname__)

  4  12 LOAD_NAME3 (print)
 15 LOAD_CLASSDEREF  0 (a)
 18 CALL_FUNCTION1 (1 positional, 0 keyword pair)
 21 POP_TOP

  5  22 LOAD_NAME3 (print)
 25 LOAD_CLOSURE 0 (a)
 28 BUILD_TUPLE  1
 31 LOAD_CONST   1 (code object listcomp ...)
 34 LOAD_CONST   2 ('f.locals.C.listcomp')
 37 MAKE_CLOSURE 0
 40 LOAD_NAME4 (range)
 43 LOAD_CONST   3 (5)
 46 CALL_FUNCTION1 (1 positional, 0 keyword pair)
 49 GET_ITER
 50 CALL_FUNCTION1 (1 positional, 0 keyword pair)
 53 CALL_FUNCTION1 (1 positional, 0 keyword pair)
 56 POP_TOP
 57 LOAD_CONST   4 (None)
 60 RETURN_VALUE

 dis.dis(f.__code__.co_consts[2].co_consts[1])
  5   0 BUILD_LIST   0
  3 LOAD_FAST0 (.0)
6 FOR_ITER12 (to 21)
  9 STORE_FAST   1 (i)
 12 LOAD_DEREF   0 (a)
 15 LIST_APPEND  2
 18 JUMP_ABSOLUTE6
   21 RETURN_VALUE

--
nosy: +eryksun

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



[issue21279] str.translate documentation incomplete

2015-08-05 Thread Zachary Ware

Zachary Ware added the comment:

Very minor grammatical fixes, reflowed the .rst docs, and re-added the codecs 
module mention in a less obtrusive manner, but the patch is committed.  Thank 
you Kinga, Martin, and John!

--
nosy: +zach.ware

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



[issue21279] str.translate documentation incomplete

2015-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ae53bd5decae by Zachary Ware in branch '3.4':
Issue #21279: Flesh out str.translate docs
https://hg.python.org/cpython/rev/ae53bd5decae

New changeset 064b569e38fe by Zachary Ware in branch '3.5':
Issue #21279: Merge with 3.4
https://hg.python.org/cpython/rev/064b569e38fe

New changeset 967c9a9fe724 by Zachary Ware in branch 'default':
Closes #21279: Merge with 3.5
https://hg.python.org/cpython/rev/967c9a9fe724

--
nosy: +python-dev
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue24802] PyFloat_FromString Buffer Over-read

2015-08-05 Thread John Leitch

New submission from John Leitch:

Python suffers from a buffer over-read in PyFloat_FromString() that is caused 
by the incorrect assumption that buffers returned by PyObject_GetBuffer() are 
null-terminated. This could potentially result in the disclosure of adjacent 
memory.

PyObject *
PyFloat_FromString(PyObject *v)
{
const char *s, *last, *end;
double x;
PyObject *s_buffer = NULL;
Py_ssize_t len;
Py_buffer view = {NULL, NULL};
PyObject *result = NULL;

if (PyUnicode_Check(v)) {
s_buffer = _PyUnicode_TransformDecimalAndSpaceToASCII(v);
if (s_buffer == NULL)
return NULL;
s = PyUnicode_AsUTF8AndSize(s_buffer, len);
if (s == NULL) {
Py_DECREF(s_buffer);
return NULL;
}
}
else if (PyObject_GetBuffer(v, view, PyBUF_SIMPLE) == 0) {
s = (const char *)view.buf;  The unterminated buffer is retrieved 
here.
len = view.len;
}
else {
PyErr_Format(PyExc_TypeError,
float() argument must be a string or a number, not '%.200s',
Py_TYPE(v)-tp_name);
return NULL;
}
last = s + len;
/* strip space */
while (s  last  Py_ISSPACE(*s))
s++;
while (s  last - 1  Py_ISSPACE(last[-1]))
last--;
/* We don't care about overflow or underflow.  If the platform
 * supports them, infinities and signed zeroes (on underflow) are
 * fine. */
x = PyOS_string_to_double(s, (char **)end, NULL);  The buffer is then 
passed
along here.
if (end != last) {
PyErr_Format(PyExc_ValueError,
 could not convert string to float: 
 %R, v);
result = NULL;
}
else if (x == -1.0  PyErr_Occurred())
result = NULL;
else
result = PyFloat_FromDouble(x);

PyBuffer_Release(view);
Py_XDECREF(s_buffer);
return result;
}

double
PyOS_string_to_double(const char *s,
  char **endptr,
  PyObject *overflow_exception)
{
double x, result=-1.0;
char *fail_pos;

errno = 0;
PyFPE_START_PROTECT(PyOS_string_to_double, return -1.0)
x = _PyOS_ascii_strtod(s, fail_pos);
PyFPE_END_PROTECT(x)

if (errno == ENOMEM) {
PyErr_NoMemory();
fail_pos = (char *)s;
}
else if (!endptr  (fail_pos == s || *fail_pos != '\0'))
PyErr_Format(PyExc_ValueError,  If any of these error paths are 
taken, the
unterminated buffer is passed along 
without
its length, ultimately resulting in 
a call
to unicode_fromformat_write_cstr().
  could not convert string to float: 
  %.200s, s);
else if (fail_pos == s)
PyErr_Format(PyExc_ValueError,
  could not convert string to float: 
  %.200s, s);
else if (errno == ERANGE  fabs(x) = 1.0  overflow_exception)
PyErr_Format(overflow_exception,
  value too large to convert to float: 
  %.200s, s);
else
result = x;

if (endptr != NULL)
*endptr = fail_pos;
return result;
}

static int
unicode_fromformat_write_cstr(_PyUnicodeWriter *writer, const char *str,
  Py_ssize_t width, Py_ssize_t precision)
{
/* UTF-8 */
Py_ssize_t length;
PyObject *unicode;
int res;

length = strlen(str);  str points to the unterminated buffer, which 
means 
   strlen() my read off the end, depending on the 
contents
   of adjacent memory.
if (precision != -1)
length = Py_MIN(length, precision);
unicode = PyUnicode_DecodeUTF8Stateful(str, length, replace, NULL);  
The new,
incorrect 
length is
passed 
along.

 
if (unicode == NULL)
return -1;

res = unicode_fromformat_write_str(writer, unicode, width, -1);
Py_DECREF(unicode);
return res;
}

A script that reproduces the issue is as follows:

import array
float(array.array(B,bA*0x10))

And it produces the following exception:

0:000 gu
eax= ebx=06116b00 ecx= edx= esi=06116b00 edi=
eip=6516be1b esp=0080f440 ebp=0080f4f4 iopl=0 nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=0246
python35!PyFloat_FromString+0xab:
6516be1b 8b4c2454mov ecx,dword ptr [esp+54h] 
ss:002b:0080f494=090a2fe8
0:000 db @@(view.buf)
090a2fe8  41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41 

[issue24787] csv.Sniffer guesses M instead of \t or , as the delimiter

2015-08-05 Thread Skip Montanaro

Skip Montanaro added the comment:

Tiago, sorry, but your last post with results is completely unintelligible. Can 
you toss the table in a file and attach it instead?

--

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



[issue24800] exec docs should note that the no argument form in a local scope is really the two argument form

2015-08-05 Thread R. David Murray

R. David Murray added the comment:

OK, yes, so a class body at global scope or something like that :)

LOAD_CLASSDEREF is another whole level of complication to the scoping weirdness 
for classes; see issue 19979 and issue 24129.

--

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



[issue24804] https://www.python.org/ftp/python/2.7.4/python-2.7.4.msi actually installs 2.7.7

2015-08-05 Thread Zachary Ware

Zachary Ware added the comment:

The report is almost certainly not accurate and is probably a result of trying 
to install 2.7.4 on top of 2.7.7, which will not work (the 2.7.7 python27.dll 
is newer and not overwritten).  Either way, neither version is supported 
anymore.

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
resolution:  - not a bug
stage:  - resolved
status: open - closed
type:  - behavior

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



[issue23672] IDLE can crash if file name contains non-BMP Unicode characters

2015-08-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I made a different fix for avoid the error posted when running.  Sanad, PLEASE 
test running a file with astral char, the same way you did before, to see is 
there are any other problems.  I cannot get such a file into an Idle editor on 
Windows. I *think* this patch is enough, but cannot be sure.

I am leaving this open both for your test and a possible 2.7 backport.

--
stage: test needed - commit review

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



[issue24805] Python installer having problem in installing Python for all users in Windows

2015-08-05 Thread Debarshi Goswami

New submission from Debarshi Goswami:

Python installer (msi) having problem in installing Python for all users in 
Windows. It gets installed for installing user only. 

I was able to log the python output and found the below in the log. 
MSI (s) (8C:D0) [07:13:00:212]: Determined that existing product (either this 
product or the product being upgraded with a patch) is installed per-user.

I tried the below command combinations  to install python per machine, but it 
seems this a default product behavior. It should be fixed.

1. msiexec /i %setup_loc% TARGETDIR=C:\apps\Python34 ADDLOCAL=ALL 
ALLUSERS=1 MSIINSTALLPERUSER= /qb

2. msiexec /i %setup_loc% TARGETDIR=C:\apps\Python34 ADDLOCAL=ALL 
WHICHUSERS=ALL /qb 
  
3. msiexec /a %setup_loc% /passive /norestart TARGETDIR=c:\apps\Python34 
ADDLOCAL=ALL ALLUSERS=1


Setup_loc=python msi file location
ADDLOCAL=ALL -  Install all the features of the product .
ALLUSERS=1 - ALLUSERS property value of 1 specifies the per-machine 
installation .
MSIINSTALLPERUSER= - MSIINSTALLPERUSER property to an empty string () for a 
per-machine installation.

Please let me know if I am missing anything. It seems a bug to me.

--
components: Installation
messages: 248109
nosy: Debarshi.Goswami
priority: normal
severity: normal
status: open
title: Python installer having problem in installing Python for all users in 
Windows
type: behavior
versions: Python 3.4

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



[issue24801] right-mouse click in IDLE on Mac doesn't work

2015-08-05 Thread Mark Roseman

Changes by Mark Roseman m...@markroseman.com:


--
components: +IDLE

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



[issue24787] csv.Sniffer guesses M instead of \t or , as the delimiter

2015-08-05 Thread Tiago Wright

Tiago Wright added the comment:

I've run the Sniffer against 1614 csv files on my computer and compared the
delimiter it detects to what I have set manually. Here are the results:

 SnifferHuman,;\t\(blank)Error:)ceMpGrand TotalError rate,498  2
110  1   5122.7%; 1  10.0%\t3 922 69121  227105412.5%|   33
330.0%space91   4  1435.7%Grand Total5011922351610221142271614
-Tiago

On Tue, Aug 4, 2015 at 3:51 PM R. David Murray rep...@bugs.python.org
wrote:


 R. David Murray added the comment:

 If you look at the algorithm it is doing some fancy things with metrics,
 but does have a 'preferred delimiters' list that it checks.  It is possible
 things could be improved either by tweaking the threshold or by somehow
 giving added weight to the metrics when the candidate character is in the
 preferred delimiter list.

 We might have to do this with a feature flag to turn it on, though, since
 it could change the results for programs that happen to work with the
 current algorithm.

 --
 nosy: +r.david.murray

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue24787
 ___


--

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



[issue24802] PyFloat_FromString Buffer Over-read

2015-08-05 Thread John Leitch

John Leitch added the comment:

Attaching repro

--
Added file: 
http://bugs.python.org/file40133/PyFloat_FromString_Buffer_Over-read.py

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



[issue24667] OrderedDict.popitem()/__str__() raises KeyError

2015-08-05 Thread Eric Snow

Eric Snow added the comment:

If I don't get any feedback before then, I'll commit the patch on Friday.

--

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



[issue24667] OrderedDict.popitem()/__str__() raises KeyError

2015-08-05 Thread Eric Snow

Eric Snow added the comment:

@Fabian, hey, thanks for bringing it to our attention!

--

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



[issue24802] PyFloat_FromString Buffer Over-read

2015-08-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
type: behavior - crash

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



[issue24803] PyNumber_Long Buffer Over-read.patch

2015-08-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
versions: +Python 2.7, Python 3.4, Python 3.6

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



[issue24802] PyFloat_FromString Buffer Over-read

2015-08-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee:  - serhiy.storchaka
components: +Interpreter Core
nosy: +serhiy.storchaka
stage:  - patch review
type: security - behavior
versions: +Python 2.7, Python 3.4, Python 3.6

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



[issue24805] Python installer having problem in installing Python for all users in Windows

2015-08-05 Thread Zachary Ware

Zachary Ware added the comment:

The default for the 3.4 installer is to install for all users, so it's strange 
that you can't get it to install for all users.  The log message you quote 
suggests that there's already a Python 3.4 installed per-user, is that the 
case?  What results do you get with no 3.4 installed at all?

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
stage:  - test needed

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



[issue23672] IDLE can crash if file name contains non-BMP Unicode characters

2015-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dda625798111 by Terry Jan Reedy in branch '3.4':
Issue #23672: Allow Idle to edit and run files with astral chars in name.
https://hg.python.org/cpython/rev/dda625798111

New changeset 97d50e6247e1 by Terry Jan Reedy in branch '3.5':
Issue #23672:Merge with 3.4
https://hg.python.org/cpython/rev/97d50e6247e1

New changeset 180bfaa7cdf8 by Terry Jan Reedy in branch 'default':
Issue #23672:Merge with 3.5
https://hg.python.org/cpython/rev/180bfaa7cdf8

--
nosy: +python-dev

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



[issue24801] right-mouse click in IDLE on Mac doesn't work

2015-08-05 Thread Mark Roseman

New submission from Mark Roseman:

For popup menus, control-click works, but right-click on mouse buttons that 
support it, doesn't work.

This is a followup to #10404, last addressed in 2010.

As noted there, right click behaviour should be supported.

The right click Tk text bindings on Mac (which is B2) seem to bind both to the 
virtual 'PasteSelection' event, and also to fast-scroll through a large file is 
you click and drag with the right mouse button. Both of these are blatant 
problems with Tk's text.tcl.

The issue when trying to fix this before was when a B2 (context menu) binding 
was added to the text widget, both that and the bogus B2 bindings fired. This 
is because Tk can fire multiple bindings for a widget (default is bindings for 
the widget itself, the widget's toplevel, the widget's class, and 'all'). 

There is a way to short-circuit this in Tcl (basically the widget-specific 
binding calls 'break', which prevents the others from firing). The simpler 
alternative is probably just redefining the alternative class-level (Text) 
bindings.

In other words, yeah, this should be pretty easily fixable.

--
messages: 248092
nosy: markroseman, ned.deily, ronaldoussoren, terry.reedy
priority: normal
severity: normal
status: open
title: right-mouse click in IDLE on Mac doesn't work
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

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



[issue18082] Inconsistent behavior of IOBase methods on closed files

2015-08-05 Thread Martin Panter

Martin Panter added the comment:

The documentation https://docs.python.org/dev/library/io.html#io.IOBase says 
“. . . calling any method (even inquiries) on a closed stream is undefined. 
Implementations may raise ValueError”. So IMO you shouldn’t rely on any 
particular success or failure behaviour of these methods when a stream is 
closed.

Having the stream methods waste time calling out to Python methods and 
descriptors like readable() and “closed” all the time can make things 
unnecessarily slow and inefficient (see my work at the end of Issue 18003 for 
example). On the other hand, removing the existing checks could potentially 
break someone’s code. I suggest closing this, unless someone has a specific 
proposal or reason to change.

--
nosy: +vadmium

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



[issue24803] PyNumber_Long Buffer Over-read.patch

2015-08-05 Thread John Leitch

New submission from John Leitch:

Python suffers from a buffer over-read in PyNumber_Long() that is caused by the 
incorrect assumption that buffers returned by PyObject_GetBuffer() are 
null-terminated. This could potentially result in the disclosure of adjacent 
memory.

PyObject *
PyNumber_Long(PyObject *o)
{
[...]

if (PyObject_GetBuffer(o, view, PyBUF_SIMPLE) == 0) {  The 
unterminated buffer 
is retreived 
here.
/* need to do extra error checking that PyLong_FromString()
 * doesn't do.  In particular int('9\x005') must raise an
 * exception, not truncate at the null.
 */
PyObject *result = _PyLong_FromBytes(view.buf, view.len, 10);  The 
buffer
is then passed to 
_PyLong_FromBytes(),
which ultimately passes it to
PyLong_FromString().
PyBuffer_Release(view);
return result;
}

return type_error(int() argument must be a string, a bytes-like object 
  or a number, not '%.200s', o);
}

PyObject *
PyLong_FromString(const char *str, char **pend, int base)
{
int sign = 1, error_if_nonzero = 0;
const char *start, *orig_str = str;
PyLongObject *z = NULL;
PyObject *strobj;
Py_ssize_t slen;

[...]

  onError:
if (pend != NULL)
*pend = (char *)str;
Py_XDECREF(z);
slen = strlen(orig_str)  200 ? strlen(orig_str) : 200;  If this path 
is taken,
orig_str is pointing to 
the
unterminated string, 
resulting in

strlen reading off the end of the
buffer.
strobj = PyUnicode_FromStringAndSize(orig_str, slen);  The incorrect 
length is
  then used to 
create a Python
  string.
if (strobj == NULL)
return NULL;
PyErr_Format(PyExc_ValueError,
 invalid literal for int() with base %d: %.200R,
 base, strobj);
Py_DECREF(strobj);
return NULL;
}

A script that reproduces the issue is as follows:

import array
int(array.array(B,bA*0x10))

And it produces the following exception:

0:000 p
eax= ebx=5dbc4699 ecx= edx= esi=07ad6b00 edi=
eip=5da07f7e esp=00e4f8f8 ebp=00e4f934 iopl=0 nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=0246
python35!PyNumber_Long+0x20e:
5da07f7e 6a0apush0Ah
0:000 db @@(view.buf)
096fefe8  41 41 41 41 41 41 41 41-41 41 41 41 41 41 41 41  
096feff8  c0 c0 c0 c0 d0 d0 d0 d0-?? ?? ?? ?? ?? ?? ?? ??  
096ff008  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff018  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff028  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff038  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff048  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff058  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
0:000 g
Breakpoint 3 hit
eax=07aed7b0 ebx=000a ecx=07aed7a0 edx=07aed000 esi=096fefe8 edi=096fefe8
eip=5da3a55e esp=00e4f870 ebp=00e4f8c4 iopl=0 nv up ei pl nz ac po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=0212
python35!PyLong_FromString+0x4ce:
5da3a55e 8b74244cmov esi,dword ptr [esp+4Ch] 
ss:002b:00e4f8bc=096fefe8
0:000 g
(648.e5c): Access violation - code c005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=07aed7d0 ebx=000a ecx=096ff000 edx=096fefe9 esi=096fefe8 edi=096fefe8
eip=5da3a567 esp=00e4f870 ebp=00e4f8c4 iopl=0 nv up ei ng nz na po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=00010282
python35!PyLong_FromString+0x4d7:
5da3a567 8a01mov al,byte ptr [ecx]  ds:002b:096ff000=??
0:000 db ecx-0x10
096feff0  41 41 41 41 41 41 41 41-c0 c0 c0 c0 d0 d0 d0 d0  
096ff000  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff010  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff020  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff030  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff040  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff050  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  
096ff060  ?? ?? ?? ?? 

[issue24795] Make event loops with statement context managers

2015-08-05 Thread STINNER Victor

STINNER Victor added the comment:

+1 for me. Asyncio examples already have this try/finally pattern. I
already proposed to support context manager some months ago.

Guido, I don't understand your point. Usually the main function id
loop.run_until_complete/.run_forever. That's all. It doesn't mean that the
loop only runs a few milliseconds.

--

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



[issue22329] Windows installer can't recover partially installed state

2015-08-05 Thread Steve Dower

Steve Dower added the comment:

Thanks. Unfortunately I can't get anything helpful from that log because it's 
failing too early. It seems like you have some corruption in your Windows 
installer database, since it isn't even getting far enough into the Python 
installer. I'd track down a troubleshooter or reputable system cleaner and see 
if you can clean up your system.

--

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



[issue24782] Merge 'configure extensions' into main IDLE config dialog

2015-08-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I presume sorting the list is a trivial matter.

--

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



[issue24792] zipimporter masks import errors

2015-08-05 Thread Amund Hov

New submission from Amund Hov:

Due to mixed version .pyc files in my zipped python application I was getting 
inconsistent loading of certain packages.

E.g.

n [4]: zf.find_module('kitconsole')
Out[4]: zipimporter object test_controller_test.zip

In [5]: zf.load_module('kitconsole')
---
ZipImportErrorTraceback (most recent call last)
ipython-input-5-8e75885cc952 in module()
 1 zf.load_module('kitconsole')

ZipImportError: can't find module 'kitconsole'


Unpacking the archive and doing the import from the file system revealed the  
real issue, ImportError: Bad Magic Number.

As an end user it was confusing that zipimporter reported being able to find 
the module in find_module(), but not in load_module(). Is it possible to have 
load_module provide a better error message when import fails? The wording now 
does not give any hints when searching the bug-tracker / Google.

--
messages: 248022
nosy: Amund Hov
priority: normal
severity: normal
status: open
title: zipimporter masks import errors
type: behavior
versions: Python 3.4

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



[issue24792] zipimporter masks import errors

2015-08-05 Thread Amund Hov

Changes by Amund Hov amund@gmail.com:


--
type: behavior - enhancement

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



[issue24793] Calling 'python' via subprocess.call ignoring passed %PATH%

2015-08-05 Thread Gregor

New submission from Gregor:

I just noticed that there is a litte inconvenience when I try to invoke 
'python' via subprocess.call passing an environment (%PATH%) from a script. I 
pass an environment where %PATH% only contains one directory where a 
python2.7.3-exe is present (I checked with 
subprocess.call(['where','python'],env=environment) that python is found 
there). However when calling subprocess.call(['python'],env=environment) 
python 2.7.9 is opened, which is the python version I called the script with. 
Seems inconvenient to me.

Greetings

--
components: Windows
messages: 248023
nosy: paul.moore, phbarnacle, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Calling 'python' via subprocess.call ignoring passed %PATH%
type: behavior
versions: Python 2.7

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



[issue24794] PyZipFile mixes compiled files from different python versions.

2015-08-05 Thread Amund Hov

New submission from Amund Hov:

In my project I have a mixture of scripts using Python 2.7 and 3.4.
Some of the scripts using python 3.4 are packaged into archives using
PyZipFile.

Through some combination I ended up with 2.7 compiled packages in my archive 
when packaging using python 3.4. In combination with issue 24792 zipimporter 
masks import errors this led to many grey hairs figuring out why my packaging 
scripts suddenly broke.

Are there sufficient provisions in PyZipFile to prevent this? It seems it will 
happily mix compiled files with differing magic bytes.

--
messages: 248024
nosy: Amund Hov
priority: normal
severity: normal
status: open
title: PyZipFile mixes compiled files from different python versions.
type: behavior

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



[issue2292] Missing *-unpacking generalizations

2015-08-05 Thread Guido van Rossum

Guido van Rossum added the comment:

Yes we should. I'd consider it a bug if it wasn't supported in 3.5.0 and we 
could fix that bug in 3.5.1.

--

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



[issue24272] PEP 484 docs

2015-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a8dcbd2711d6 by Guido van Rossum in branch '3.5':
Issue #24272: Initial docs for typing.py (PEP 484).
https://hg.python.org/cpython/rev/a8dcbd2711d6

New changeset 0c74fd4219aa by Guido van Rossum in branch 'default':
Issue #24272: Initial docs for typing.py (PEP 484). (Merge from 3.5.)
https://hg.python.org/cpython/rev/0c74fd4219aa

--
nosy: +python-dev

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



[issue23973] PEP 484 implementation

2015-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f142b7c7a8e3 by Guido van Rossum in branch '3.5':
Issue #23973: Update typing.py from GitHub repo.
https://hg.python.org/cpython/rev/f142b7c7a8e3

New changeset c9a6ce666ff2 by Guido van Rossum in branch 'default':
Issue #23973: Update typing.py from GitHub repo. (Merge from 3.5.)
https://hg.python.org/cpython/rev/c9a6ce666ff2

--
nosy: +python-dev

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



[issue24272] PEP 484 docs

2015-08-05 Thread Guido van Rossum

Guido van Rossum added the comment:

I've landed this now (for real). Next time please strip all trailing whitespace 
from typing.rst, else the hg push fails!

--

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



[issue24793] Calling 'python' via subprocess.call ignoring passed %PATH%

2015-08-05 Thread Paul Moore

Paul Moore added the comment:

This is standard Windows behaviour. Executables are always located first in the 
directory where your program (in this case the Python executable) is running 
from - even before searching PATH.

If you want to use a different Python, you should specify the full path  to the 
executable - subprocess.call([C:\\Python34\\python.exe]).

--
resolution:  - not a bug
status: open - closed

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



[issue24793] Calling 'python' via subprocess.call ignoring passed %PATH%

2015-08-05 Thread eryksun

eryksun added the comment:

Popen calls Windows [CreateProcess][1]. If the Popen executable argument 
isn't used or if the file from the command line doesn't include a directory 
path, then CreateProcess searches for it in the following directories:

1. The directory from which the application loaded.
2. The current directory for the parent process.
   * This step is skipped if the parent defines
 %NoDefaultCurrentDirectoryInExePath%.
3. The 32-bit Windows system directory.
4. The 16-bit Windows system directory. 
5. The Windows directory. 
6. The directories that are listed in the PATH 
   environment variable. 

Also note that the PATH searched is that of the *parent* process; the env 
parameter doesn't affect this. 

Call the SearchPath function if you need a custom search for the fully 
qualified path. 

import ctypes
from ctypes import wintypes

kernel32 = ctypes.WinDLL('kernel32')

kernel32.SearchPathW.argtypes = (
wintypes.LPCWSTR,   # _In_opt_  lpPath
wintypes.LPCWSTR,   # _In_  lpFileName
wintypes.LPCWSTR,   # _In_opt_  lpExtension
wintypes.DWORD, # _In_  nBufferLength
wintypes.LPWSTR,# _Out_ lpBuffer
ctypes.POINTER(wintypes.LPWSTR))# _Out_opt_ lpFilePart

def search_path(filename, path=None, ext='.exe'):
length, new_length = 0, 260
while new_length  length:
length = new_length
filepath = (ctypes.c_wchar * length)()
new_length = kernel32.SearchPathW(path, filename, ext,
  length, filepath, None)
return filepath.value

For example:

 search_path('python')
u'C:\\Program Files\\Python27\\python.exe'
 import os
 search_path('python', os.environ['PATH'])
u''

 search_path('more.com', os.environ['PATH'])
u'C:\\Windows\\System32\\more.com'
 search_path('more', ext='.com')
u'C:\\Windows\\system32\\more.com'

[1]: https://msdn.microsoft.com/en-us/library/ms682425

--
nosy: +eryksun

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



[issue24759] Idle: add ttk widgets as an option

2015-08-05 Thread Nick Coghlan

Nick Coghlan added the comment:

IDLE's in an interesting place right now - it isn't showing people Tcl/Tk in 
its best light, so folks are likely to assume all Tcl/Tk apps necessarily look 
that way, and it's also using GUI idioms like separate shell and editor windows 
that don't reflect the conventions of modern IDEs.

For 3.5.1+, I think there's no question that we want to show IDLE in the best 
possible light, and we want to try to do that by default. That means 
modernising it to use the best cross-platform features that Tcl/Tk has to offer 
(including ttk).

However, Ned pointed out that the last PPC-supporting Mac OS X (10.5) has a 
Tcl/Tk version older than 8.5, and there's the general compatibility risk for 
breaking extensions with large refactorings, so retaining a non-ttk mode will 
be a valuable approach to the modernisation effort.

--
nosy: +ned.deily

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



[issue24795] Make event loops with statement context managers

2015-08-05 Thread Mathias Fröjdman

New submission from Mathias Fröjdman:

Since asyncio event loops have to be closed nowadays, it would be pretty 
convenient and pythonic to make BaseEventLoop a context manager that calls 
self.close() in __exit__ the same way as contextlib.closing() does it. Example:

import asyncio

with asyncio.get_event_loop() as loop:
loop.run_until_complete(func())

instead of

import asyncio
from contextlib import closing

with closing(asyncio.get_event_loop()) as loop:
loop.run_until_complete(func())

or event the bulkier

import asyncio

loop = asyncio.get_event_loop()
try:
loop.run_until_complete(func())
finally:
loop.close()

The attached patch applies to Python 3.5b4's asyncio/base_events.py

--
components: asyncio
files: patch
messages: 248032
nosy: Mathias Fröjdman, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Make event loops with statement context managers
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file40129/patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24795
___
___
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-05 Thread Nick Coghlan

Nick Coghlan added the comment:

This is an interesting find - thanks.

Adding Larry as 3.5 release manager to the cc here, as I think the right fix 
actually involves an API adjustment inside _imp.

One of the consequences of PEP 489 (multi-phase initialisation) was that 
builtin imports and extension module imports now share a lot more code, and 
that includes the fact that while we have both _imp.create_builtin and 
_imp.create_dynamic, they currently share a module level exec implementation in 
_imp.exec_dynamic.

However, the definition and implementation of _imp.exec_dynamic is still behind 
the same preprocessor guard as _imp.create_dynamic, hence the error reported 
here.

As far as a fix goes, rather than defining _imp.exec_dynamic unconditionally, 
my inclination is to say that merging the Python level APIs in addition to the 
underyling C level implementation represents a design mistake when we 
implemented the PEP, and there should be a separate _imp.exec_builtin function.

The fact that _imp.exec_dynamic just called _imp.exec_builtin internally would 
then be a pure CPython implementation detail, rather than something importlib 
specifically depended on.

--
nosy: +encukou

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



[issue24795] Make event loops with statement context managers

2015-08-05 Thread Mathias Fröjdman

Mathias Fröjdman added the comment:

(Just noticed http://bugs.python.org/issue19860, which I originally failed to 
notice when just searching for asyncio loop and not context manager)

Anyway, in recent Python/asyncio versions, failing to close the event loop 
before exiting whole the process can cause problems, so I think the case is 
valid now.

--

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



[issue24795] Make event loops with statement context managers

2015-08-05 Thread Guido van Rossum

Guido van Rossum added the comment:

This seems the wrong idea to me. Event loops should be long-lived, so the
context manager would ideally see very little use.

--

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



[issue24796] Deleting names referencing from enclosed and enclosing scopes

2015-08-05 Thread Nick Coghlan

New submission from Nick Coghlan:

While committing issue #24129, I noticed the following in the execution model 
documentation:

==
If a variable is referenced in an enclosing scope, it is illegal to delete the 
name. An error will be reported at compile time.
==

I'm not sure what that means, as both of the following compiled fine for me 
under 3.4.2:

 def f():
... x = 1
... def g():
... nonlocal x
... del x
... 
 def f():
... x = 1
... del x
... def g():
... print(x)
...

--
assignee: docs@python
components: Documentation
messages: 248036
nosy: docs@python, ncoghlan
priority: normal
severity: normal
status: open
title: Deleting names referencing from enclosed and enclosing scopes

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



[issue15944] memoryviews and ctypes

2015-08-05 Thread Yuriy Syrovetskiy

Yuriy Syrovetskiy added the comment:

You don't need `raw=True`, `.cast('b')` already must do this. But 
unfortunately, is is not implemented yet.

--
nosy: +cblp

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



[issue24129] Incorrect (misleading) statement in the execution model documentation

2015-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 94e215a5e24b by Nick Coghlan in branch '3.4':
Issue #24129: Clarify reference docs for name resolution.
https://hg.python.org/cpython/rev/94e215a5e24b

New changeset 5e4d21311772 by Nick Coghlan in branch '3.5':
Merge issue #24129 from 3.4
https://hg.python.org/cpython/rev/5e4d21311772

New changeset e75881393cf2 by Nick Coghlan in branch 'default':
Merge issue #24129 from 3.5
https://hg.python.org/cpython/rev/e75881393cf2

--
nosy: +python-dev

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



[issue24794] PyZipFile mixes compiled files from different python versions.

2015-08-05 Thread R. David Murray

R. David Murray added the comment:

Yes, that used to be a general problem with .pyc files before we introduced 
__pycache__.  PyZipFile still supports the legacy mode by using whatever .pyc 
file is there, if there is one.  Perhaps it is time to deprecate the legacy 
mode in 3.6?

--
nosy: +r.david.murray

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



[issue24796] Deleting names referencing from enclosed and enclosing scopes

2015-08-05 Thread Nick Coghlan

Nick Coghlan added the comment:

Note that I haven't attempted to resolve this myself, as I'm not sure if we 
should just delete the paragraph, or if we accidentally dropped a compile time 
error check that didn't have any tests somewhere along the line.

Probably a good one to raise on python-dev...

--

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



[issue24129] Incorrect (misleading) statement in the execution model documentation

2015-08-05 Thread Nick Coghlan

Nick Coghlan added the comment:

I merged Ivan's latest patch to 3.4/3.5/default. We're unlikely to ever be able 
to make these docs completely intuitive (as name resolution is genuinely 
complex), but Ivan's revisions at least mean we're no longer assuming readers 
know how the name resolution worked prior to the introduction of lexical 
scoping, and a couple of tricky cases now have inline examples.

I also noticed an existing paragraph in the docs that *I* didn't understand, 
and filed issue #24796 to cover that. I'm not sure if we should just delete the 
paragraph, or if we accidentally dropped a compile time error check that didn't 
have any tests to ensure we were detecting the problem.

--
resolution:  - fixed
stage: commit review - resolved
status: open - closed
type: behavior - enhancement

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



[issue24796] Deleting names referencing from enclosed and enclosing scopes

2015-08-05 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I wonder if it is a left-over from the behaviour prior to 3.2? In 3.1, I
get this syntax error:

py def outer():
... spam = 1
... def inner():
... nonlocal spam
... del spam
... inner()
...
SyntaxError: can not delete variable 'spam' referenced in nested scope

See also the Changed in 3.2 comment here:

https://docs.python.org/3/reference/simple_stmts.html#the-del-statement

--
nosy: +steven.daprano

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



[issue24129] Incorrect (misleading) statement in the execution model documentation

2015-08-05 Thread Nick Coghlan

Nick Coghlan added the comment:

I merged Ivan's latest patch to 3.4/3.5/default. We're unlikely to ever be able 
to make these docs completely intuitive (as name resolution is genuinely 
complex), but Ivan's revisions at least mean we're no longer assuming readers 
know how the name resolution worked prior to the introduction of lexical 
scoping, and a couple of tricky cases now have inline examples.

I also noticed an existing paragraph in the docs that *I* didn't understand, 
and filed issue #24796 to cover that. I'm not sure if we should just delete the 
paragraph, or if we accidentally dropped a compile time error check that didn't 
have any tests to ensure we were detecting the problem.

--

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



[issue24129] Incorrect (misleading) statement in the execution model documentation

2015-08-05 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
Removed message: http://bugs.python.org/msg248043

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



[issue24791] *args regression

2015-08-05 Thread Yury Selivanov

Yury Selivanov added the comment:

 Actually, I think `star_expr` will probably go away entirely.

I'm not so concerned with supporting [*[] or []] stuff, but rather fixing the 
immediate regression in 3.5.0.  I'd keep the patch size to the minimum.

--

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



[issue24129] Incorrect (misleading) statement in the execution model documentation

2015-08-05 Thread Nick Coghlan

Nick Coghlan added the comment:

The issue tracker was having issues and didn't automatically register the 
commits. Links:

3.4: https://hg.python.org/cpython/rev/94e215a5e24b
3.5: https://hg.python.org/cpython/rev/5e4d21311772
default: https://hg.python.org/cpython/rev/e75881393cf2

--

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



[issue24272] PEP 484 docs

2015-08-05 Thread Daniel Andrade Groppe

Daniel Andrade Groppe added the comment:

@Ivan, I'll work on the remaining half.

--

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



[issue24796] Deleting names referencing from enclosed and enclosing scopes

2015-08-05 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi levkivs...@gmail.com:


--
nosy: +levkivskyi

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



[issue24797] email.header.decode_header return type is not consistent

2015-08-05 Thread Sebastian Kreft

New submission from Sebastian Kreft:

The return type of email.header.decode_header is not consistent. When there are 
encoded parts the return type is a list of (bytes, charset or None) (Note that 
the documentation says it is a list of (str, charset)). However, when there are 
no encoded parts the return type is [(str, None)]. Note that, at the end of the 
function, there is a routine that converts everything to bytes.

Compare:
In [01]: email.header.decode_header('=?UTF-8?Q?foo?=bar')
Out[01]: [(b'foo', 'utf-8'), (b'bar', None)]

In [02]: email.header.decode_header('foobar')
Out[02]: [('foobar', None)]

--
messages: 248047
nosy: Sebastian Kreft
priority: normal
severity: normal
status: open
title: email.header.decode_header return type is not consistent
versions: Python 3.4, Python 3.5, Python 3.6

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



[issue24797] email.header.decode_header return type is not consistent

2015-08-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
components: +email
nosy: +barry, r.david.murray
type:  - behavior

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



[issue23749] asyncio missing wrap_socket (starttls)

2015-08-05 Thread Yury Selivanov

Yury Selivanov added the comment:

I'm working on porting pypostgresql (pure python postgresql driver) library to 
use asyncio as its underlying IO machinery.  And it appears that PQ3 protocol 
starts as clear text, and then upgrades to use TLS (if server or connection 
configured so).

I've been experimenting with various approaches to how we can design an API for 
this, and below are some of my thoughts:

1. The API cannot be implemented on event loop. Loops generally know nothing 
about the internal structure of transports, i.e. what loop or protocol the 
transport is attached to.

2. The API cannot be implemented on protocols. Protocols are decoupled from 
transports (they only receive a reference to the corresponding transport in 
their connection_made method). Access to the transport is requires to create an 
SSL proxy transport/protocol pair.

3. Therefore, the most convenient place to add the new API are *transports*. I 
propose to add a 'start_ssl' method to transports with the following signature:

def start_ssl(self, sslcontext=None,
  server_side=False, server_hostname=None) - Transport:

It will only be implemented on Python 3.5 (because of SSL MemoryBIO 
requirement).

Protocols can call 'start_ssl' any time after 'connection_made' is called. 
'start_ssl' returns a new Transport (ssl proxy) that has to be used from that 
moment on.  In case the SSL handshake fails, protocol's 'connection_lost' 
method will be called.

--

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



[issue24797] email.header.decode_header return type is not consistent

2015-08-05 Thread R. David Murray

R. David Murray added the comment:

Yeah, don't use that, use the new APIs.

--
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - email.header.decode_header sometimes returns bytes, sometimes 
str

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



[issue24792] zipimporter masks import errors

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +brett.cannon, eric.snow, gregory.p.smith, ncoghlan, superluser, twouters

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



[issue19699] Update zipimport for PEP 451

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +gregory.p.smith, superluser, twouters

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



[issue23734] zipimport should not check pyc timestamps against zipped py files

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +brett.cannon, eric.snow, ncoghlan, superluser
versions: +Python 3.6 -Python 3.5

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



[issue24792] zipimporter masks import errors

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
versions: +Python 3.5, Python 3.6

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



[issue23327] zipimport to import from non-ascii pathname on Windows

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +eric.snow, superluser

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



[issue5950] Make zipimport work with zipfile containing comments

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


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

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



[issue19883] Integer overflow in zipimport.c

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
versions: +Python 3.6

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



[issue19699] Update zipimport for PEP 451

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
versions: +Python 3.6 -Python 3.5

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



[issue19883] Integer overflow in zipimport.c

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +eric.snow, superluser

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



[issue23327] zipimport to import from non-ascii pathname on Windows

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
type: crash - behavior
versions: +Python 3.5, Python 3.6

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



[issue21062] Evalute all import-related modules for best practices

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +superluser

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



[issue17004] Expand zipimport to include other compression methods

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +gregory.p.smith, superluser
versions: +Python 3.6 -Python 3.4

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



[issue1116520] Prefix search is filesystem-centric

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +gregory.p.smith, superluser
versions: +Python 3.6 -Python 3.5

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



[issue19081] zipimport behaves badly when the zip file changes while the process is running

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +superluser
versions: +Python 3.6 -Python 3.3

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



[issue14678] Update zipimport to support importlib.invalidate_caches()

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +superluser
versions: +Python 3.6 -Python 3.3

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



[issue16651] Find out what stdlib modules lack a pure Python implementation

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


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

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



[issue15713] PEP 3121, 384 Refactoring applied to zipimport module

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +brett.cannon, gregory.p.smith, superluser
stage:  - patch review
versions: +Python 3.6 -Python 3.4

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



[issue8400] zipimporter find_module fullname mis-documented

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
versions: +Python 3.4, Python 3.5, Python 3.6 -Python 3.2

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



[issue8400] zipimporter find_module fullname mis-documented

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +brett.cannon, gregory.p.smith, superluser

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



[issue17633] zipimport's handling of namespace packages is incorrect

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
stage:  - patch review
type:  - behavior

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



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +superluser
versions: +Python 3.6 -Python 3.3, Python 3.4

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



[issue17633] zipimport's handling of namespace packages is incorrect

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +gregory.p.smith, superluser
versions: +Python 3.6 -Python 3.5

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



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2015-08-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +gregory.p.smith

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



[issue24798] Issue in the MSVC compiler class in distutils on Python 3.5

2015-08-05 Thread gladman

New submission from gladman:

I have been using _msvcompiler.py from Python 3.5 to build some executables but 
I have been unable to get it to generate and embed a  manifest.  

When I looked into this I found that the subroutine that sets up the parameters 
for generating a manifest ('manifest_get_embed_info'  at around line 471) has 
the line:

ld_args.append('/MANIFESTFILE:' + temp_manifest)

to set the manifest's name but doesn't actually ask for a manifest to be 
generated.  Here is what is said about /MANIFESTFILE on MSDN:

/MANIFESTFILE will have no effect if you do not also link with /MANIFEST.

After adding:

ld_args.append('/MANIFEST')

before the above line, I then succeed in obtaining the manifest.

--
components: Distutils
messages: 248050
nosy: dstufft, eric.araujo, gladman
priority: normal
severity: normal
status: open
title: Issue in the MSVC compiler class in distutils on Python 3.5
type: behavior
versions: Python 3.5

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



[issue24798] _msvccompiler.py doesn't properly support manifests

2015-08-05 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
assignee:  - steve.dower
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
title: Issue in the MSVC compiler class in distutils on Python 3.5 - 
_msvccompiler.py doesn't properly support manifests
versions: +Python 3.6

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



[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7aa2d3e1c885 by Yury Selivanov in branch '3.4':
Issue #23812: Fix asyncio.Queue.get() to avoid loosing items on cancellation.
https://hg.python.org/cpython/rev/7aa2d3e1c885

New changeset d5644d7e222d by Yury Selivanov in branch '3.5':
Issue #23812: Fix asyncio.Queue.get() to avoid loosing items on cancellation.
https://hg.python.org/cpython/rev/d5644d7e222d

New changeset 8f581da70ccd by Yury Selivanov in branch 'default':
Issue #23812: Fix asyncio.Queue.get() to avoid loosing items on cancellation.
https://hg.python.org/cpython/rev/8f581da70ccd

--
nosy: +python-dev

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



[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-08-05 Thread Yury Selivanov

Yury Selivanov added the comment:

The fix is committed. Closing the issue. Thanks a lot, Gustavo!

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

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



[issue24798] _msvccompiler.py doesn't properly support manifests

2015-08-05 Thread Steve Dower

Steve Dower added the comment:

I've simplified the manifest handling:

* embed by default, since we no longer need to filter CRT SxS info
* omit UAC info from DLLs
* use full PATH when running tools
* some other tidying

Not necessarily going to wait for lots of reviews, as I know very few people 
are interested in distutils, but feel free to chime in if you like. I'll give 
it a day or so.

--
keywords: +patch
Added file: http://bugs.python.org/file40130/24798_1.patch

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



[issue24778] mailcap.findmatch() ........ Shell Command Injection in filename

2015-08-05 Thread Bernd Dietzel

Bernd Dietzel added the comment:

# for the docs ... quoting of the filename when you call mailcap.findmatch()

f=;xterm;#.txt # Shell Command Demo ... xterm will run if quote() fails

import mailcap
import random
try:
  from shlex import quote
except ImportError:
  from pipes import quote
d=mailcap.getcaps()
PY=''.join(random.choice('PYTHON') for i in range(100))
cmd,MIMEtype=mailcap.findmatch(d, 'text/plain', filename=PY)
while '+PY+' in cmd:
   cmd=cmd.replace('+PY+',quote(f))
while PY in cmd:
   cmd=cmd.replace(PY,quote(f))
print(cmd)  
# less ';xterm;#.txt'

--

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



[issue24799] IDLE should detect changes to open files by other processes

2015-08-05 Thread Al Sweigart

New submission from Al Sweigart:

Many IDEs will check for changes to their opened files made by other programs. 
This is usually done with a quick check when the IDE's window gets focus.

A dialog will tell the user the file has changed on disk and ask if they want 
to reload it. This dialog is only shown when the file has changed AND there are 
unsaved changes made in the editor. Otherwise, the file changes are just 
silently reloaded. (This is the behavior of Sublime Text.)

--
components: IDLE
messages: 248059
nosy: Al.Sweigart
priority: normal
severity: normal
status: open
title: IDLE should detect changes to open files by other processes
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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



[issue22329] Windows installer can't recover partially installed state

2015-08-05 Thread Ethan Henderson

Ethan Henderson added the comment:

I have the same issue on 3.4.3 x64 on Windows 10 x64.

I set PYTHONHOME and PYTHONPATH (Just to C:/Python34), but that didn't fix the 
problem.

--
nosy: +Zbee

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



[issue24778] mailcap.findmatch: document shell command Injection danger in filename parameter

2015-08-05 Thread R. David Murray

R. David Murray added the comment:

I have no idea what your code samples are trying to accomplish, I'm afraid, but 
that's not the kind of documentation I'm advocating anyway.

--
title: mailcap.findmatch()    Shell Command Injection in filename - 
mailcap.findmatch: document shell command Injection danger in filename parameter

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



[issue24778] mailcap.findmatch: document shell command Injection danger in filename parameter

2015-08-05 Thread Bernd Dietzel

Bernd Dietzel added the comment:

What i do is the last doc is like this :

1) Replace the filename with a random name
2) Run mailcap.findmatch() with the random name
3) If exists, replace the quote characters ' before and behind the random name 
with nothing.
4) Now the random name has no quoting from mailcap itself
5) So now we can use our own quote() savely

--

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



[issue24667] OrderedDict.popitem()/__str__() raises KeyError

2015-08-05 Thread Fabian

Fabian added the comment:

Thank you for figuring it out and providing a patch after I couldn't really 
give good information. I haven't been able to test it for myself but your 
explanation makes sense :)

--

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



[issue24800] Incorrect handling of local variables in comprehensions with exec()

2015-08-05 Thread Peter Eastman

New submission from Peter Eastman:

The following script demonstrates a bug in the exec() function in Python 3.4.  
(It works correctly in 2.7).

script = 
print(a)
print([a for i in range(5)])

exec(script, globals(), {a:5})

It produces the following output:

5
Traceback (most recent call last):
  File test.py, line 5, in module
exec(script, globals(), {a:5})
  File string, line 3, in module
  File string, line 3, in listcomp
NameError: name 'a' is not defined

The variable a is getting passed to the script, as expected: printing it out 
works correctly.  But if you use it in a comprehension, the interpreter claims 
it does not exist.

--
messages: 248064
nosy: Peter Eastman
priority: normal
severity: normal
status: open
title: Incorrect handling of local variables in comprehensions with exec()
type: behavior
versions: Python 3.4

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



[issue22329] Windows installer can't recover partially installed state

2015-08-05 Thread Steve Dower

Steve Dower added the comment:

+Martin, who apparently never made it onto nosy.

You should clear those variables, run a Repair, and then uninstall. This error 
typically is because pip has become corrupted and cannot be removed.

This does not affect Python 3.5 or later.

--
nosy: +loewis
versions:  -Python 3.5

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



[issue21718] sqlite3 cursor.description seems to rely on incomplete statement parsing for detection

2015-08-05 Thread Robert Collins

Robert Collins added the comment:

@Gerhard would you like that ported to cPython for you?

@Tom - I think that if the patch applies to 2.7.x we should apply it there 
since its very unlikely to break non-buggy code.

--
nosy: +rbcollins
versions: +Python 3.6

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



[issue22329] Windows installer can't recover partially installed state

2015-08-05 Thread Ethan Henderson

Ethan Henderson added the comment:

I deleted those variables and tried running a repair but still got the 
specified account already exists schpeel.
I then tried running an uninstall and got the same error as last time there too.

There's presently no pip at all; there is no python folder on C:/.

--

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



[issue13224] Change str(x) to return only the qualname for some types

2015-08-05 Thread Robert Collins

Changes by Robert Collins robe...@robertcollins.net:


--
nosy: +rbcollins

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



[issue24800] Incorrect handling of local variables in comprehensions with exec()

2015-08-05 Thread R. David Murray

R. David Murray added the comment:

exec is subtle.  See the explanation linked from issue 23087, which while not 
*exactly* on point explains the underlying problem (a comprehension is a new 
scope, and exec can't reach an intermediate scope the way a compiled function 
can).

As far as the difference from 2.7 goes, the scoping rules for comprehensions 
changed in python3: the variable you are concerned with is now part of the 
local scope.

--
nosy: +r.david.murray
resolution:  - not a bug
stage:  - resolved
status: open - closed
superseder:  - Exec variable not found error

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



[issue13224] Change str(x) to return only the qualname for some types

2015-08-05 Thread Robert Collins

Robert Collins added the comment:

The patch is a little stale but it seems easy enough to fix up. I'll commit it 
tomorrowish in the absence of other discussion.

--

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



[issue24778] mailcap.findmatch: document shell command Injection danger in filename parameter

2015-08-05 Thread R. David Murray

R. David Murray added the comment:

Ah, that's a clever idea.

--

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



[issue24782] Merge 'configure extensions' into main IDLE config dialog

2015-08-05 Thread Mark Roseman

Mark Roseman added the comment:

Yup. Revised extdlg-sorted.patch attached.  Thanks for noticing that!

--
Added file: http://bugs.python.org/file40131/extdlg-sorted.patch

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



  1   2   >