[issue22003] BytesIO copy-on-write

2015-02-09 Thread Mikhail Korobov

Mikhail Korobov added the comment:

Shouldn't this fix be mentioned in 
https://docs.python.org/3.5/whatsnew/3.5.html#optimizations ?

--

___
Python tracker 

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



[issue23418] Keep http.server.__all__ up to date

2015-02-09 Thread Berker Peksag

Berker Peksag added the comment:

LGTM.

--
nosy: +berker.peksag
stage:  -> commit review
versions: +Python 3.4, Python 3.5

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2015-02-09 Thread Ilya Kulakov

Ilya Kulakov added the comment:

The structure hack does not work on Windows 8, x64.

--
nosy: +Ilya.Kulakov

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2015-02-09 Thread Alexei Romanov

Changes by Alexei Romanov :


--
nosy: +alexei.romanov
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



[issue1429] FD leak in SocketServer when request handler throws exception

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

I think calling shutdown_request(), or at least close_request(), should be done 
regardless of whether handle_error() fails or not.

--
nosy: +vadmium

___
Python tracker 

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



[issue23419] Faster default __reduce__ for classes without __init__

2015-02-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch makes faster default __reduce__ implementation for the case when 
there is no non-trivial __init__ defined (e.g. for named tuples). In this case 
__reduce__ will return (cls, newargs) instead of (copyreg.__newobj__, (cls,) + 
newargs).

>>> pickletools.dis(pickletools.optimize(pickle.dumps(turtle.Vec2D(12, 34), 3)))
Before:
0: \x80 PROTO  3
2: cGLOBAL 'turtle Vec2D'
   16: KBININT112
   18: KBININT134
   20: \x86 TUPLE2
   21: \x81 NEWOBJ
   22: .STOP
After:
0: \x80 PROTO  3
2: cGLOBAL 'turtle Vec2D'
   16: KBININT112
   18: KBININT134
   20: \x86 TUPLE2
   21: RREDUCE
   22: .STOP

Pickled size is the same, but pickling is faster. The benefit is in avoiding of 
importing copyreg.__newobj__ and allocating new tuple (cls,) + newargs.

Microbenchmarks results:

$ ./python -m timeit -s "import pickle; from turtle import Vec2D; a = [Vec2D(i, 
i+0.1) for i in range(1000)]" -- "pickle.dumps(a)"

Before: 100 loops, best of 3: 16.3 msec per loop
After: 100 loops, best of 3: 15.2 msec per loop

$ ./python -m timeit -s "import copy; from turtle import Vec2D; a = [Vec2D(i, 
i+0.1) for i in range(1000)]" -- "copy.deepcopy(a)"

Before: 10 loops, best of 3: 96.6 msec per loop
After: 10 loops, best of 3: 88.7 msec per loop

--
components: Interpreter Core
files: object_reduce_no_init.patch
keywords: patch
messages: 235600
nosy: alexandre.vassalotti, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Faster default __reduce__ for classes without __init__
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file38052/object_reduce_no_init.patch

___
Python tracker 

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



[issue23249] test_win32 fails on aarch64

2015-02-09 Thread Robert Kuska

Robert Kuska added the comment:

Sorry for the late answer, I forgot about this issue.

3.2.1 doesn't contain required fix(sorry for the misleading suggestion 'or 
update bundled libffi' from report) but master branch at upstream repo 
(https://github.com/atgreen/libffi) does.

--

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2015-02-09 Thread Robert Kuska

New submission from Robert Kuska:

Originaly reported here: https://bugzilla.redhat.com/show_bug.cgi?id=1160640


I've forgotten to add the sort value to the -s option of cProfile which results 
in a traceback instead of user friendly error message. In the example below 
hello.py just prints a "Hello World":


$ python -m cProfile -s hello.py
Traceback (most recent call last):
  File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
exec code in run_globals
  File "/usr/lib64/python2.6/cProfile.py", line 190, in 
main()
  File "/usr/lib64/python2.6/cProfile.py", line 185, in main
parser.print_usage()
  File "/usr/lib64/python2.6/optparse.py", line 1597, in print_usage
print >>file, self.get_usage()
  File "/usr/lib64/python2.6/optparse.py", line 1583, in get_usage
self.expand_prog_name(self.usage))
  File "/usr/lib64/python2.6/optparse.py", line 1560, in expand_prog_name
return s.replace("%prog", self.get_prog_name())
  File "/usr/lib64/python2.6/optparse.py", line 1555, in get_prog_name
return os.path.basename(sys.argv[0])
IndexError: list index out of range

Tested with python2.7, python3.4 with the same result.

Attached patch adds `choices` for sort option of cProfile.

> $ python -m cProfile -s sdds.py   
>   
Usage: cProfile.py [-o output_file_path] [-s sort] scriptfile [arg] ...

cProfile.py: error: option -s: invalid choice: 'sdds.py' (choose from 
'cumulative', 'module', 'ncalls', 'pcalls', 'file', 'line', 'name', 'calls', 
'stdname', 'nfl', 'filename', 'cumtime', 'time', 'tottime')

--
components: Extension Modules
files: sort-choices.patch
keywords: patch
messages: 235602
nosy: rkuska
priority: normal
severity: normal
status: open
title: python -m cProfile -s fails with non informative message
type: enhancement
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file38053/sort-choices.patch

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2015-02-09 Thread Robert Kuska

Changes by Robert Kuska :


Added file: http://bugs.python.org/file38054/sort-choices.patch

___
Python tracker 

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



[issue4773] HTTPMessage not documented and has inconsistent API across Py2/Py3

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

Jeremy’s patch appears to have been merged in revision 9eceb618274a. A 
documentation entry for the HTTPMessage class was also added in 2009, pointing 
back to email.message.Message. So is there anything left to do for this issue?

--
nosy: +vadmium

___
Python tracker 

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



[issue23420] python -m cProfile -s fails with non informative message

2015-02-09 Thread Robert Kuska

Changes by Robert Kuska :


Added file: http://bugs.python.org/file38055/sort-choices.patch

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread wdv4758h

New submission from wdv4758h:

The command "python -m tarfile -c test.tar.bz2 test/" should create a file that 
is compressed by bzip2,
but actually the detection of compression algorithm that should be used is 
broken (for gz, xz, bz2).

fix it by prepending a dot to the keys of the dictionary

--
components: Library (Lib)
files: fix_compressions_dict.patch
hgrepos: 297
keywords: patch
messages: 235604
nosy: wdv4758h
priority: normal
severity: normal
status: open
title: tarfile module does not correctly choose compression algorithms
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file38056/fix_compressions_dict.patch

___
Python tracker 

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



[issue22235] httplib: TypeError with file() object in ssl.py

2015-02-09 Thread Etienne Robillard

Etienne Robillard added the comment:

sometimes urllib break at different packages, with "SSL: 
CERTIFICATE_VERIFY_FAILED" message. It seem related to the new ssl.py
backport and pip.


sudo python setup.py install --prefix=/usr/local
Downloading 
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
Traceback (most recent call last):
  File "setup.py", line 31, in 
distribute_setup.use_setuptools()
  File "/home/steiner/Desktop/feedcache-1.4.1/distribute_setup.py", line 145, 
in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
  File "/home/steiner/Desktop/feedcache-1.4.1/distribute_setup.py", line 124, 
in _do_download
to_dir, download_delay)
  File "/home/steiner/Desktop/feedcache-1.4.1/distribute_setup.py", line 193, 
in download_setuptools
src = urlopen(url)
  File "/usr/local/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
  File "/usr/local/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
  File "/usr/local/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
  File "/usr/local/lib/python2.7/urllib2.py", line 469, in error
result = self._call_chain(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 656, in http_error_302
return self.parent.open(new, timeout=req.timeout)
  File "/usr/local/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
  File "/usr/local/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
  File "/usr/local/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
  File "/usr/local/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
urllib2.URLError: 

--

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your patch. Could you provide tests?

--
nosy: +berker.peksag, serhiy.storchaka
stage:  -> test needed
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



[issue23361] integer overflow in winapi_createprocess

2015-02-09 Thread paul

paul added the comment:

ping

--

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread 許邱翔

許邱翔 added the comment:

yes

just wanna know is there a standard way to get file type by libmagic ?

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread 許邱翔

Changes by 許邱翔 :


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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No need to use libmagic. tarfile.TarFile.gzopen() should fail if the file is 
not gzipped tar file. There CLI tests in Lib/test/test_tarfile.py. New test 
should create tar file with file name that ends with the '.gz' extension and 
check that it can be open and read with gzopen().

--

___
Python tracker 

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



[issue23417] Windows 8.1 and Windows Server 2012 R2 are not displayed properly

2015-02-09 Thread Steve Dower

Steve Dower added the comment:

We're already tracking this at #19143, where I've got a future proofed version 
of the function. Thanks for the prod though, I'll try and get some action going 
again.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Finding the Windows version getting messier (detect windows 
8.1?)

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread 許邱翔

許邱翔 added the comment:

Oh, I can use it.
thx

--

___
Python tracker 

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



[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-02-09 Thread Steve Dower

Steve Dower added the comment:

(Was reminded about this by #23417)

Any word on the back compat issues in platform.py? Can we make the version in 
3.5 only work with Vista+, or do I need to handle XP in case someone takes the 
file onto an earlier Python version?

--

___
Python tracker 

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



[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-02-09 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 09.02.2015 15:14, Steve Dower wrote:
> 
> Steve Dower added the comment:
> 
> (Was reminded about this by #23417)
> 
> Any word on the back compat issues in platform.py? Can we make the version in 
> 3.5 only work with Vista+, or do I need to handle XP in case someone takes 
> the file onto an earlier Python version?

platform.py has to work on as many platforms as possible (by design),
so as long as Python still runs on Windows XP, we cannot leave that
version behind.

--

___
Python tracker 

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



[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-02-09 Thread Steve Dower

Steve Dower added the comment:

Including the one shipped in the stdlib? Python 3.5 no longer supports XP.

--

___
Python tracker 

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



[issue9949] os.path.realpath on Windows does not follow symbolic links

2015-02-09 Thread Daniel Harding

Daniel Harding added the comment:

@Zach - thanks for the review.  Sorry that it has taken a few months to pick 
this issue back up.  Anyway, here is an updated patch.  It is pretty different 
than the previous patch, to the point that I would consider it a completely new 
patch.

Anyway, here's a basic rundown of what the patch contains:

Two functions in Modules/posixmodule.c were modified to handle bytes objects as 
well as str objects:  win_readlink and _getfinalpathname.  This was necessary 
to allow os.path.realpath() to continue returning bytes when supplied with 
bytes.  I know you said in your review that you didn't care about this because 
using bytes paths on Windows is deprecated, but I think it still important to 
maintain backwards compatibility.

A new implementation of realpath() was added to Lib\ntpath.py, used when 
_getfinalpathname is available (when _getfinalpathname is not available, 
realpath remains a synonym for abspath, as it was previously).  The logic here 
has been completely reworked and is roughly modeled on the realpath 
implementation from Lib\posixpath.py.

A number of tests were added to Lib\test\test_ntpath.py for realpath() 
functionality.  Three of the tests were based on realpath() tests from 
test_posixpath.py, but one is completely new:  test_realpath_broken_symlinks.

A note about improved Windows support was added to the documentation for 
realpath(), but no other doc changes have been made.

Anyway, feedback is welcome - I'd love to get this code in sufficient shape to 
see a working realpath() implementation for Windows land in Python.

--
Added file: http://bugs.python.org/file38057/issue9949-v4.patch

___
Python tracker 

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



[issue23422] Clarify docs for importlib.import_module()

2015-02-09 Thread Brett Cannon

New submission from Brett Cannon:

* Link to the function from importlib.__import__()
* Link to importlib.invalidate_caches()
* Linkify mention in docs for importlib.util.find_spec()

--
assignee: brett.cannon
components: Documentation
messages: 235616
nosy: brett.cannon
priority: low
severity: normal
status: open
title: Clarify docs for importlib.import_module()
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue23412] importlib sometimes fails to import a recently created module

2015-02-09 Thread Brett Cannon

Brett Cannon added the comment:

Because stat results are cached for performance reasons, it's possible to write 
to the file system and then try to read/import from it before the modification 
time for the directory even picks up that there was a change. For this reason 
there is importlib.invalidate_caches(): 
https://docs.python.org/3/library/importlib.html#importlib.invalidate_caches .

I have opened http://bugs.python.org/issue23422 to track that the docs for 
importlib.import_module() point out invalidate_caches().

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



[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-02-09 Thread Mark Lawrence

Mark Lawrence added the comment:

@Steve just in case you didn't know the rules are given here 
https://www.python.org/dev/peps/pep-0011/#microsoft-windows.  I find it a 
nuisance that you have to follow an external link to get the status of Python, 
but maybe it's the lesser of two evils?  An aside, at some point the fourth 
paragraph will need changing to reflect that VS 2015 and later versions will be 
maintaining backward compatibility.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue22003] BytesIO copy-on-write

2015-02-09 Thread David Wilson

David Wilson added the comment:

Attached trivial patch for whatsnew.rst.

--
Added file: http://bugs.python.org/file38058/whatsnew.diff

___
Python tracker 

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



[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-02-09 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 09.02.2015 16:17, Steve Dower wrote:
> 
> Steve Dower added the comment:
> 
> Including the one shipped in the stdlib? Python 3.5 no longer supports XP.

We normally have the platform.py module support multiple Python
versions (at least that's how we did this in Python 2). The reason
is that we'd like to make it possible to easily backport the module
to earlier versions.

This has generally not been a major problem, so if possible,
let's keep it that way for Python 3 as well.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

--

___
Python tracker 

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



[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-02-09 Thread Steve Dower

Steve Dower added the comment:

@Marc-Andre: Okay, I'll make it easier to backport. You're listed as maintainer 
- would you like me to post updates here and let you merge them in?

@Mark - yep, I'm aware of that. That's how I know that 3.5 doesn't support XP 
anymore :) (I think we're even past the 3 years on keeping old project files 
around for VS 2008, which is good since they're already gone from tip.)

--

___
Python tracker 

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



[issue1776674] glob.glob inconsistent

2015-02-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread 許邱翔

許邱翔 added the comment:

Here is the tests.

--
hgrepos: +298
Added file: http://bugs.python.org/file38059/add_tarfile_cli_filetype_test.patch

___
Python tracker 

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



[issue23415] add-to-pydotorg does not support .exe installers for Windows

2015-02-09 Thread Larry Hastings

Larry Hastings added the comment:

Attached for your reading pleasure.

--
keywords: +patch
Added file: 
http://bugs.python.org/file38060/larry.add-to-pydotorg.exe.support.1.diff

___
Python tracker 

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



[issue12738] Bug in multiprocessing.JoinableQueue() implementation on Ubuntu 11.04

2015-02-09 Thread Davin Potts

Davin Potts added the comment:

Thank you for the provided test case but because it depends upon compiled code 
(the libsvm.so.2 file you supplied) it:
(1) makes me wonder if the issue might not arise from an issue inside the 
supplied library (perhaps it was not rebuilt properly on your Ubuntu 11.04 
system after migrating to it from OpenSUSE 11.4 -- the timestamp on the 
libsvm.so.2 file appears to support this suspicion);
(2) does not give us a reasonably concise test case to be able to debug and 
begin to try to understand.

Would it be possible to supply a simpler demonstration of the issue that 
perhaps only involves Python code?

I realize this issue is quite stale now and that you (Michael) have already 
reported discovering a workaround.

--
nosy: +davin

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In general LGTM, but I have added few nitpicks on Rietveld.

--

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue23423] XPath Support in ElementTree doc omission

2015-02-09 Thread Mark Baker

New submission from Mark Baker:

The list of XPath supported features in section 20.5.2.2. "Supported XPath 
syntax" on page https://docs.python.org/3.4/library/xml.etree.elementtree.html 
does not list the use of a predicate based on an element value (it only list 
predicates based on an attribute value. However, testing in 3.4 shows that a 
predicate based on an element value also works.

>>> import xml.etree.ElementTree as etree
>>> x = 'bing'
>>> y = etree.XML(x)

# Find by attribute value
>>> z = y.find('bar/baz[@y="bang"]')
>>> print(z)


# Find by element value
>>> z = y.find('bar/[baz="bing"]')
>>> print(z)


# Find fails with incorrect element value
>>> z = y.find('bar/[baz="bong"]')
>>> z
>>> print(z)
None


Below the line that says:

[tag]   Selects all elements that have a child named tag. Only immediate 
children are supported.

It should say something like:

[tag="value"]   Selects all elements that have a child named tag with the given 
value. Only immediate children are supported.

--
assignee: docs@python
components: Documentation
messages: 235627
nosy: docs@python, mbakeranalecta
priority: normal
severity: normal
status: open
title: XPath Support in ElementTree doc omission
type: enhancement
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



[issue23328] urllib2 fails for proxy credentials that contain a '/' character

2015-02-09 Thread Panagiotis Issaris

Panagiotis Issaris added the comment:

RFC3986 seems to state that a '/' character should be encoded:

"""...
reserved= gen-delims / sub-delims
gen-delims  = ":" / "/" / "?" / "#" / "[" / "]" / "@"
sub-delims  = "!" / "$" / "&" / "'" / "(" / ")"
  / "*" / "+" / "," / ";" / "="
...
The user information, if present, is followed by a
commercial at-sign ("@") that delimits it from the host.
userinfo= *( unreserved / pct-encoded / sub-delims / ":" )
"""

--
nosy: +Panagiotis.Issaris

___
Python tracker 

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



[issue23424] Unicode character ends interactive session

2015-02-09 Thread Grzegorz Abramczyk

New submission from Grzegorz Abramczyk:

Inputing some Unicode characters (like 'łąśćńó...') causes interactive session 
to abort.

When console session is set to use UTF-8 code page (65001) after diacritic 
character appears in string the session abruptly ends. Looking into debug 
output it looks like some cleanup is performed but there are no error messages 
indicating what caused problem.

Problem spotted on Windows 10 (technical preview) but I may try to replicate it 
on some released operating system.

---
C:\>chcp 1250
Active code page: 1250

C:\>python -i
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 'ł'
'ł'
>>> exit()

C:\>chcp 65001
Active code page: 65001

C:\>python -i
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 'ł'


C:\

--
components: Unicode, Windows
files: -v.txt
messages: 235629
nosy: AGrzes, ezio.melotti, haypo, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Unicode character ends interactive session
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file38061/-v.txt

___
Python tracker 

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



[issue23425] Windows getlocale unix-like with french, german, portuguese, spanish

2015-02-09 Thread albertjan

New submission from albertjan:

getlocale() is supposed to (?) return a locale two-tuple in a platform-specific 
notation. However, in *Windows* 7 64, with Python 3.4, 3.3 and 2.7 a 
*unix-like*, abbreviated, lang_territory notation is used for french, german, 
portuguese, spanish. In other words: In these four cases, the output of 
setlocale is not equal to ".".join(locale.getlocale())

## Code that demonstrates the differences
from __future__ import print_function
import locale
import collections
import pprint

languages = ("chinese czech danish dutch english finnish french german greek "
 "hungarian icelandic italian japanese korean norwegian polish "
 "portuguese russian slovak spanish swedish turkish")
d = collections.defaultdict(list)
t = collections.namedtuple("Locale", "lang setlocale getlocale")
for language in languages.split():
sloc = locale.setlocale(locale.LC_ALL, language)
gloc = locale.getlocale()
record = t(language, sloc, gloc)
if gloc[0][2] == "_":
d["unix-like"].append(record)
else:
d["windows-like"].append(record)
 
pprint.pprint(dict(d))

## output
n:\>C:\Miniconda3\python.exe N:\temp\loc.py
-
{'unix-like': [Locale(lang='french', setlocale='French_France.1252', 
getlocale=('fr_FR', 'cp1252')),
   Locale(lang='german', setlocale='German_Germany.1252', 
getlocale=('de_DE', 'cp1252')),
   Locale(lang='portuguese', setlocale='Portuguese_Brazil.1252', 
getlocale=('pt_BR', 'cp1252')),
   Locale(lang='spanish', setlocale='Spanish_Spain.1252', 
getlocale=('es_ES', 'cp1252'))],
-
 'windows-like': [Locale(lang='chinese', setlocale="Chinese 
(Simplified)_People's Republic of China.936", getlocale=("Chinese 
(Simplified)_People's Republic of China", '936')),
  Locale(lang='czech', setlocale='Czech_Czech Republic.1250', 
getlocale=('Czech_Czech Republic', '1250')),
  Locale(lang='danish', setlocale='Danish_Denmark.1252', 
getlocale=('Danish_Denmark', '1252')),
  Locale(lang='dutch', setlocale='Dutch_Netherlands.1252', 
getlocale=('Dutch_Netherlands', '1252')),
  Locale(lang='english', setlocale='English_United 
States.1252', getlocale=('English_United States', '1252')),
  Locale(lang='finnish', setlocale='Finnish_Finland.1252', 
getlocale=('Finnish_Finland', '1252')),
  Locale(lang='greek', setlocale='Greek_Greece.1253', 
getlocale=('Greek_Greece', '1253')),
  Locale(lang='hungarian', setlocale='Hungarian_Hungary.1250', 
getlocale=('Hungarian_Hungary', '1250')),
  Locale(lang='icelandic', setlocale='Icelandic_Iceland.1252', 
getlocale=('Icelandic_Iceland', '1252')),
  Locale(lang='italian', setlocale='Italian_Italy.1252', 
getlocale=('Italian_Italy', '1252')),
  Locale(lang='japanese', setlocale='Japanese_Japan.932', 
getlocale=('Japanese_Japan', '932')),
  Locale(lang='korean', setlocale='Korean_Korea.949', 
getlocale=('Korean_Korea', '949')),
  Locale(lang='norwegian', setlocale='Norwegian 
(Bokmål)_Norway.1252', getlocale=('Norwegian (Bokmål)_Norway', '1252')),
  Locale(lang='polish', setlocale='Polish_Poland.1250', 
getlocale=('Polish_Poland', '1250')),
  Locale(lang='russian', setlocale='Russian_Russia.1251', 
getlocale=('Russian_Russia', '1251')),
  Locale(lang='slovak', setlocale='Slovak_Slovakia.1250', 
getlocale=('Slovak_Slovakia', '1250')),
  Locale(lang='swedish', setlocale='Swedish_Sweden.1252', 
getlocale=('Swedish_Sweden', '1252')),
  Locale(lang='turkish', setlocale='Turkish_Turkey.1254', 
getlocale=('Turkish_Turkey', '1254'))]}

--
components: Library (Lib)
messages: 235630
nosy: fo...@yahoo.com
priority: normal
severity: normal
status: open
title: Windows getlocale unix-like with french, german, portuguese, spanish
type: behavior
versions: Python 2.7, 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



[issue2292] Missing *-unpacking generalizations

2015-02-09 Thread Neil Girdhar

Changes by Neil Girdhar :


Added file: http://bugs.python.org/file38062/starunpack31.diff

___
Python tracker 

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



[issue23328] urllib2 fails for proxy credentials that contain a '/' character

2015-02-09 Thread Andy Reitz

Andy Reitz added the comment:

Sure, but the question is who should do the encoding -- the user, or python? I 
think it would be better for python to read the password from the environment 
variable, and encode it before using it. I think this is what users expect.

--

___
Python tracker 

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



[issue23426] run_setup is broken in distutils

2015-02-09 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

With the following simple setup.py

$ cat setup.py
from distutils.core import setup
from distutils.command.install import install

class install1(install):
sub_commands = install.sub_commamnds

setup(name='bug', cmdclass={'install': install1})


I get

>>> from distutils.core import run_setup
>>> run_setup('setup.py')
Traceback (most recent call last):
  File "", line 1, in 
  File "Lib/distutils/core.py", line 216, in run_setup
exec(f.read(), g, l)
  File "", line 4, in 
  File "", line 5, in install1
NameError: name 'install' is not defined

Furthermore, on an even simpler setup.py:

$ cat setup1.py
from distutils.core import setup

setup(name='bug')

run_setup runs, but clobbers sys.argv:

>>> from distutils.core import run_setup
>>> run_setup('setup1.py', script_args=['--name'])
bug

>>> import sys;sys.argv
['setup1.py', '--name']

--
components: Distutils
messages: 235632
nosy: belopolsky, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: run_setup is broken in distutils
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue23426] run_setup is broken in distutils

2015-02-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Added file: http://bugs.python.org/file38064/setup1.py

___
Python tracker 

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



[issue23426] run_setup is broken in distutils

2015-02-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Added file: http://bugs.python.org/file38063/setup.py

___
Python tracker 

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



[issue23427] Python should expose command when invoked with -c

2015-02-09 Thread Jan-Philip Gehrcke

New submission from Jan-Philip Gehrcke:

When Python is invoked with the `-c command` switch, the command string does 
not get exposed in sys.argv:

$ python -c "import sys; print(sys.argv)"
['-c']

$ python -c "import sys; print(sys.argv)" arg1
['-c', 'arg1']

The command string does not get exposed anywhere, AFAIK, so it is inaccessible 
from within Python programs. There might be application scenarios in which it 
is useful to access the command string, such as for debugging purposes. One 
scenario is when a Python session should be able to "re-spawn" itself in a 
subprocess (I came across this question on StackOverflow: 
http://stackoverflow.com/q/28412903/145400)

I propose to make the command string accessible. If you agree that it might 
make sense, the question is *how/where* to expose it.

One possible way is to retain it in sys.argv, as in this example:

$ python -c "import sys; print(sys.argv)" "arg1"
['-c', 'import sys; print(sys.argv)', 'arg1']

The current sys.argv docs say 

> If the command was executed using the -c command line option to
> the interpreter, argv[0] is set to the string '-c'.

This sentence could then be adjusted to 

"[...], argv[0] is set to the string '-c', and argv[1] contains the command."

This method breaks existing applications that are started with the -c method 
and that consume command line arguments in a sys.argv[1:] fashion. The tests in 
Lib/test/test_cmd_line.py all pass, however.

A second method would be to change sys.argv[0] from '-c' to '-c command'. This 
would break existing applications that check for sys.argv[0] == 'c'.

A third method would be to leave sys.argv as it is, and expose the command with 
a new attribute in the sys module.

I have attached a patch for variant 1 (passes all tests in 
Lib/test/test_cmd_line.py), to demonstrate which code is affected: the 
translation from the "real" argv to sys' argv is triggered in Modules/main.c. 
The patch does not change behavior of '-m' (it's funny, however, that the 
current version of main.c at first replaces the module string with '-m', 
whereas the runpy module later on replaces '-m' with the path to the module 
file anyway.).

As a side node, I figure that the sys.argv documentation should be adjusted to 
properly reflect the -m behavior, which is:

$ ./python -m testmodule foo
testmodule sys.argv: 
['/data/local/pythondev/pythontip/cpython/testmodule.py', 'foo']

Let me hear your comments, and I am willing to work on code and doc patches, 
thanks!

--
assignee: docs@python
components: Documentation, Interpreter Core
files: sys_argv_cmd.patch
keywords: patch
messages: 235633
nosy: docs@python, georg.brandl, haypo, jgehrcke, pitrou
priority: normal
severity: normal
status: open
title: Python should expose command when invoked with -c
type: enhancement
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file38065/sys_argv_cmd.patch

___
Python tracker 

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



[issue23426] run_setup is broken in distutils

2015-02-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Added file: http://bugs.python.org/file38066/setup.py

___
Python tracker 

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



[issue23426] run_setup is broken in distutils

2015-02-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Removed file: http://bugs.python.org/file38063/setup.py

___
Python tracker 

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



[issue23426] run_setup is broken in distutils

2015-02-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Attached patch fixes both issues.

--

___
Python tracker 

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



[issue6634] sys.exit() called from threads other than the main one: undocumented behaviour

2015-02-09 Thread Jan-Philip Gehrcke

Jan-Philip Gehrcke added the comment:

I'd love to find an agreement here. I think we are quite close to getting this 
closed, so further input is very welcome.

--

___
Python tracker 

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



[issue23426] run_setup is broken in distutils

2015-02-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
keywords: +patch
Added file: http://bugs.python.org/file38067/issue23426.patch

___
Python tracker 

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



[issue20709] os.utime(path_to_directory): wrong documentation for Windows.

2015-02-09 Thread Jan-Philip Gehrcke

Jan-Philip Gehrcke added the comment:

Can these super-small doc patches get applied or should we change something? 
Thanks!

--

___
Python tracker 

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



[issue23428] Use the monotonic clock for thread conditions on POSIX platforms

2015-02-09 Thread STINNER Victor

New submission from STINNER Victor:

Python 3.5 now requires a monotonic clock to start and has the C function 
_PyTime_monotonic().

Python/condvar.h and Python/thread_pthread.h should use the monotonic clock 
CLOCK_MONOTONIC, not the system clock CLOCK_REALTIME. See the PEP 418 for the 
rationale.

Most platforms support pthread_condattr_setclock(CLOCK_MONOTONIC), except Mac 
OS X and old versions of Android.

The glib looks to use pthread_cond_timedwait_relative_np() for Mac OS X:
https://mail.gnome.org/archives/commits-list/2014-February/msg07782.html

Note: Android had non-standard pthread_cond_timedwait_monotonic() and 
pthread_cond_timedwait_monotonic_np() functions. Android is not a official 
supported platform, and newer Android version now support 
pthread_condattr_setclock(). I prefer to not support old Android versions (yet).
https://android-review.googlesource.com/#/c/83881/

--

For Windows, SleepConditionVariableSRW() is used on Windows 7 and newer, 
otherwise WaitForSingleObjectEx() is used. By the way, the check looks to be 
done during the compilation. I should check which Windows version is used to 
build Python...

SleepConditionVariableSRW() and WaitForSingleObjectEx() both take a relative 
timeout, so they don't use (directly) the system clock. I don't see any 
required change for Windows.

According to the PEP 418: "WaitForSingleObject() uses the same timer as 
GetTickCount() with the same precision."

Hum, it is not possible to interrupt such wait() with CTRL+c? time.sleep() is 
implemented with WaitForSingleObjectEx() with _PyOS_SigintEvent(). It doesn't 
look to be the case here.

--
components: Interpreter Core
messages: 235637
nosy: haypo
priority: normal
severity: normal
status: open
title: Use the monotonic clock for thread conditions on POSIX platforms
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



[issue21793] httplib client/server status refactor

2015-02-09 Thread Demian Brecht

Demian Brecht added the comment:

Thanks for the catch Martin, it definitely wasn't intended. I've added a patch 
to fix the issue and add the extra description as suggested by Ethan.

--
Added file: http://bugs.python.org/file38068/issue21793_logfix.patch

___
Python tracker 

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



[issue23428] Use the monotonic clock for thread conditions on POSIX platforms

2015-02-09 Thread STINNER Victor

STINNER Victor added the comment:

> Python/condvar.h and Python/thread_pthread.h should use the monotonic clock 
> CLOCK_MONOTONIC

Oh, I forgot that Python/thread_pthread.h only uses pthread_cond_timedwait() if 
semaphores are emulated with mutexes+conditional variables.

On most platforms, PyThread_acquire_lock_timed() is implemented with 
sem_timedwait(). Problem: sem_timedwait() requires an absolute time using the 
CLOCK_REALTIME clock and the clock is not yet configurable on Linux :-(

See the feature request in the glibc: "Bug 14717 - Allow choice of clock source 
for calls to sem_timedwait() and pthread_mutex_timedwait()" opened in 2012:
https://sourceware.org/bugzilla/show_bug.cgi?id=14717

Note: QNX provides sem_timedwait_monotonic().

--

___
Python tracker 

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



[issue23428] Use the monotonic clock for thread conditions on POSIX platforms

2015-02-09 Thread STINNER Victor

STINNER Victor added the comment:

cond_timedwait_monotonic.patch: Work-in-progress patch. It doesn't change 
configure.ac yet to check if pthread_condattr_setclock() is supported (with 
CLOCK_MONOTONIC).

--
keywords: +patch
Added file: http://bugs.python.org/file38069/cond_timedwait_monotonic.patch

___
Python tracker 

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



[issue23249] test_win32 fails on aarch64

2015-02-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +doko, meador.inge

___
Python tracker 

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



[issue23428] Use the monotonic clock for thread conditions on POSIX platforms

2015-02-09 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +neologix

___
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-02-09 Thread Benjamin Peterson

Benjamin Peterson added the comment:

For starters, it would be nice if the patch didn't make unrelated style changes 
(e.g. in compile.c). I also Call arguments should be unified into one list 
rather than distinguishing between "keywords" and "args" anymore.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue23429] -5**4 returns -625 instead of 625

2015-02-09 Thread Justin

New submission from Justin:

C:\Users\Justin>python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> print(-5**4)
-625
>>>

#note...this should be 625 and not a negative 625

--
messages: 235642
nosy: gilbe024
priority: normal
severity: normal
status: open
title: -5**4 returns -625 instead of 625
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



[issue23429] -5**4 returns -625 instead of 625

2015-02-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Unary minus has less priority than power operator. -5**4 is equal to -(5**4), 
not (-5)**4.

--
nosy: +serhiy.storchaka
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



[issue23424] Unicode character ends interactive session

2015-02-09 Thread STINNER Victor

STINNER Victor added the comment:

This issue looks to be a duplicate of the issue #1602: windows console doesn't 
print or input Unicode. It's a limitation of Windows, not of Python itself. 
Python supports any Unicode character if the output is written in a file 
(encoded in UTF-8).

Workaround: use IDLE or another Python "REPL" (interactive interpreter) which 
has a better Unicode support.

--

___
Python tracker 

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



[issue23427] Python should expose command when invoked with -c

2015-02-09 Thread STINNER Victor

STINNER Victor added the comment:

sys.argv must not be changed. It would break too many Python applications.

*If* we decide to expose the command line parameter in Python, we can
add a new variable like sys.command for example. "command" name in
used in the C code of Python, and also comes from "c" of "-c".

--

___
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-02-09 Thread Neil Girdhar

Neil Girdhar added the comment:

Thank you, Benjamin.

It's my nature to keep code consistent/clean, but I realize that I can get 
carried away.  Should I revert all incidental PEP 7 style changes?

Regarding the args/keywords, where do you mean?  If you're talking about 
compile.c, we can't merge them because the call_function operand expects to see 
the positional arguments below the keyword arguments on the stack.

--

___
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-02-09 Thread Benjamin Peterson

Benjamin Peterson added the comment:

On Mon, Feb 9, 2015, at 18:15, Neil Girdhar wrote:
> 
> Neil Girdhar added the comment:
> 
> Thank you, Benjamin.
> 
> It's my nature to keep code consistent/clean, but I realize that I can
> get carried away.  Should I revert all incidental PEP 7 style changes?

Yes, please.

> 
> Regarding the args/keywords, where do you mean?  If you're talking about
> compile.c, we can't merge them because the call_function operand expects
> to see the positional arguments below the keyword arguments on the stack.

You can ignore this suggestion, since it occurred to me after
misinterpreting the PEP.

--

___
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-02-09 Thread Neil Girdhar

Neil Girdhar added the comment:

Removed incidental PEP 7 changes and reran tests.

--
Added file: http://bugs.python.org/file38070/starunpack32.diff

___
Python tracker 

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



[issue23328] urllib2 fails for proxy credentials that contain a '/' character

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

To comply with the RFC on URLs, whoever is setting the environment variable 
_should_ do the encoding, and then Python will _decode_ it. But I suspect this 
case is more about how Python should handle an environment variable that hasn’t 
been encoded correctly.

--

___
Python tracker 

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



[issue23426] run_setup is broken in distutils

2015-02-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Added tests.

--
stage:  -> test needed
Added file: http://bugs.python.org/file38071/issue23426-with-tests.patch

___
Python tracker 

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



[issue23426] run_setup is broken in distutils

2015-02-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
stage: test needed -> commit review

___
Python tracker 

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



[issue21793] httplib client/server status refactor

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

If changing the log format, you might also want to update the comment at the 
top of Lib/http/server.py:53. It seems the original format was imitating 
, except the timestamp is 
slightly different.

--

___
Python tracker 

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



[issue6634] sys.exit() called from threads other than the main one: undocumented behaviour

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

If it were me, I’d drop the Notes and Warnings (never been a fan), and put 
Thing #2 first, and then Thing #1. Maybe something like

'''
sys.exit([arg])

Exit from Python. . . . and it is possible to intercept the exit attempt at an 
outer level. When called from a thread other than the main thread, this causes 
the thread to exit silently instead, and is equivalent to calling 
:func:`thread.exit`.

The optional argument *arg* can be an integer giving the exit status 
(defaulting to zero). Passing ``None`` is equivalent to passing zero. Any other 
object is printed to `stderr` and results in an exit status of 1. In
particular, ``sys.exit("some error message")`` is a quick way to exit a
program when an error occurs. When called from a thread other than the main 
thread, nothing is printed and the argument is ignored.

An exit status of zero is considered “successful termination” and any nonzero 
status is considered “abnormal termination” . . . Unix programs generally use 2 
for command line syntax errors and 1 for all other kinds of errors.
'''

--

___
Python tracker 

___
___
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-09 Thread Thomas Kluyver

Thomas Kluyver added the comment:

Would anyone like to do further review of this - or commit it ;-) ?

I don't think anyone has objected to the concept since I brought it up on 
python-ideas, but if anyone is -1, please say so.

--

___
Python tracker 

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

Martin Panter added the comment:

Have you seen the code review comments on the Rietveld, 
? (Maybe check spam emails.) Many of the 
comments from the earlier patches still stand. In particular, I would like to 
see the “input” default value addressed, at least for the new run() function, 
if not the old check_output() function.

--

___
Python tracker 

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



[issue23424] Unicode character ends interactive session

2015-02-09 Thread eryksun

eryksun added the comment:

This isn't a Python bug. The Windows console doesn't properly support UTF-8. 
See issue 1602 and Drekin's win-unicode-console, an alternative REPL based on 
the wide-character (UCS-2) console API.

FWIW, I attached a debugger to conhost.exe under Windows 7 to inspect what's 
happening here. In the client, the CRT's read() function calls WinAPI ReadFile. 
For a console handle this calls either ReadConsoleA or (in Windows 8+) 
NtReadFile. Either way, most of the action happens in the server process, 
conhost.exe. 

The server's input buffer is Unicode, which gets encoded to CP 65001 (UTF-8) by 
calling WideCharToMultibyte. However the server incorrectly assumes the current 
codepage is a Windows ANSI codepage with a one-to-one mapping, i.e. that each 
16-bit wchar_t maps to an 8-bit char in the current codepage. Since 'ł' gets 
UTF-8 encoded as the two-byte string b'\xc5\x82', the allocated buffer is too 
small by a byte. The server doesn't recover from this failure by allocating a 
larger buffer. It just reports back to the client process that it read 0 bytes. 
The CRT in turn sets the end-of-file (EOF) flag on the stdin FILE stream, which 
causes Python to exit 'normally'.

--
nosy: +eryksun

___
Python tracker 

___
___
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-09 Thread Thomas Kluyver

Thomas Kluyver added the comment:

Aha, I hadn't seen any of those. They had indeed been caught by the spam 
filter. I'll look over them now.

--

___
Python tracker 

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



[issue23361] integer overflow in winapi_createprocess

2015-02-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ab2e79c6cf6b by Benjamin Peterson in branch '3.3':
add overflow checking (closes #23361)
https://hg.python.org/cpython/rev/ab2e79c6cf6b

New changeset b82cc9180a78 by Benjamin Peterson in branch '3.4':
merge 3.3 (#23361)
https://hg.python.org/cpython/rev/b82cc9180a78

New changeset 76170e33f251 by Benjamin Peterson in branch 'default':
merge 3.4 (#23361)
https://hg.python.org/cpython/rev/76170e33f251

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



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

2015-02-09 Thread Robert Collins

Robert Collins added the comment:

I'm idealogically opposed to polymorphic interpretation of args :)

Antoine, will you be ok with one __init__ and one classmethod?

--

___
Python tracker 

___
___
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-09 Thread Thomas Kluyver

Thomas Kluyver added the comment:

Fourth version of patch, responding to review comments on Rietveld. The major 
changes are:

- Eliminated the corner case when passing input=None to run() - now it's a real 
default parameter. Added a shim in check_output to keep it behaving the old way 
in case anything is relying on it, but I didn't document it.
- The docstring of run() was shortened quite a bit by removing the examples.
- Added a whatsnew entry

I also made various minor fixes - thanks to everyone who found them.

--
Added file: http://bugs.python.org/file38072/subprocess_run4.patch

___
Python tracker 

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



[issue20059] Inconsistent urlparse/urllib.parse handling of invalid port values?

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

Mapping out-of-range ports to None was added in Issue 14036, though I don’t 
understand why that approach was taken instead of raising ValueError. Here is a 
patch to raise ValueError for out-of-range integer values instead.

--
keywords: +patch
Added file: http://bugs.python.org/file38073/port-ValueError.patch

___
Python tracker 

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



[issue14036] urlparse insufficient port property validation

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

See Issue 20059 proposing to change this to raise ValueError

--
nosy: +vadmium

___
Python tracker 

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



[issue23430] socketserver.BaseServer.handle_error() should not catch exiting exceptions

2015-02-09 Thread Martin Panter

New submission from Martin Panter:

I propose changing the socket servers to not suppress exceptions that are meant 
to exit the interpreter. This is most applicable to single threaded servers, 
but my patch does the same thing for multithreading servers. It no longer 
catches exceptions that are not derived from the Exception class, such as 
KeyboardInterrupt and SystemExit. The shutdown_request() method is still called 
in all cases though.

I also added a test for the forking server’s handle_error() method.

--
components: Library (Lib)
files: socketserver-exit.patch
keywords: patch
messages: 235662
nosy: vadmium
priority: normal
severity: normal
status: open
title: socketserver.BaseServer.handle_error() should not catch exiting 
exceptions
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file38074/socketserver-exit.patch

___
Python tracker 

___
___
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-09 Thread Jeff Hammel

Jeff Hammel added the comment:

A few observations in passing.  I beg your pardon for not commenting after a 
more in depth study of the issue, but as someone that's written and managed 
several subprocess module front-ends, my general observations seem applicable.

subprocess needs easier and more robust ways of managing input and output 
streams

subprocess should have easier ways of managing input: file streams are fine, 
but plain strings would also be nice

for string commands, shell should always be true. for list/Tupperware commands, 
shell should be false. in fact you'll get an error if you don't ensure this. 
instead, just have what is passed key execution (for windows, I have no idea. 
I'm lucky enough not to write windows software these days)

subprocess should always terminate processes on program exit robustly (unless 
asked not too). I always have a hard time figuring out how to get processes to 
terminate, and how to have them not to.  I realize POSIX is black magic, to 
some degree.

I'm attaching a far from perfect front end that I currently use for reference

--
nosy: +Jeff.Hammel
Added file: http://bugs.python.org/file38075/process.py

___
Python tracker 

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



[issue23416] Make urllib.parse.SplitResult etc arguments optional

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

Adding a patch implementing my suggested enhancement

--
keywords: +patch
versions: +Python 3.5
Added file: http://bugs.python.org/file38076/split-result-default.patch

___
Python tracker 

___
___
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-09 Thread Davin Potts

Davin Potts added the comment:

Attached are proposed patches for default (3.5), 3.4, and 2.7 branches.  (The 
patch for 3.4 is identical to that for 3.5 so there are only two files in total 
being attached.)

Regarding the exception being raised:
* An ImportError is now consistently being raised across Python versions.  This 
is believed to be a more consistent behavior than using NotImplementedError but 
it is debatable whether all such situations might be switched to instead use 
NotImplementedError in the future.
* Implementation is done via a try-except around the problematic attempt to use 
_multiprocessing.SemLock inside the multiprocessing.queue module; it is 
believed this change has minimal risk.
* The text of the ImportError message differs only slightly from that used in 
the exception highlighted in issue 3770.  In 2.7, the code raising this 
exception is encountered in both code execution paths (as described in issue 
3770 and as described here) but in 3.x various changes have broken this shared 
execution path.  After staring at it for quite some time, I believe a 
less-than-simple refactoring is required to get both execution paths to 
encounter the same exception -- I'm punting on that for now.  Ultimately, I 
believe the goal was not to leave the error message inspired by issue 3770 but 
instead to clean it up and eliminate it as part of further code improvement 
efforts.  I believe doing so is well beyond the scope of this issue but is 
still something that deserves addressing.

Regarding the documentation of the exception:
* A note has been added to the "Reference" section's "Pipes and Queues" 
subsection, describing the potential for and reasons behind an ImportError 
being encountered.
* The note that previously appeared in the "Introduction" section's 
"Synchronization between processes" subsection (introduced per issue 3770) has 
been relocated to similarly appear in the "Reference" section's 
"Synchronization primitives" subsection.  Such a note appearing in an 
introduction section serves as a distraction to the reader who is hopefully 
learning about key concepts; it is better located in the formal documentation 
around the synchronization primitives where caveats and details should be 
conveyed.  Making this change (relocation) keeps the two explanations of the 
ImportError arising from different places in the code better in parallel / 
symmetry with one another.

Running through the complete battery of tests on Debian Hurd was not possible 
as the sequence of tests could never complete (on the default/3.5 branch at 
least) -- various tests were observed to hang and never complete.  While Debian 
Hurd may not be a mainstream supported platform for Python, given its lack of 
important functionality such as a working sem_open implementation, it is still 
rather interesting as a testing platform to see how things behave when the 
underlying system is unable to provide numerous chunks of key functionality to 
Python.

--
keywords: +patch
stage: needs patch -> patch review
versions: +Python 3.5
Added file: http://bugs.python.org/file38077/issue23400_py35_and_py34.patch

___
Python tracker 

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



[issue23328] urllib2 fails for proxy credentials that contain a '/' character

2015-02-09 Thread Senthil Kumaran

Senthil Kumaran added the comment:

In the initial report, I thought, it was mentioned that curl reads the same 
http_proxy variable properly.  It will be good to have a correct curl test case 
to ascertain that. 

But, at all the places, where @ character is allowed in urls (netrc, git 
configs, I see that @ should be encoded). In that case, this bug report is more 
towards detecting bad urls and presenting a better error message.

--

___
Python tracker 

___
___
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-09 Thread Davin Potts

Davin Potts added the comment:

To be clear, the changes to 2.7 are exclusively in the documentation.  Changes 
to 3.4 and default (3.5) are in both documentation and code.

--
Added file: http://bugs.python.org/file38078/issue23400_py27.patch

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread 許邱翔

許邱翔 added the comment:

Attached factored patch for tests.

It looks much better. :)

--
hgrepos: +299
Added file: 
http://bugs.python.org/file38079/add_tarfile_cli_filetype_test_refactor.patch

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread 許邱翔

許邱翔 added the comment:

s/factored/refactored/

--

___
Python tracker 

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

Issue 15310 appears to have a more thorough patch

--
nosy: +vadmium

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2a06379f6562 by Serhiy Storchaka in branch '3.4':
Issue #23421: Fixed compression in tarfile CLI.  Patch by wdv4758h.
https://hg.python.org/cpython/rev/2a06379f6562

New changeset 5b70eb1cfad0 by Serhiy Storchaka in branch 'default':
Issue #23421: Fixed compression in tarfile CLI.  Patch by wdv4758h.
https://hg.python.org/cpython/rev/5b70eb1cfad0

--
nosy: +python-dev

___
Python tracker 

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



[issue23421] tarfile module does not correctly choose compression algorithms

2015-02-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution.

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



[issue23328] urllib2 fails for proxy credentials that contain a '/' character

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

This should demonstrate that Curl does parse literal slashes in the username 
and password fields:

$ http_proxy=http://user/name:pass/word@localhost:22 curl -v http://example.net/
*   Trying ::1...
* Connected to localhost (::1) port 22 (#0)
* Proxy auth using Basic with user 'user/name'
> GET http://example.net/ HTTP/1.1
> Proxy-Authorization: Basic dXNlci9uYW1lOnBhc3Mvd29yZA==
> User-Agent: curl/7.40.0
> Host: example.net
> Accept: */*
> Connection: TE
> TE: gzip
> Proxy-Connection: Keep-Alive
> 
SSH-2.0-OpenSSH_6.2
Protocol mismatch.
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
[Exit 56]
$ base64 -d <<< dXNlci9uYW1lOnBhc3Mvd29yZA==
user/name:pass/word$

--

___
Python tracker 

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



[issue3609] does parse_header really belong in CGI module?

2015-02-09 Thread Martin Panter

Martin Panter added the comment:

Good idea to move this to somewhere more visible and obvious. I would have been 
using parse_header() much earlier if I had known it existed.

However, maybe it would be better off in the “email.message” module. The rest 
of the “email.header” module only seems to be about internationalized header 
fields with special encodings.

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

___
Python tracker 

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



[issue23431] Idle Application Not Responding

2015-02-09 Thread ww0115

New submission from ww0115:

I recently downloaded Python 3.4 on my Mac (running on Yosemite 10.10.2) and 
every time I try and open Idle, the icon just keeps jumping and the application 
never opens. When I click on the icon after it stops jumping it just says 
"Application Not Responding". I've also tried downloading ActiveTCL to see if 
it helps but it doesn't as that application doesn't open either. Any 
suggestions?

--
components: IDLE
messages: 235675
nosy: ww0115
priority: normal
severity: normal
status: open
title: Idle Application Not Responding
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