[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]: 

In [5]: zf.load_module('kitconsole')
---
ZipImportErrorTraceback (most recent call last)
 in ()
> 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 

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


--
type: behavior -> enhancement

___
Python tracker 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

___
Python tracker 

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

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

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

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


--
nosy: +levkivskyi

___
Python tracker 

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

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


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

___
Python tracker 

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

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

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


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

___
Python tracker 

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


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

___
Python tracker 

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


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

___
Python tracker 

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



[issue24792] zipimporter masks import errors

2015-08-05 Thread Eric Snow

Changes by Eric Snow :


--
versions: +Python 3.5, Python 3.6

___
Python tracker 

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


--
nosy: +eric.snow, superluser

___
Python tracker 

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


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

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2015-08-05 Thread Eric Snow

Changes by Eric Snow :


--
versions: +Python 3.6

___
Python tracker 

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



[issue19699] Update zipimport for PEP 451

2015-08-05 Thread Eric Snow

Changes by Eric Snow :


--
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2015-08-05 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow, superluser

___
Python tracker 

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


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

___
Python tracker 

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


--
nosy: +superluser

___
Python tracker 

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


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

___
Python tracker 

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



[issue1116520] Prefix search is filesystem-centric

2015-08-05 Thread Eric Snow

Changes by Eric Snow :


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

___
Python tracker 

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



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

2015-08-05 Thread Eric Snow

Changes by Eric Snow :


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

___
Python tracker 

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


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

___
Python tracker 

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


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

___
Python tracker 

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



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

2015-08-05 Thread Eric Snow

Changes by Eric Snow :


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

___
Python tracker 

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



[issue8400] zipimporter find_module fullname mis-documented

2015-08-05 Thread Eric Snow

Changes by Eric Snow :


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

___
Python tracker 

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


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

___
Python tracker 

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


--
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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


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

___
Python tracker 

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


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

___
Python tracker 

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



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

2015-08-05 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +gregory.p.smith

___
Python tracker 

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

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


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

___
___
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 Guido van Rossum

Guido van Rossum added the comment:

Why does the start_tls() function need to know the internal structure of the 
Transport? I'm hesitant to add this API to Transport; it somehow feels wrong to 
put such an implementation-specific thing there. E.g. I presume you can't do 
this for an UDP transport. Or perhaps it could be an API on a subclass of 
Transport -- then only members of that subclass will support this API.

--

___
Python tracker 

___
___
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 Al Sweigart

Changes by Al Sweigart :


--
nosy: +Al.Sweigart

___
Python tracker 

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

It looks like manifests aren't generated with CRT version info anymore either, 
so I'll take this opportunity to clean up the build process some more too.

--

___
Python tracker 

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

> Why does the start_tls() function need to know the internal structure of the 
> Transport? 

If start_tls() is added to the loop, it will (likely) have the following 
signature:

loop.start_tls(transport)

then I'd want it to check if the `transport` is on the same event loop, and 
after that we'll need to patch 'transport._protocol' with an `SSLProtocol` 
wrapper.  This requires adding 'get_loop()', 'get_protocol()' and 
'set_protocol()' methods to transports (the latter one is kind of useless for 
anything but 'start_tls').

We can't implement 'loop.start_tls(protocol)', because protocols don't store a 
reference to their transports.

> I'm hesitant to add this API to Transport; it somehow feels wrong to put such 
> an implementation-specific thing there. E.g. I presume you can't do this for 
> an UDP transport. Or perhaps it could be an API on a subclass of Transport -- 
> then only members of that subclass will support this API.

We can add a special subclass of Transport -- TLSTransport (that's how it's 
done in Twisted, btw: http://goo.gl/iAziWY) with 'start_tls' method raising 
'NotImplementedError'.  We can later inherit _SelectorSocketTransport and 
_ProactorSocketTransport classes from it, implementing the method in Python 3.5.

--

___
Python tracker 

___
___
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 Guido van Rossum

Guido van Rossum added the comment:

OK, got it. SGTM.

--

___
Python tracker 

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

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

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

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

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

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

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

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

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

___
___
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 
exec(script, globals(), {"a":5})
  File "", line 3, in 
  File "", line 3, in 
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 

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

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

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

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


--
nosy: +rbcollins

___
Python tracker 

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

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

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

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

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



[issue24370] OrderedDict behavior is unclear with misbehaving keys.

2015-08-05 Thread Eric Snow

Eric Snow added the comment:

Fair enough.

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

___
Python tracker 

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



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

2015-08-05 Thread Steve Dower

Steve Dower added the comment:

I need to see the detailed log to be any more helpful. Can you try running this 
command and post the log here:

msiexec /l*vx log.txt /x {9529565F-E693-3F11-B3BF-8CD545F5F9A0}

(Note that the UUID is different from earlier because it matches 3.4.3.amd64 
and the previous was for another version)

--

___
Python tracker 

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

Thanks :-)

As you may noticed i now choosed to use a random name made of the chars of 
"PYTHON" in BIG letters instead of small letters i used before.

Thats because i do not want to get in trouble with the little "t" in %t wich is 
replaced by the subst function too.

--

___
Python tracker 

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

Peter Eastman added the comment:

I don't believe that explanation is correct.  You can just as easily get the 
same problem without explicitly passing a map to exec().  For example:

def f():
script = """
print(a)
print([a for i in range(5)])
"""
a = 5
exec(script)

f()

The documentation for exec() states, "In all cases, if the optional parts are 
omitted, the code is executed in the current scope."  Therefore the code above 
should be exactly equivalent to the following:

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

f()

But the latter works and the former doesn't.  Contrary to the documentation, 
the code is clearly not being executed in the same scope.

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

___
Python tracker 

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

Yes it is.  The comprehension is a *new* scope, within the outer scope of the 
exec, and it *cannot see* the variables in the outer scope of the exec.  You 
have the same problem if you try to use a comprehension in that way in a class 
statement at the class level.  An exec is explicitly *not* equivalent to a 
function body.  It is equivalent to operating in a class body, if you give it 
two namespaces, and in a global context if you give it one.  This is documented.

Please don't reopen the issue.

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

___
Python tracker 

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

Peter Eastman added the comment:

Then fix the documentation.  This behavior directly contradicts the 
documentation of the exec() function.  The question is not what scope the 
comprehension runs in, it's what scope the script runs in.  See my third 
example.  A comprehension in the f() function has no problem seeing local 
variables defined in that function.  If the script were running into the same 
scope as that function, then comprehensions inside the script would also see 
those variables.  They don't, clearly demonstrating that the script does *not* 
run in the same scope, and contradicting the documentation.

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

___
Python tracker 

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

Running that in my command prompt outputs "Access is denied," even after 
disabling UAC.
Running that in bash just gives me a popup for Windows Installer.

Is the UUID going to be different for 3.4.3 intel x64 (I have intel, not amd)?

--

___
Python tracker 

___
___
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, it looks like what the documentation of exec is missing is the fact that 
calling exec with no arguments in a non-global is equivalent to calling it with 
*two* arguments.  That is, your "exec(script)" statement is equivalent to 
"exec(script, globals(), locals())".  This is implicit but very much *not* 
explicit in the current documentation, and should be made explicit.

To be sure I'm explaining this fully: the documentation of exec says  "If exec 
gets two separate objects as globals and locals, the code will be executed as 
if it were embedded in a class definition".

>>> class Foo:
...   a = 10
...   [a for x in range(5)]
... 
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in Foo
  File "", line 3, in 
NameError: name 'a' is not defined

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
stage: resolved -> needs patch
title: Incorrect handling of local variables in comprehensions with exec() -> 
exec docs should note that the no argument form in a local scope is really the 
two argument form

___
Python tracker 

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

Changes by R. David Murray :


--
versions: +Python 3.5, Python 3.6

___
Python tracker 

___
___
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 Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +yselivanov

___
Python tracker 

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

Start from an elevated command prompt. There's only one 64-bit build, so 
that'll be it. Our name for it is amd64, even though it applies to both Intel 
and AMD.

--

___
Python tracker 

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



[issue15663] Investigate providing Tcl/Tk 8.5 with OS X installers

2015-08-05 Thread Mark Roseman

Mark Roseman added the comment:

I'd like to revisit this, particularly in the context of some of the 
discussions regarding future improvements of IDLE.

Assume we have a barebones Tcl/Tk framework build of e.g. 8.6.4 as part of the 
installer (core Tcl/Tk, not like e.g. ActiveTcl).

Would something like this work?

1. if just system Tcl/Tk already installed (/System/Library/Frameworks), 
install new /Library/Frameworks/Tcl.framework and 
/Library/Frameworks/Tk.framework

2. if /Library/Frameworks/Tcl.framework is installed, but doesn't have 8.6.x 
(e.g. may have Versions/8.4), add the new version into the existing framework, 
so we'd then have a 8.4.x and a 8.6.4 installed

3. if there's already /Library/Frameworks/Tcl.framework/Versions/8.6 and it's a 
lower version (e.g. 8.6.1) we could simply nag them in the installer to 
consider upgrading on their own (the theory being that if they've installed it 
once somehow they can most likely do it again with a newer version of whatever 
they have)

This way if there's any existing Tcl/Tk there that other things are linking 
against, it shouldn't get disturbed. Possible, or just wishful thinking?

--
nosy: +markroseman, terry.reedy

___
Python tracker 

___
___
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 Roundup Robot

Roundup Robot added the comment:

New changeset e4cb64628673 by Yury Selivanov in branch '3.5':
Issue #24791: Fix grammar regression for call syntax: 'g(*a or b)'.
https://hg.python.org/cpython/rev/e4cb64628673

New changeset 4c89dd5199e5 by Yury Selivanov in branch 'default':
Merge 3.5 (issue #24791)
https://hg.python.org/cpython/rev/4c89dd5199e5

--

___
Python tracker 

___
___
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 Roundup Robot

Roundup Robot added the comment:

New changeset 40c391d12741 by Yury Selivanov in branch '3.5':
Issue #24791: More tests in test_parser
https://hg.python.org/cpython/rev/40c391d12741

New changeset a572137b4f05 by Yury Selivanov in branch 'default':
Merge 3.5 (issue #24791; more tests in test_parser)
https://hg.python.org/cpython/rev/a572137b4f05

--

___
Python tracker 

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

Changes by Yury Selivanov :


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

___
Python tracker 

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



[issue24391] Better repr for threading objects

2015-08-05 Thread Robert Collins

Robert Collins added the comment:

So, I think the majority opinion seems to be:


AIUI the patch doesn't quite do that, so I'm going to pop this back to patch 
review.

That said, Serhiy, if you fix it up, just commit it please :)

--
nosy: +rbcollins
stage: commit review -> patch review

___
Python tracker 

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



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

2015-08-05 Thread Ethan Henderson

Ethan Henderson added the comment:

My log.txt: http://puu.sh/jqLWR.txt

Turns out that my antivirus was blocking that command from running before.

--

___
Python tracker 

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

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

___
___
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 Martin Panter

Martin Panter added the comment:

I’m a bit confused. In the current patch, the new type_str() function appears 
to use the “qualname” (which I support), but some of the test changes seem to 
contradict this, e.g.:

 >>> C.foo(1)
-classmethod  1
+classmethod C 1

Also, I think this new feature should be documented.

--

___
Python tracker 

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



  1   2   >