[issue24725] test_socket testFDPassEmpty fails on OS X 10.11 DP with "Cannot allocate memory"

2015-11-18 Thread Jeff Ramnani

Jeff Ramnani added the comment:

I'm still getting these test failures on OS X 10.11.1.  Has a radar been filed 
with Apple?  I'd submit one, but I don't know enough about the issue to create 
a good bug report.

In the meantime, I'm attaching a patch to skip these tests as was done in issue 
#12958.

--
keywords: +patch
nosy: +jramnani
Added file: http://bugs.python.org/file41069/issue-24725.patch

___
Python tracker 

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



[issue25655] Python errors related to failures loading DLL's lack information

2015-11-18 Thread Steve Dower

Steve Dower added the comment:

I don't know that we can necessarily provide correct information for those 
errors as it depends where they actually fail. If we're simply passing on an 
error from the loader, then there's very little we can do.

We may be able to make an educated guess based on our context, but there's a 
fairly high chance we'll guess wrong in some cases and make them more difficult 
to debug (unless you know that the error is only a guess, in which case you're 
back to procmon or Dependency Walker).

You're right that all versions are affected, however I think improving these 
diagnostics is only within scope for 3.5 and 3.6 at this stage.

--
versions: +Python 3.5, Python 3.6 -Python 2.7, Python 3.3

___
Python tracker 

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



[issue25589] test_ascii_formatd fails on Mac when built with Intel compiler

2015-11-18 Thread Chris Hogan

Changes by Chris Hogan :


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



[issue25652] collections.UserString.__rmod__() raises NameError

2015-11-18 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2015-11-18 Thread Ed Schouten

New submission from Ed Schouten:

While trying to port Python over to a new platform (CloudABI), I noticed a 
couple of compiler errors in PyThread_create_key(), PyThread_delete_key(), 
PyThread_delete_key_value() and PyThread_set_key_value() caused by fact that 
pthread_key_t is converted to an integer (and vice versa)

POSIX doesn't seem to require that pthread_key_t is an integer or any other 
arithmetic type:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

Old revisions of the standard did require pthread_t to be an arithmetic type, 
but this requirement was dropped later on.

In my opinion we should strongly consider changing the API, so that we can 
treat the key created by pthread_key_create() or returned by TlsAlloc() as an 
opaque type.

--
components: Interpreter Core
messages: 254846
nosy: EdSchouten
priority: normal
severity: normal
status: open
title: PyThread assumes pthread_key_t is an integer, which is against POSIX
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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-11-18 Thread R. David Murray

R. David Murray added the comment:

I think the 'versionchanged' should say "3.4.4, 3.5.1".  We've already had one 
user confused by the fact that it isn't in 3.5.0.

--

___
Python tracker 

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




[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2015-11-18 Thread Ely Spears

New submission from Ely Spears:

I'm trying to find a way to create a ctypes array from the underlying memory 
buffer exposed by an array.array object. The ctypes.Array.from_buffer function 
isn't documented, but I did find the source code in _ctypes.c around line 497. 
It's not clear to me where the problem might be.


Code to reproduce it below:

import array, ctypes
a1 = array.array('l')
a1.fromlist(range(10))
ctypes.Array.from_buffer(a1)
#Segfault

--
components: ctypes
messages: 254851
nosy: spear...@gmail.com
priority: normal
severity: normal
status: open
title: ctypes.Array.from_buffer segmentation fault when trying to create from 
array.array
type: crash
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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-11-18 Thread Yury Selivanov

Yury Selivanov added the comment:

Good catch!  Fixed in https://hg.python.org/cpython/rev/b34c42e46e7b

--

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-18 Thread Yury Selivanov

New submission from Yury Selivanov:

When Python is compiled with readline, repeatedly pressing  key in repl 
breaks the repl prompt.

Below is what I see when I hit  4 times.

yury@ysmac ~/dev/py/cpython $ ./python.exe
Python 3.5.0+ (3.5:4ae62ddf7bc7+, Nov 18 2015, 14:52:57)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

>>>

>>>

>>>


Reproducible when Python is built from source on latest OS X.  Works OK when 
installed from MacPorts.

Further, if I add

   PyOS_ReadlineFunctionPointer = PyOS_StdioReadline;

in PyOS_Readline in myreadline.c, everything works as expected, so I think this 
is a readline bug.

--
components: Interpreter Core
messages: 254855
nosy: r.david.murray, serhiy.storchaka, yselivanov
priority: high
severity: normal
status: open
title: tabs don't work correctly in python repl
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



[issue15564] cgi.FieldStorage should not call read_multi on files

2015-11-18 Thread Mark Bordas

Mark Bordas added the comment:

Was this ever addressed or resolved? I just ran into this bug and it looks like 
there's a solution, but was never fixed?

--
nosy: +Mark Bordas
versions: +Python 2.7 -Python 3.2

___
Python tracker 

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



[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2015-11-18 Thread Eryk Sun

Eryk Sun added the comment:

You have to subclass ctypes.Array with a _type_ and _length_. But ctypes types 
also implement sequence repetition (*) to facilitate creating array types. For 
example:

import array, ctypes
a1 = array.array('l')
a1.fromlist(range(10))
c1 = (ctypes.c_long * 10).from_buffer(a1)

>>> c1[:]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> c1[0] = 42
>>> a1[0]
42

That said, it's way too easy to segfault this. Why not simply fail the call in 
this case? e.g.

StgDictObject *dict = PyType_stgdict(type);
if (!dict) {
PyErr_SetString(PyExc_TypeError,
"abstract class");
return NULL;
}

--
nosy: +eryksun
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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-18 Thread Yury Selivanov

Yury Selivanov added the comment:

> Thinking about the __context__ thing some more, I guess it might make sense 
> for __context__ to be overwritten by the generator context. The same way it 
> gets overwritten when you execute “raise” inside an exception handler.

Not sure I understand what you're saying here.

--

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-18 Thread R. David Murray

R. David Murray added the comment:

This was reported (on twitter) by David Beazly as well, as applying to the OSX 
downloaded from python.org.  It works fine on linux for me.  Is it 
readline-version dependent, or a bug in the readline shipped with OSX?

--
components: +Macintosh
nosy: +ned.deily, ronaldoussoren
type:  -> behavior

___
Python tracker 

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



[issue23200] Deprecate the zlib decompressor’s flush() method

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

For the bz2 and lzma modules, neither decompressor classes have a flush() 
method, only the compressors.

--

___
Python tracker 

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



[issue23661] Setting a exception side_effect on a mock from create_autospec does not work

2015-11-18 Thread Dmitry Andreychuk

Dmitry Andreychuk added the comment:

python 3.4.3 is also affected. Is it possible to fix this in branch 3.4?

--
nosy: +and
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



[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2015-11-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

sys.stdin is set to open(os.devnull) in multiprocessing.forkserer and 
multiprocessing.process (see issue5313). At shutdown stage sys.std* streams are 
restored to sys.__std*__. Here the resource warning is emitted.

An example that demonstrates similar issue:

$ ./python -We -c 'import sys; sys.stdin = open("/dev/null")'
Exception ignored in: <_io.FileIO name='/dev/null' mode='rb' closefd=True>
ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' mode='r' 
encoding='UTF-8'>

A workaround is to set sys.__stdin__ as well as sys.stdin. Now a resource 
warning is no longer emitted at the stage of restoring standard streams, but it 
can be randomly emitted at the stage of clearing sys dict (depending on the 
order of deallocating stdin and stderr). The question is why a resource warning 
is not emitted in normal case, with standard stdin.

Proposed patch closes sys.__stdin__ and set it to sys.stdin in multiprocessing, 
makes standard streams cleanup at shutdown more reliable, and fixes two tests 
that set sys.stderr.

--
components: +Interpreter Core, Library (Lib)
keywords: +patch
nosy: +jnoller, pitrou, serhiy.storchaka
stage:  -> patch review
versions: +Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file41068/cleanup_std_streams.patch

___
Python tracker 

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



[issue23200] Deprecate the zlib decompressor’s flush() method

2015-11-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Besides unconsumed_tail there is an internal buffer. Even if flush() is no 
longer needed in the zlib decompresser (I don't know), I doubt about bz2 and 
lzma.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25655] Python errors related to failures loading DLL's lack information

2015-11-18 Thread never-eat-yellow-snow

New submission from never-eat-yellow-snow:

Currently you get errors like this:

ImportError: DLL load failed: The specified procedure could not be found.
ImportError: DLL load failed: The specified module could not be found.

It would be nice to include more information, at least the name of the dll 
which could not be loaded. Maybe also the name of the (dependent) dll which 
could not be found.

Currently, I use ProcessMonitor to debug which dll could not be found, because 
the error message is lacking important information.

Note: I tagged the two versions I use, but probably all python versions are 
affected by this issue.

--
components: Windows
messages: 254838
nosy: never-eat-yellow-snow, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python errors related to failures loading DLL's lack information
type: enhancement
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue10128] multiprocessing.Pool throws exception with __main__.py

2015-11-18 Thread Marc Schlaich

Marc Schlaich added the comment:

Please see my latest comments to https://github.com/pypa/pip/issues/1891. 

tl;dr It is related to the -m switch as pip's wheel launcher does 
  PYTHONPATH=script.exe python -m __main__

--

___
Python tracker 

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



[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2015-11-18 Thread Chris Withers

Chris Withers added the comment:

Cool, what needs to happen for __wrapped__ in to be blacklisted in call?

Separately, inspect.unwrap probably needs to use something less fragile than a 
set of ids to track whether it's stuck in a loop. What is the actual usecase 
for __wrapped__ how deeply nested can those realistically expected to be?

--

___
Python tracker 

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



[issue25653] ctypes+callbacks+fork+selinux = crash

2015-11-18 Thread Eryk Sun

Changes by Eryk Sun :


--
nosy: +eryksun

___
Python tracker 

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



[issue25657] virtualenv's activate does not update LD_LIBRARY_PATH

2015-11-18 Thread serge-sans-paille

New submission from serge-sans-paille:

My use cas of virtual env was the following:

1. create a virtual env
2. install a third party shared library and its python wrapper
3. import the wrapper that itself loads the shared library

The problem is that the shared library gets install into /lib (which is 
a normal behavior) but virtualenv's activate does not update LD_LIBRARY_PATH

A possible fix would be to add the following lines into virtualenv's activate:

```
if [ -n "$_OLD_VIRTUAL_LD_LIBRARY_PATH" ] ; then
PATH="$_OLD_VIRTUAL_LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
unset _OLD_VIRTUAL_LD_LIBRARY_PATH
fi
```

and a bit later

```
_OLD_VIRTUAL_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
LD_LIBRARY_PATH="$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
```

in a simialr manner to what is done with `PATH`

--
messages: 254845
nosy: serge-sans-paille
priority: normal
severity: normal
status: open
title: virtualenv's activate does not update LD_LIBRARY_PATH
type: enhancement
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



[issue25656] multiprocessing.dummy: pool.map hangs on empty list

2015-11-18 Thread Tomer

New submission from Tomer:

Hi,
In multiprocessing.dummy module I noticed when you send a zero-length iterator 
to pool.map it hang forever,

Code example:

import urllib2 
from multiprocessing.dummy import Pool as ThreadPool

def start_multithreading_urlopen(threads_num):

pool = ThreadPool(threads_num)
results = pool.map(urllib2.urlopen, [])
pool.close() 
pool.join()

# hang here

print results

I think it related to Issue6433 that was fixed on multiprocessing module with 
simple length check

--
components: Library (Lib)
messages: 254844
nosy: tomer70
priority: normal
severity: normal
status: open
title: multiprocessing.dummy: pool.map hangs on empty list
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



[issue20387] tokenize/untokenize roundtrip fails with tabs

2015-11-18 Thread Jason R. Coombs

Changes by Jason R. Coombs :


--
status: open -> closed

___
Python tracker 

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



[issue23441] rlcompleter: tab on empty prefix => insert spaces

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

The fix here doesn’t work perfectly with the Editline (libedit) version of 
Readline; see Issue 25660.

--

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

I think this might just be a side effect of the way we abuse the tab completer 
to insert a literal tab (Issue 23441, revision 82ccdf2df5ac). If I change the 
code to insert the letter T instead of tabs:

if not text.strip('T'):
if state == 0:
return text + 'T'
else:
return None

I see this behaviour:

* Manually type three Ts
* Press Tab once, a fourth T is added nicely
* Press Tab a second time, it beeps and displays a completion list with a 
single item, and then completes my line to five Ts
* Pressing Tab again repeats the beep, completion list, and appending a T

Illustration:

>>>   <== Typed T three times, then Tab twice
T  <== Completion list from second Tab press
>>> T
TT
>>> TT

--

___
Python tracker 

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



[issue25533] Make pkgutil.iter_modules() yield built-in modules

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

I did some work on adding support for frozen modules, but I got stuck. The low 
level is fine:

>>> pprint(sys.get_frozen_modules())  # (name, ispkg) pairs
(('_frozen_importlib', False),
 ('_frozen_importlib_external', False),
 ('__hello__', False),
 ('__phello__', True),
 ('__phello__.spam', False))
>>> print("\n".join(map(repr, pkgutil.iter_modules(builtins=True
(, '_ast', False)
. . .
(, 'zipimport', False)
(, '_frozen_importlib', False)
(, '_frozen_importlib_external', 
False)
(, '__hello__', False)
(, '__phello__', True)
. . .
(FileFinder('.'), 'python-config', False)
. . .

But the current __hello__ and __phello__ modules print stuff when you import 
them, which messes with walk_packages(), pydoc, etc:

$ ./python -m pydoc -k pkgutil
Hello world!
Hello world!
Hello world!
pkgutil - Utilities to support packages.
test.test_pkgutil 

When I stopped these frozen modules from printing on import (as in my current 
patch), I found this broke the test suite. In particular, 
test_importlib.frozen.test_loader relies on the printouts to test what gets 
executed when importing frozen modules. So I am not sure the best way to 
continue if I am to add support for frozen modules to iter_modules().

Another problem was that there is no way to list submodules of a frozen package 
unless you know the package’s name. Currently, iter_modules() only sees a path 
list, which is empty for __phello__. However, I was able to add a special case 
to walk_packages(None) to include frozen submodules.

Some questions:

1. Do people think the general idea of enhancing iter_modules() is worthwhile?

2. Should I try harder to solve the problem with running frozen modules, or is 
it sensible to just leave out the frozen module support?

--
Added file: http://bugs.python.org/file41072/iter-builtin-frozen.patch

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2015-11-18 Thread Gregory P. Smith

Changes by Gregory P. Smith :


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



[issue10845] test_multiprocessing failure under Windows

2015-11-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5d88c1d413b9 by Nick Coghlan in branch '2.7':
Close #10128: don't rerun __main__.py in multiprocessing
https://hg.python.org/cpython/rev/5d88c1d413b9

--
nosy: +python-dev

___
Python tracker 

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



[issue10128] multiprocessing.Pool throws exception with __main__.py

2015-11-18 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks for the investigation Marc.

I'd been hesitant to backport the mitigation patch in #10845 to 2.7.x, (as it 
*does* represent a behavioural change), but if that code path is currently 
hitting an assert statement anyway, it seems reasonable to make the change for 
2.7.11+

--

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

Applying my patch at Issue 13501, then building with “autoreconf && ./configure 
--with-readline=editline”, I can reproduce the funny tab behaviour on Linux.

--

___
Python tracker 

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



[issue25662] _tkinter.TclError: bad event type or keysym "Alt"

2015-11-18 Thread Chesqa Yen

Chesqa Yen added the comment:

Under the users .idlerc folder:

C:\Users\Francesca\.idlerc

edit config-extensions.cfg in notepad (don't select always open with)

The code should look like this:

[CodeContext]
visible = False

[ScriptBinding_cfgBindings]
run-module = 

So edited mine to be like this as it was changed to  and idle was 
working again!

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

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-18 Thread Larry Hastings

Larry Hastings added the comment:

I don't plan to hold up 3.5.1 for this.

--
priority: release blocker -> normal

___
Python tracker 

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



[issue25663] Make rlcompleter avoid duplicate global names

2015-11-18 Thread Martin Panter

New submission from Martin Panter:

When playing with the Editline alternative to Readline, I noticed that “global” 
name completions can include duplicates:

>>> No
None NotADirectoryError(  NotImplementedError(
None NotImplemented  
>>> None
None None

It completed my line to “None”, but if you hit Tab again, it lists two 
duplicate options both identical to what I already have. The reason is that 
“None” is both a reserved keyword, and a member of the builtins module.

My patch avoids adding extra completions if a name has already been added. It 
also prioritizes the global namespace over builtins, so that say if you alias 
“int” to a non-callable, it is no longer listed with an opening bracket “(” 
suffix. Earlier behaviour:

>>> int = 81
>>> in
in input( intint(  

Now:

>>> in
in input( int

--
components: Library (Lib)
files: global-dupes.patch
keywords: patch
messages: 254873
nosy: martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Make rlcompleter avoid duplicate global names
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41071/global-dupes.patch

___
Python tracker 

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



[issue10128] multiprocessing.Pool throws exception with __main__.py

2015-11-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5d88c1d413b9 by Nick Coghlan in branch '2.7':
Close #10128: don't rerun __main__.py in multiprocessing
https://hg.python.org/cpython/rev/5d88c1d413b9

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

___
Python tracker 

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



[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-11-18 Thread Guido van Rossum

Guido van Rossum added the comment:

Update: I have not forgotten this, but it's a tough case and I haven't made 
much progress. I don't think I'll make the deadline for 3.5.1.

--
assignee:  -> gvanrossum

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

Is this related to the BSD editline library (libedit), or is the actual Gnu 
Readline library being used? Apparently you can check for "libedit" in 
readline.__doc__ to tell the difference.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

David Beazley’s description of the bug: “hitting tab inserts spaces and a 
carriage return at the same time.”

--

___
Python tracker 

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



[issue25637] Move non-collections-related ABCs out of collections.abc

2015-11-18 Thread Yury Selivanov

Yury Selivanov added the comment:

> I guess is the objection of putting concrete ABCs in the abc module is that 
> the abc module contains the actual code to implement ABCs and not ABCs 
> themselves.

I think it's a rather weak objection.  Having some basic (and fundamental!) 
ABCs defined along with ABCMeta won't hurt.

> Personally I would be fine with a submodule within abc like abc.interfaces.

> Personally I'm starting to warm to the idea of sticking ABCs in proper 
> packages as e.g. functools.abc for Callable; namespaces are one honking great 
> idea after all. :)

It will be hard to find proper namespace for things like Hashable and 
Awaitable.  That's why I like the idea of putting them in the top-level 'abc' 
module.

--

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

I was making an analogy between how the “raise” statement works, and how the 
throw() method could work. In this example, there are three exception objects 
(MainError, SubError, and ValueError). I was suggesting that it is okay for the 
context to be set to the MainError instance, because that is how the analogous 
version using a “raise” statement works.

def main():
try:
raise MainError("Context inside generator")
except MainError:
yield  # __context__ could be changed to MainError

coro = main()
coro.send(None)
try:
try: raise ValueError("Context outside of generator")
except ValueError: raise SubError()
except SubError as ex:
coro.throw(ex)  # __context__ is ValueError

# raise analogy:

try:
try: raise ValueError("Context outside of generator")
except ValueError as ex: raise SubError()
except SubError as ex:
saved = ex  # __context__ is ValueError

try:
raise MainError("Context inside generator")
except MainError:
raise saved  # Changes __context__ to MainError

===

Sorry I’m not really familiar with the code to quickly propose a patch or 
review your change though.

--

___
Python tracker 

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



[issue20387] tokenize/untokenize roundtrip fails with tabs

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

It seems the problem with tabs in the indentation is fixed. Can we close this?

For the problem with tabs between tokens in a line, I think that would be 
better handled in separate report. But I suspect it is at worst a documentation 
problem. You can’t guarantee that you can reconstruct the exact source based 
off just the tokenized tokens.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2015-11-18 Thread Xiang Zhang

Changes by Xiang Zhang <18518281...@126.com>:


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-18 Thread Yury Selivanov

Yury Selivanov added the comment:

> Is this related to the BSD editline library (libedit), or is the actual Gnu 
> Readline library being used? Apparently you can check for "libedit" in 
> readline.__doc__ to tell the difference.


Great suggestion.  So on my machine, macports version (no bug) is built against 
readline; manual build from source -- libedit.

So apparently, this is a libedit thing.

--

___
Python tracker 

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



[issue25662] _tkinter.TclError: bad event type or keysym "Alt"

2015-11-18 Thread Chesqa Yen

New submission from Chesqa Yen:

For a while now my python IDLE has not been working, mostly due to me trying 
and failing to reconfigure the button assignment to tailor me. Now when i try 
to open idle it does not open. I tried using some sites for help 
(http://www.gossamer-threads.com/lists/python/bugs/901999) which had a similar 
error however, even with a new config file it still wasn't working. Please 
could I get some help as I need python running on my laptop to do my university 
coursework. I've attached a file with the error message from cmd.exe and will 
paste it again;

C:\Users\Francesca>C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\
Lib\idlelib\idle.py
Traceback (most recent call last):
  File "C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\Lib\idlelib
\idle.py", line 11, in 
idlelib.PyShell.main()
  File "C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\Lib\idlelib
\PyShell.py", line 1560, in main
shell = flist.open_shell()
  File "C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\Lib\idlelib
\PyShell.py", line 320, in open_shell
self.pyshell = PyShell(self)
  File "C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\Lib\idlelib
\PyShell.py", line 867, in __init__
OutputWindow.__init__(self, flist, None, None)
  File "C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\Lib\idlelib
\OutputWindow.py", line 16, in __init__
EditorWindow.__init__(self, *args)
  File "C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\Lib\idlelib
\EditorWindow.py", line 167, in __init__
self.apply_bindings()
  File "C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\Lib\idlelib
\EditorWindow.py", line 1097, in apply_bindings
text.event_add(event, *keylist)
  File "C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\Lib\idlelib
\MultiCall.py", line 374, in event_add
widget.event_add(self, virtual, seq)
  File "C:\Users\Francesca\AppData\Local\Programs\Python\Python35-32\Lib\tkinter
\__init__.py", line 1503, in event_add
self.tk.call(args)
_tkinter.TclError: bad event type or keysym "Alt"

--
components: IDLE
files: error file.txt
messages: 254863
nosy: ronixx
priority: normal
severity: normal
status: open
title: _tkinter.TclError: bad event type or keysym "Alt"
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file41070/error file.txt

___
Python tracker 

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



[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

Perhaps we don’t normally see a warning because stdin normally has 
closefd=False set?

--

___
Python tracker 

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



[issue25626] Gzip fails for file over 2**32 bytes

2015-11-18 Thread Martin Panter

Martin Panter added the comment:

I am inclined to commit my patch to get this fixed in the upcoming 3.5.1 
release, unless anyone thinks that could be a problem.

--
components: +Extension Modules

___
Python tracker 

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



[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-11-18 Thread Guido van Rossum

Guido van Rossum added the comment:

Actually, I just found an embarrassingly simple fix:

diff --git a/src/typing.py b/src/typing.py
index d900036..49c4a06 100644
--- a/src/typing.py
+++ b/src/typing.py
@@ -981,7 +981,7 @@ class GenericMeta(TypingMeta, abc.ABCMeta):
 "Cannot substitute %s for %s in %s" %
 (_type_repr(new), _type_repr(old), self))
 
-return self.__class__(self.__name__, self.__bases__,
+return self.__class__(self.__name__, (self,) + self.__bases__,
   dict(self.__dict__),
   parameters=params,
   origin=self,

I'll go check this in now, together with a test.

--

___
Python tracker 

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



[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-11-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1d37f7dbbb37 by Guido van Rossum in branch '3.5':
Issue #25472: In B[], insert B in front of __bases__, to make the 
__dict__ descriptor work.
https://hg.python.org/cpython/rev/1d37f7dbbb37

New changeset 63c261185fc7 by Guido van Rossum in branch 'default':
Issue #25472: In B[], insert B in front of __bases__, to make the 
__dict__ descriptor work. (Merge 3.5->3.6)
https://hg.python.org/cpython/rev/63c261185fc7

--
nosy: +python-dev

___
Python tracker 

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



[issue25664] Unexpected UnicodeDecodeError in logging module

2015-11-18 Thread Zephor Wu

New submission from Zephor Wu:

# coding=utf-8
import logging

logger = logging.getLogger(u'测试')
logger.error(u'测试')

# these code will get an unexpected error
# because getLogger encode the unicode to utf-8 while _log don't
# see line 474 in logging/__init__.py
# my suggestion is to keep the encoding in logging same with python2 with 
unicode

--
components: Library (Lib)
messages: 254881
nosy: zephor
priority: normal
severity: normal
status: open
title: Unexpected UnicodeDecodeError in logging module
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



[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-11-18 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks for the report! Made it before the 3.5.1 (rc1) deadline.

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

___
Python tracker 

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



[issue25664] Unexpected UnicodeDecodeError in logging module

2015-11-18 Thread Zephor Wu

Changes by Zephor Wu :


--
type:  -> behavior

___
Python tracker 

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



[issue25663] Make rlcompleter avoid duplicate global names

2015-11-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25661] tokenize.untokenize does not maintain the order of tabbed indentations and leading spaces

2015-11-18 Thread Blake Hilliard

New submission from Blake Hilliard:

Here's a simple test case that shows the bug:

# python
Python 2.7.9 (default, Apr  2 2015, 14:49:18) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import StringIO, tokenize
>>> code = "if False:\n\tx=3\n \ty=3\n"
>>> g = list(tokenize.generate_tokens(StringIO.StringIO(code).readline))
>>> assert tokenize.untokenize(g) == code
Traceback (most recent call last):
  File "", line 1, in 
AssertionError


This is very similar to: https://bugs.python.org/issue20387

I'm using the patch that was provided to fix that bug, but with the patch this 
slightly different test case still fails. On the last line of "code" from my 
example, where the line begins with a single space then a tab, the untokenized 
string reverses the order, and the tab precedes the space. This generates code 
that will throw an IndentationError if run.

--
components: Library (Lib)
messages: 254857
nosy: Blake Hilliard
priority: normal
severity: normal
status: open
title: tokenize.untokenize does not maintain the order of tabbed indentations 
and leading spaces
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