[issue20289] Make cgi.FieldStorage a context manager

2015-02-06 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the review, Serhiy!

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

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



[issue20289] Make cgi.FieldStorage a context manager

2015-02-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 367f5e98ffbb by Berker Peksag in branch 'default':
Issue #20289: cgi.FieldStorage() now supports the context management protocol.
https://hg.python.org/cpython/rev/367f5e98ffbb

--
nosy: +python-dev

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



[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2015-02-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is left to do with this issue?

--
nosy: +serhiy.storchaka

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



[issue20413] Errors in documentation of standard codec error handlers

2015-02-06 Thread Matthew Barnett

Matthew Barnett added the comment:

The docs for Python 3.5.0a0 still say Unicode Private Use Area.

--
nosy: +mrabarnett
versions: +Python 3.5

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



[issue18620] multiprocessing page leaves out important part of Pool example

2015-02-06 Thread Davin Potts

Davin Potts added the comment:

Attached are proposed patches for 2.7, 3.4, and default (3.5) branches.

In these patches, the 2 examples in the documentation that showcase the use of 
pool.apply_async have been modified to specifically highlight that a single 
invocation of apply_async will only lead to a single process doing any work 
(not all of the pool's processes).

Specifically, in the first code example:
* In the 3.x branches, the example is expanded slightly to demonstrate that 
only a single process is used by a single apply_async call and that to 
accomplish similar to the mapping examples just above it, multiple apply_async 
calls are necessary.
* Also in the 3.x branches, the code deliberately causes an exception to be 
raised which will terminate the execution of this example when anyone attempts 
to run it.  Rather than provide an example which terminates prematurely, the 
exception is now caught and a message displayed to demonstrate the exception 
did indeed occur, permitting the example to run through to a successful exit.
* In the 2.7 branch, this first example is much smaller than what is in use in 
the 3.x branches -- I've expanded it to cover the same information as is being 
shared in the 3.x branches now.

Specifically, in the second code example:
* In the 3.x branches, the only change is to the comment to the right of the 
apply_async call which emphasizes that only a single process is being used.  
Also, for clarity, the reference to the exception being raised in the last line 
was changed to highlight that it's an exception defined in the multiprocessing 
library (multiprocessing.TimeoutError).
* The 2.7 branch is the same -- there were no other differences on this example 
between branches.

These updated examples have been tested with the latest from 2.7, 3.4, and 
default/3.5 branches on OSX 10.10 and Windows 7.

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file38029/issue18620_py35.patch

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



[issue23401] Add pickle support of Mapping views

2015-02-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, and yet one option:

5) As a list or a tuple. `copyreg.__newobj__, (list,), None, 
iter(self._mapping.keys())` or `copyreg.__newobj__, (tuple, 
tuple(self._mapping))`.

--

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



[issue10717] Multiprocessing module cannot call instance methods across processes

2015-02-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think this issue should be closed as won't fix. In Python 3 both Pickler 
implementations have dispatch_table, but in Python 2 there is no way to use 
private dispatch table. The solution is to migrate to Python 3.

--
nosy: +serhiy.storchaka
status: open - pending

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



[issue18620] multiprocessing page leaves out important part of Pool example

2015-02-06 Thread Davin Potts

Changes by Davin Potts pyt...@discontinuity.net:


Added file: http://bugs.python.org/file38031/issue18620_py27.patch

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



[issue18620] multiprocessing page leaves out important part of Pool example

2015-02-06 Thread Davin Potts

Changes by Davin Potts pyt...@discontinuity.net:


Added file: http://bugs.python.org/file38030/issue18620_py34.patch

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



[issue23403] Use pickle protocol 4 by default?

2015-02-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Multiprocessing uses default protocol

AFAIK, this is so you can interact with processes using another version of 
Python.

--
nosy: +sbt

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



[issue4727] copyreg doesn't support keyword only arguments in __new__

2015-02-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
keywords: +patch
nosy: +serhiy.storchaka
stage: needs patch - patch review
versions: +Python 3.5 -Python 3.4
Added file: http://bugs.python.org/file38032/copy_getnewargs_ex.patch

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



[issue23400] Inconsistent behaviour of multiprocessing.Queue() if sem_open is not implemented

2015-02-06 Thread Erik Bray

Changes by Erik Bray erik.m.b...@gmail.com:


--
nosy: +erik.bray

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



[issue23403] Use pickle protocol 4 by default?

2015-02-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

multiprocessing spawns the other processes itself from the same executable used 
to launch the main process. It's not subprocess. How would a different version 
of Python get involved?

--
nosy: +josh.r

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



[issue20413] Errors in documentation of standard codec error handlers

2015-02-06 Thread Martin Panter

Martin Panter added the comment:

I changed “code point in the Unicode Private Use Area” to “individual surrogate 
code” in the “codecs” module documentation for Issue 19548. So perhaps (a) 
still needs addressing, but (b) and (c) are hopefully already fixed.

--
nosy: +vadmium

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



[issue23403] Use pickle protocol 4 by default?

2015-02-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Multiprocessing uses default protocol and there is no simple (without hacking 
the stdlib) way to pass the right protocol manually.

--

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



[issue23403] Use pickle protocol 4 by default?

2015-02-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Because pickles will not be compatible with Python  3.4 anymore. People who 
want maximum efficiency without compatibility can pass the right protocol 
manually.

--

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



[issue23403] Use pickle protocol 4 by default?

2015-02-06 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Why not use pickle protocol 4 by default? It allows to pickle some objects 
which are not pickleable with lower protocols and is more efficient.

--
components: Library (Lib)
messages: 235498
nosy: alexandre.vassalotti, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use pickle protocol 4 by default?
type: enhancement
versions: Python 3.5

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



[issue23117] Properly codesign Mac python 2.7.9.pkg so it can work thru OS X firewall

2015-02-06 Thread Ned Deily

Ned Deily added the comment:

Using code signing on OS X sounds like a good idea but does require careful 
analysis to ensure it is being used correctly.  However, in your example, you 
are using and signing the Apple-supplied system Python.  It is not advisable to 
modify system resources like that.  You should open an issue with Apple to 
request the system Pythons be signed (https://bugreport.apple.com/).  I'll keep 
this issue open for further investigation of signing of Pythons supplied by 
python.org installers for OS X.

--

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



[issue23404] 'make touch' does not work with git clones of the source repository

2015-02-06 Thread Vinson Lee

Vinson Lee added the comment:

With the supplied patch on CentOS 6 , make passes and make test passes with 
the exception of test_readline that is Issue19884.

372 tests OK.
1 test failed:
test_readline
7 tests altered the execution environment:
test_calendar test_distutils test_float test_locale test_strptime
test_types test_warnings
11 tests skipped:
test_devpoll test_gdb test_kqueue test_msilib test_ossaudiodev
test_startfile test_tk test_ttk_guionly test_winreg test_winsound
test_zipfile64
Re-running failed tests in verbose mode
Re-running test 'test_readline' in verbose mode
testHistoryUpdates (test.test_readline.TestHistoryManipulation) ... ok
test_write_read_append (test.test_readline.TestHistoryManipulation) ... ok
test_init (test.test_readline.TestReadline) ... FAIL

--

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



[issue23404] 'make touch' does not work with git clones of the source repository

2015-02-06 Thread Vinson Lee

Vinson Lee added the comment:

I tried a hg copy of the repository. make touch worked for me.

./configure
make touch
make

--

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



[issue23403] Use pickle protocol 4 by default?

2015-02-06 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue23404] Python 3.5 does not build with Python 2.6.

2015-02-06 Thread Vinson Lee

Vinson Lee added the comment:

I am building from a git copy of the source repository. make touch before 
make does not work for me.

$ make touch
cd .; \
hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
abort: There is no Mercurial repository here (.hg not found)!

I've attached a patch that addresses the Python 3.5 build issue for me. The 
patch contains two syntax construct changes to Parser/asdl.py. Please consider 
applying this patch upstream.

--
keywords: +patch
status: closed - open
Added file: 
http://bugs.python.org/file38033/0001-Issue-23404-Do-not-use-Python-2.7-constructs-in-Pars.patch

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



[issue23404] 'make touch' does not work with git clones of the source repository

2015-02-06 Thread Ned Deily

Ned Deily added the comment:

Unfortunately, those syntax differences aren't the only problems you could run 
into so making these syntax changes isn't really a general solution, IMO. 'make 
touch' is the documented and supported way to ensure that the unnecessary build 
steps are not run.  But, as you discovered, 'make touch' only works with an hg 
copy of the repo; it was not designed for git clones.  To fully support git 
clones, there would need to be a git equivalent of the hg scripts called by 
'make touch'.  This would be a worthwhile project for someone interested in git 
support to work on and would be considered for inclusion in the repo.

--
components: +Devguide
nosy: +ezio.melotti
resolution: not a bug - 
stage: resolved - needs patch
title: Python 3.5 does not build with Python 2.6. - 'make touch' does not work 
with git clones of the source repository
type: compile error - 

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



[issue20413] Errors in documentation of standard codec error handlers

2015-02-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, February 2014, many of my plans went in rather different directions than 
expected that month, and this was one of them :)

As Martin noted, he already fixed (b) and (c), but we missed that the list of 
error handlers was also duplicated in the builtin open() docs.

That duplication is likely worthwhile from a docs usability perspective, but we 
should:

1. Bring it in line with Martin's recent fixes to the codecs module docs
2. Add a comment in the error handler docs noting that the open() docs may need 
to be updated to reflect changes to error handler semantics

--
assignee: ncoghlan - 

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



[issue23404] Python 3.5 does not build with Python 2.6.

2015-02-06 Thread Ned Deily

Ned Deily added the comment:

Try using make touch before make.  Because hg does not preserve precise 
time stamps when creating working directories, some build steps are run 
unnecessarily after an initial checkout.  'make touch' updates the file time 
stamps so that these steps are skipped and a bootstrap Python is not needed.

--
nosy: +ned.deily

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



[issue23404] Python 3.5 does not build with Python 2.6.

2015-02-06 Thread Ned Deily

Ned Deily added the comment:

https://docs.python.org/devguide/setup.html#avoiding-re-creating-auto-generated-files

--

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



[issue23404] Python 3.5 does not build with Python 2.6.

2015-02-06 Thread Vinson Lee

New submission from Vinson Lee:

Is there a minimum Python requirement to build Python?

Python 3.5 does not build with Python 2.6. Python 3.4, Python 3.3, and Python 
2.7 build with Python 2.6 so this is recent change in build requirements.

For example, this build failure occurs on CentOS 6.

python ./Parser/asdl_c.py -h Include ./Parser/Python.asdl
Traceback (most recent call last):
  File ./Parser/asdl_c.py, line 6, in module
import asdl
  File Parser/asdl.py, line 36
builtin_types = {'identifier', 'string', 'bytes', 'int', 'object', 
'singleton'}
 ^
SyntaxError: invalid syntax

--
components: Build
messages: 235505
nosy: vlee
priority: normal
severity: normal
status: open
title: Python 3.5 does not build with Python 2.6.
type: compile error
versions: Python 3.5

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



[issue23403] Use pickle protocol 4 by default?

2015-02-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It is possible to have independent processes communicate together, although 
that's not the most widely-used feature. See:
https://docs.python.org/3/library/multiprocessing.html#multiprocessing-listeners-clients
Also:
https://docs.python.org/3/library/multiprocessing.html#managers

--

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



[issue23404] Python 3.5 does not build with Python 2.6.

2015-02-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Looks like this revision, part of #22823, changed it: 
https://hg.python.org/cpython/rev/4480506137ed

--
nosy: +josh.r

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



[issue23404] Python 3.5 does not build with Python 2.6.

2015-02-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

To answer your question: Since asdl uses set literals (introduced in 2.7 and 
3.0), that appears to put an effective minimum version requirement of 2.7 to 
build 3.5. Whether that was the intent is unclear (they were changing a lot of 
places from set([a, b, c]) to {a, b, c}; causing problems building Python was 
probably not the intent, but 2.6 is well out of support at this point).

--

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



[issue23404] Python 3.5 does not build with Python 2.6.

2015-02-06 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


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

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



[issue7936] sys.argv contains only scriptname

2015-02-06 Thread Mark Lawrence

Mark Lawrence added the comment:

@Alecz are you aware of the Python launcher, see 
https://www.python.org/dev/peps/pep-0397/ and 
https://docs.python.org/3/using/windows.html#python-launcher-for-windows ?  The 
easiest way to sort out 3.4 would have been to download the msi file and use 
the repair option.

Having said that I've no idea whether or not this issue can be sorted out, or 
is already sorted in 3.5.  @Steve, Zach or Tim, over to you :)

--
components: +Windows -Library (Lib)
nosy: +BreamoreBoy, steve.dower, tim.golden, zach.ware
versions: +Python 3.5 -Python 3.1, Python 3.2, Python 3.3

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



[issue23399] venv should create relative symlinks where possible

2015-02-06 Thread Vinay Sajip

Vinay Sajip added the comment:

LGTM.

--

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



[issue17911] traceback: add a new thin class storing a traceback without storing local variables

2015-02-06 Thread Nick Coghlan

Nick Coghlan added the comment:

It's genuinely user hostile, as the from_exc_tuple version is entirely
redundant, and folks using pydoc to discover the API won't know they
shouldn't use the constructor directly.

That means both forms will get used, but only one will be documented. When
people ask why a second spelling for the lower level API was added, to
make it look like it exists at the same level as the higher level
convenience API isn't going to be a satisfying explanation.

--

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



[issue23401] Add pickle support of Mapping views

2015-02-06 Thread Serhiy Storchaka

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


--
keywords: +patch
Added file: http://bugs.python.org/file38024/pickle_mapping_views.patch

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



[issue23400] Inconsistent behaviour of multiprocessing.Queue() if sem_open is not implemented

2015-02-06 Thread Ole Streicher

New submission from Ole Streicher:

On Debian Hurd, there is no sem_open implementation. When I try there to create 
a Queue, I get different errors, depending on the Python version:

import multiprocessing
q = multiprocessing.Queue()

gives on Python 2.7.9:

maxsize = 0

def Queue(maxsize=0):
'''
Returns a queue object
'''
   from multiprocessing.queues import Queue

/usr/lib/python2.7/multiprocessing/__init__.py:217: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

__all__ = ['Queue', 'SimpleQueue', 'JoinableQueue']

import sys
import os
import threading
import collections
import time
import atexit
import weakref

from Queue import Empty, Full
import _multiprocessing
from multiprocessing import Pipe
   from multiprocessing.synchronize import Lock, BoundedSemaphore, Semaphore, 
 Condition

/usr/lib/python2.7/multiprocessing/queues.py:48: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event'
]

import threading
import os
import sys

from time import time as _time, sleep as _sleep

import _multiprocessing
from multiprocessing.process import current_process
from multiprocessing.util import Finalize, register_after_fork, debug
from multiprocessing.forking import assert_spawning, Popen

# Try to import the mp.synchronize module cleanly, if it fails
# raise ImportError for platforms lacking a working sem_open implementation.
# See issue 3770
try:
from _multiprocessing import SemLock
except (ImportError):
raise ImportError(This platform lacks a functioning sem_open +
   implementation, therefore, the required +
   synchronization primitives needed will not +
  function, see issue 3770.)
E ImportError: This platform lacks a functioning sem_open 
implementation, therefore, the required synchronization primitives needed will 
not function, see issue 3770.

/usr/lib/python2.7/multiprocessing/synchronize.py:59: ImportError

and on 3.4.2:

self = multiprocessing.context.DefaultContext object at 0x1449b0c, maxsize = 0

def Queue(self, maxsize=0):
'''Returns a queue object'''
from .queues import Queue
   return Queue(maxsize, ctx=self.get_context())

/usr/lib/python3.4/multiprocessing/context.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = multiprocessing.queues.Queue object at 0x511e8cc, maxsize = 0

def __init__(self, maxsize=0, *, ctx):
if maxsize = 0:
   maxsize = _multiprocessing.SemLock.SEM_VALUE_MAX
E   AttributeError: 'module' object has no attribute 'SemLock'

/usr/lib/python3.4/multiprocessing/queues.py:38: AttributeError

Both traces are actually copied from Debian build logs:
2.7.9: 
https://buildd.debian.org/status/fetch.php?pkg=python-astropyarch=hurd-i386ver=1.0~rc1-1stamp=1422724845
3.4.2: 
https://buildd.debian.org/status/fetch.php?pkg=python-astropyarch=hurd-i386ver=1.0~rc1-2stamp=1423153281

Neither for 2.7.9 nor for 3.4.2 this behaviour is documented. Also, I would 
expect to have a NotImplementedError and not an ImportError or an 
AttributeError in such a case.

Please:

* document the behaviour of multiprocessing.Queue() in the case of an absent 
sem_open for both Python2 and Python3

* Consider raising NotImplementedError or being consistent in some other way.

--
components: Library (Lib)
messages: 235474
nosy: olebole
priority: normal
severity: normal
status: open
title: Inconsistent behaviour of multiprocessing.Queue() if sem_open is not 
implemented
type: behavior
versions: Python 2.7, Python 3.4

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



[issue23401] Add pickle support of Mapping views

2015-02-06 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch adds pickle support of general Mapping views. See also 
issue23264.

--
components: Library (Lib)
messages: 235475
nosy: alexandre.vassalotti, pitrou, rhettinger, serhiy.storchaka, stutzbach
priority: normal
severity: normal
stage: patch review
status: open
title: Add pickle support of Mapping views
type: enhancement
versions: Python 3.5

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



[issue23401] Add pickle support of Mapping views

2015-02-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There are many ways to pickle e.g. Mapping keys:

1) Default implementation (as an instances of Python class MappingKey). This is 
implementation depended and exposes private variable _mapping. Changing 
implementation of the keys() method will break compatibility.

2) As `self.__class__, (self._mapping,)`. It depends on implementation of 
keys() as MappingKey or MappingKey subclass. It doesn't very subclass friendly 
if keys() is more complex or MappingKey subclass requires additional parameters.

3) As `self._mapping.__class__.keys, (self._mapping,)`. Implementation 
agnostic, perhaps more efficient than option 4 because 
self._mapping.__class__.keys may be shared. But needs protocol 4.

4) As `self._mapping.keys, ()`. Implementation agnostic.

pickle_mapping_views.patch implements option 4, the patch in issue23264 
implements option 3 (it works for dict with all protocols, but needs protocol 4 
for dict subclasses). Perhaps implementations should be unified (use option 3 
with protocol 4 and option 3 otherwise).

--

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



[issue21717] Exclusive mode for ZipFile and TarFile

2015-02-06 Thread Berker Peksag

Berker Peksag added the comment:

Here's an updated patch. Thanks Serhiy.

--
Added file: http://bugs.python.org/file38025/issue21717_v2.diff

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



[issue20416] Marshal: performance regression with versions 3 and 4

2015-02-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are new results with corrected marshalbench.py (more precise and with 
recalculated total size):

Without the patch:
ver.  dumps   loads  size
  746.5   19971.2
0 669.1  1149.2   26202.9
1 682.0  1130.1   26202.9
2 652.0  1134.8   26202.4
3 920.8   757.9   21316.7
4 771.2   691.4   19971.2

With marshal3_numbers.patch:
3 894.6   778.4   21321.6
4 733.1   704.2   19976.2

With marshal_refs_by_value_3.patch:
3 687.6   777.7   21310.3
4 535.5   701.5   19966.3

With marshal_hashtable.patch:
3 656.0   764.2   21316.7
4 512.9   696.6   19971.2

--

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



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

2015-02-06 Thread Matthias Urlichs

Matthias Urlichs added the comment:

Please do.

--

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



[issue22735] Fix various crashes exposed through mro() customization

2015-02-06 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Thanks for the very high quality patch. The way it was split made it much 
easier to review.

--

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



[issue22735] Fix various crashes exposed through mro() customization

2015-02-06 Thread Eldar Abusalimov

Eldar Abusalimov added the comment:

You're welcome, and thank you too for reviewing and merging it.

--

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



[issue23128] Key presses are doubled in Tkinter dialog invoked from window close handler with Cocoa Tk

2015-02-06 Thread Ned Deily

Ned Deily added the comment:

The test case appears to only fail with OS X Cocoa Tk (tested with Tk 8.5.17 
and 8.6.3); it does not fail with the older OS X Carbon Tk 8.4.20 nor with X11 
Tk 8.6.3.  It also fails similarly with Python 3.4.x.  FWIW, there have been 
other reported problems with Tkinter SimpleDialog functions using Cocoa Tk, for 
example Issue16023, and a number of other issues unique to Cocoa Tk.  These 
kinds of problems are usually not simple to analyze, requiring tracing events 
through Tkinter and Tk and possibly lower-layer OS X APIs.  It often helps to 
eliminate Python and Tkinter from the equation by trying to reproduce the 
problem with equivalent Tcl code in the Tcl/Tk wish shell if anyone feels up to 
it.

--
stage:  - needs patch
title: Key presses are doubled in Tkinter dialog invoked from window close 
handler (OS X only) - Key presses are doubled in Tkinter dialog invoked from 
window close handler with Cocoa Tk
versions: +Python 3.4, Python 3.5

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



[issue21717] Exclusive mode for ZipFile and TarFile

2015-02-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch for zipfile.

--
Added file: http://bugs.python.org/file38027/zipfile_mode_x.patch

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



[issue21717] Exclusive mode for ZipFile and TarFile

2015-02-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added more comments.

--

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



[issue20416] Marshal: performance regression with versions 3 and 4

2015-02-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Can you post the results of your hashtable patch with marshalbench.py?

PS: we don't care about versions older than 4.

--

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



[issue17911] traceback: add a new thin class storing a traceback without storing local variables

2015-02-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 06/02/2015 09:34, Nick Coghlan a écrit :
 
 It's genuinely user hostile, as the from_exc_tuple version is entirely
 redundant, and folks using pydoc to discover the API won't know they
 shouldn't use the constructor directly.

Using pydoc isn't generally a successful way of discovering an API. It
shows you too many details that don't matter. Besides our docstrings are
much terser and less informative than the Sphinx doc.

pydoc is useful mostly as a Python-specific man command: you know
something exists, just want to remember the details.

--

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



[issue11352] Update cgi module doc

2015-02-06 Thread Matthew Atkinson

Matthew Atkinson added the comment:

Hi

I've modified Pierre's patch to apply to the latest 3.5 and 3.4, and made the 
most of the simple changes suggested in 
http://bugs.python.org/review/11352/#ps4792 . I've also added all the non 
internal parameters to the FieldStorage constructor, and descriptions of them.

Thanks,
Matt

--
nosy: +mutley89
Added file: http://bugs.python.org/file38026/cgi-doc.patch

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



[issue17911] traceback: add a new thin class storing a traceback without storing local variables

2015-02-06 Thread Nick Coghlan

Nick Coghlan added the comment:

dir() will get me TracebackException as a name, 
help(traceback.TracebackException) will get me its signature. IDEs with 
autocomplete and signature tooltips will do the same.

There is nothing in those usage sequences to say don't use __init__, use this 
redundant class method with the same signature instead.

I agree providing a directly from an exception constructor is essential for 
cases where you're working with a caught exception at the Python level. I don't 
agree with the idea of duplicating the required low level API under a different 
name so it doesn't *look* like a lower level API in the documentation.

--

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



[issue23342] run() - unified high-level interface for subprocess

2015-02-06 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

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



[issue23399] venv should create relative symlinks where possible

2015-02-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6b8d95c12eaf by Barry Warsaw in branch '3.4':
Issue #23399: pyvenv creates relative symlinks where possible.
https://hg.python.org/cpython/rev/6b8d95c12eaf

New changeset 9e6f79495e0b by Barry Warsaw in branch 'default':
Issue #23399: pyvenv creates relative symlinks where possible.
https://hg.python.org/cpython/rev/9e6f79495e0b

New changeset 7a82b1539401 by Barry Warsaw in branch '3.4':
Issue #23399: pyvenv creates relative symlinks where possible.
https://hg.python.org/cpython/rev/7a82b1539401

--
nosy: +python-dev

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



[issue23399] venv should create relative symlinks where possible

2015-02-06 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
resolution:  - fixed
status: open - closed

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



[issue23402] dynload_shlib does not close ldl handles when the interpreter is shut down

2015-02-06 Thread Adam

New submission from Adam:

I think dynload_shlib (and maybe some of the other non-ldl dynamic library 
loaders?) should close the libraries when the interpreter is shut down. 
Currently the handles are not ever closed and in ldl's case sometimes leaked.

The reason I desire this behavior is I have Python opening a shared library 
that I also open (all within the same process), and I want to be able to reload 
the library at runtime (via dlclose() + dlopen()) by shutting down the Python 
interpreter, dlclose()/dlopen(), and re-starting Python on the other side, 
however having the hanging reference to the library within the interpreter is 
preventing my dlclose() call from unloading the library.

I have attached a patch for dynload_shlib.c that tracks all handles returned by 
dlopen() and will close them properly when the interpreter is shut down.

--
components: Interpreter Core
files: python-dlopen.diff
keywords: patch
messages: 235490
nosy: Adam
priority: normal
severity: normal
status: open
title: dynload_shlib does not close ldl handles when the interpreter is shut 
down
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file38028/python-dlopen.diff

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



[issue7936] sys.argv contains only scriptname

2015-02-06 Thread Alecz

Alecz added the comment:

I ran into this issue by doing the following steps, though I did not try to 
reproduce:

1 - install Python 3.4
2 - have windows Always Open .py files with Python
3 - install Python 2.7

Then I encountered issues where all .py scripts were opened with Python 2.7. 
After some unsuccessful attempts I decided to uninstall Python 2.7

4 - remove Python 2.7

At this point, I had to update the file associations because Windows could not 
find Python 2.7 anymore

5 - update file associations

The issue is obviously that in at least a few places in the registry, the 
..\shell\open\command has a value of ..\python.exe %1

In my case it was under all roots:

HKEY_CLASSES_ROOT\py_auto_file
HKEY_LOCAL_MACHINE
HKEY_USERS

I corrected only the one under HKEY_USERS by adding %* and it resolved the 
issue.

--
nosy: +Alecz
versions: +Python 3.4

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