[issue21389] The repr of BoundMethod objects sometimes incorrectly identifies the bound function

2014-08-19 Thread Steven Barker

Steven Barker added the comment:

OK, I've written some tests of the new bound method repr functionality, which 
I'm attaching as a patch against the current tip.

I test the basic repr output, all the cases the old code got wrong (inherited 
methods, overridden methods, methods called via super, and classmethods) and 
the strange corner cases that probably won't come up in ordinary code (such as 
methods manually created from callables that don't have __name__ or 
__qualname__ attributes).

I've also fixed the defaultdict test that was relying upon the old repr output. 
I don't believe there are any other places in the standard library or tests 
where a bound method's repr is examined.

My patch adds the tests in a new file, Lib/test/test_bound_method_repr.py. I 
looked to see if there was an existing file that tested similar behavior, but 
none that I found really seemed appropriate. If I overlooked a better place to 
put the new tests, please let me know and I'll update the test patch.

I'm not very experienced at writing unit tests, so comments and/or criticism is 
welcomed. I copied parts of the file's structure (such as the test_main() 
function and if __name__ == "__main__" boilerplate) from other test files, so 
hopefully I've stayed pretty close to the usual Python test style.

--
Added file: http://bugs.python.org/file36420/method_repr_tests.diff

___
Python tracker 

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



[issue21308] PEP 466: backport ssl changes

2014-08-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

In load_cert_chain, you may find it convenient to not Py_DECREF and Py_CLEAR 
keyfile_bytes and certfile_bytes, which aren't PyObject *.

--

___
Python tracker 

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



[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header

2014-08-19 Thread Bob Chen

New submission from Bob Chen:

Try to run these two script below, and you will understand what I'm talking 
about.

If you specified an url and it happened to be an unicode string(which is quite 
common in python because python processes string as unicode and you could 
possibly get it from somewhere else), and your header contains a utf-8 string 
converted from a foreign language, like u'呵呵', then the codec error occurred.

File "/usr/lib/python2.7/httplib.py", line 808, in _send_output
msg = "\r\n".join(self._buffer) 


# -*- encoding: utf-8 -*-
# should fail
import httplib, urllib
params = urllib.urlencode({'@number': 12524, '@type': 'issue', '@action': 
'show'})
headers = {"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain", 'notes': u'呵呵'.encode('utf-8')}
conn = httplib.HTTPConnection(u"bugs.python.org")
conn.request("POST", u"http://bugs.python.org/any_url";, params, headers)
response = conn.getresponse()
print response.status, response.reason



# -*- encoding: utf-8 -*-
# should be ok
import httplib, urllib
params = urllib.urlencode({'@number': 12524, '@type': 'issue', '@action': 
'show'})
headers = {"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain", 'notes': u'呵呵'.encode('utf-8')}
conn = httplib.HTTPConnection(u"bugs.python.org")
conn.request("POST", "http://bugs.python.org/any_url";, params, headers)
response = conn.getresponse()
print response.status, response.reason

--
components: Library (Lib)
messages: 225553
nosy: Bob.Chen
priority: normal
severity: normal
status: open
title: httplib: unicode url will cause an ascii codec error when combined with 
a utf-8 string header
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue21308] PEP 466: backport ssl changes

2014-08-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Gentoo Linux. Openssl 1.0.1i

On Tue, Aug 19, 2014, at 19:29, Alex Gaynor wrote:
> 
> Alex Gaynor added the comment:
> 
> On what platform?
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue21308] PEP 466: backport ssl changes

2014-08-19 Thread Alex Gaynor

Alex Gaynor added the comment:

On what platform?

--

___
Python tracker 

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



[issue21308] PEP 466: backport ssl changes

2014-08-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Running test_ssl gives this:

% ./python Lib/test/regrtest.py test_ssl
test_ssl
Exception in thread Thread-104:
Traceback (most recent call last):
  File "/home/benjamin/dev/python/2.7/Lib/threading.py", line 810, in 
__bootstrap_inner
self.run()
  File "/home/benjamin/dev/python/2.7/Lib/test/test_ssl.py", line 1594, in run
if not self.wrap_conn():
  File "/home/benjamin/dev/python/2.7/Lib/test/test_ssl.py", line 1545, in 
wrap_conn
self.sock, server_side=True)
  File "/home/benjamin/dev/python/2.7/Lib/ssl.py", line 350, in wrap_socket
_context=self)
  File "/home/benjamin/dev/python/2.7/Lib/ssl.py", line 561, in __init__
self.do_handshake()
  File "/home/benjamin/dev/python/2.7/Lib/ssl.py", line 784, in do_handshake
self._sslobj.do_handshake()
error: [Errno 104] Connection reset by peer

--

___
Python tracker 

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



[issue8797] urllib2 basicauth broken in 2.6.5: RuntimeError: maximum recursion depth exceeded in cmp

2014-08-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c1edc4e43eb1 by Senthil Kumaran in branch '2.7':
Fix Issue #8797: Raise HTTPError on failed Basic Authentication immediately. 
Initial patch by Sam Bull.
http://hg.python.org/cpython/rev/c1edc4e43eb1

New changeset 30e8a8f22a2a by Senthil Kumaran in branch '3.4':
Fix Issue #8797: Raise HTTPError on failed Basic Authentication immediately. 
Initial patch by Sam Bull.
http://hg.python.org/cpython/rev/30e8a8f22a2a

New changeset 10d0a692b1b6 by Senthil Kumaran in branch 'default':
merge from 3.4
http://hg.python.org/cpython/rev/10d0a692b1b6

--

___
Python tracker 

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



[issue21308] PEP 466: backport ssl changes

2014-08-19 Thread Alex Gaynor

Alex Gaynor added the comment:

Last version had some stray stuff due to the fact that I don't know how to use 
version control. New version should resolve that.

--
Added file: http://bugs.python.org/file36419/ssl-backport.diff

___
Python tracker 

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



[issue21308] PEP 466: backport ssl changes

2014-08-19 Thread Alex Gaynor

Alex Gaynor added the comment:

New patch additionally backports the Tools/ssl/ directory from Python3, which 
has two utilities for generating some of the code used. Thanks to Benjamin for 
catching this.

--
Added file: http://bugs.python.org/file36418/ssl-backport.diff

___
Python tracker 

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



[issue12006] strptime should implement %V or %u directive from libc

2014-08-19 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue12006] strptime should implement %V or %u directive from libc

2014-08-19 Thread Alex Willmer

Changes by Alex Willmer :


Added file: http://bugs.python.org/file36417/12006_3.5_complete.patch

___
Python tracker 

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



[issue7283] test_site failure when .local/lib/pythonX.Y/site-packages hasn't been created yet

2014-08-19 Thread Ned Deily

Ned Deily added the comment:

Closing, since this problem apparently no longer occurs

--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue20328] mailbox: add method to delete mailbox

2014-08-19 Thread R. David Murray

R. David Murray added the comment:

Well, if you can delete subfolders, then you aren't deleting the main folder, 
either (unless it is empty?).  So isn't this really a 'delete_messages' method? 
 In which case, how does it differ from the 'clear' method?  Only in that it 
deletes the folder if it is empty?  That doesn't sound like a good API to me.

I find myself really confused as to what your goal is here.

--

___
Python tracker 

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



[issue22211] Remove VMS specific code in expat.h & xmlrole.h

2014-08-19 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue19628] maxlevels -1 on compileall for unlimited recursion

2014-08-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a62368778d6c by Benjamin Peterson in branch 'default':
allow recursion depth to be specified (closes #19628)
http://hg.python.org/cpython/rev/a62368778d6c

--
nosy: +python-dev
resolution:  -> fixed
stage: commit review -> 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



[issue22179] Idle. Search dialog found text not highlited on Windows

2014-08-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As it is now, show_hit should have a comment something like this:

# On Windows, selection highight is visible while the dialog is open.
# A 'hit' tag is used while the dialog is open (see #22179).
# The 'hit' tag should be deleted when this dialog is closed.
# The 'sel' tag keeps the text marked after closing.

However, there is a slight bug in show_hit behavior. For example, finding 'i' 
in "def i(): this list is 'is' # is not" finds all 6 'i's, one after the other, 
but only the 4 in identifier, plain text, builtin, and comment are visibly 
highlighted.  The 2 in the keyword and string are not.  The selection tag, 
however, is visible on the 'i' of "is" or "'is'"after the dialog is closed. 
Checking ColorDelegator, I do not see an obvious reason for why two tags are 
handled differently.

If this cannot be fixed, we should try the alternate fix of making the sel tag 
visible and dump the found tag. Otherwise, I think I like the heavier 
highlighting while the dialog is open.

--

___
Python tracker 

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



[issue19628] maxlevels -1 on compileall for unlimited recursion

2014-08-19 Thread Claudiu Popa

Claudiu Popa added the comment:

Backward compatibility reasons, I guess. compileall -l completely deactivates 
the recursion, so using -l for controlling the number of levels seems to 
overwrite its original meaning.

--

___
Python tracker 

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



[issue19628] maxlevels -1 on compileall for unlimited recursion

2014-08-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Why can't we just reuse the "-l" option?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue20328] mailbox: add method to delete mailbox

2014-08-19 Thread Jonathan Dowland

Jonathan Dowland added the comment:

Hi David, whilst writing my patch I've tried to keep an open mind as to users 
of the methods, but I do have my own purpose in the back of my mind, and that's 
an archive mail tool which I would like to delete mail folders if, after 
performing an archive operation, they are empty. However, the archive mail tool 
has no awareness or interest in sub-folders. The user would be surprised, 
however, if it deleted them, should they exist.

There's also the issue of lack of locks for Maildirs. If one wanted to avoid 
recursive deleting, how could one achieve it? consider pseudo code

if len(mbox.list_folders()) <= 0:
  # no sub-folders, safe to delete?
  mbox.delete()

There are no guarantees an external process didn't create a sub folder between 
the test and the delete operation.

Finally, if one has a delete() operation that doesn't operate on sub-folders, 
but you want to recursively delete, you can at least assemble such a method. If 
you have a recursively-deleting method, and you *don't* want to delete 
sub-folders, you're stuck.

Having said all that please let me know what you're thinking; I'll happily try 
to cook up a patch to add both recursive and non-recursive delete methods.

--

___
Python tracker 

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



[issue22208] tarfile can't add in memory files (reopened)

2014-08-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The example given by Lars shows that it's not that easy to come up with the 
right code. Why not make it easier?

--
nosy: +pitrou

___
Python tracker 

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



[issue21389] The repr of BoundMethod objects sometimes incorrectly identifies the bound function

2014-08-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

That seems reasonable. Can you please write tests for the new behavior, though, 
and also fix test_defaultdict?

--

___
Python tracker 

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



[issue22208] tarfile can't add in memory files (reopened)

2014-08-19 Thread Mark Grandi

Mark Grandi added the comment:

I was just thinking that if os.stat fails, then you try getting the size by 
just calling len() on it, as stuff like io.BytesIO and io.StringIO will respond 
to that.

But if we are not changing the behavior of the API, at the very least there 
needs to be documentation changes / an example of adding a file that does not 
have a file descriptor. I can do that if needed.

--

___
Python tracker 

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



[issue19884] Importing readline produces erroneous output

2014-08-19 Thread Geoffrey Spear

Changes by Geoffrey Spear :


--
nosy: +geoffreyspear

___
Python tracker 

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



[issue15696] Correct __sizeof__ support for mmap

2014-08-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue22228] Adapt bash readline operate-and-get-next function

2014-08-19 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy: +BreamoreBoy, Rosuav

___
Python tracker 

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



[issue22230] 'python -mzipfile -c' does not zip empty directories

2014-08-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue22219.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> python -mzipfile fails to add empty folders to created zip

___
Python tracker 

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



[issue22230] 'python -mzipfile -c' does not zip empty directories

2014-08-19 Thread Ryan Wilson

New submission from Ryan Wilson:

Running command:

$ mkdir foo; python -mzipfile -c foo.zip foo; python -mzipfile -e foo.zip dest
ls: cannot access dest: No such file or directory

This is because 'foo.zip' is empty since running 'python -mzipfile -c foo.zip 
foo' does not zip empty directories.

Running 'unzip foo.zip' also produces:
Archive:  foo.zip
warning [foo.zip]:  zipfile is empty

The following posted patch fixes this issue.

--
components: Library (Lib)
files: add_empty_dirs_to_zipfile.patch
keywords: patch
messages: 225535
nosy: ryantimwilson
priority: normal
severity: normal
status: open
title: 'python -mzipfile -c' does not zip empty directories
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file36416/add_empty_dirs_to_zipfile.patch

___
Python tracker 

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



[issue18595] zipfile: symlinks etc.

2014-08-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue22229] wsgiref doesn't appear to ever set REMOTE_HOST in the environ

2014-08-19 Thread Alex Gaynor

New submission from Alex Gaynor:

Based on a reading of the code:

https://github.com/python/cpython/blob/master/Lib/wsgiref/simple_server.py#L88-L90

is where REMOTE_HOST is set.

However, `address_string` always returns `self.client_address[0]` 
(https://github.com/python/cpython/blob/master/Lib/http/server.py#L568), which 
means that `!=` comparison always returns False, which means REMOTE_HOST is 
never actually set correctly.

--
components: Library (Lib)
messages: 225534
nosy: alex
priority: normal
severity: normal
status: open
title: wsgiref doesn't appear to ever set REMOTE_HOST in the environ
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



[issue15513] Correct __sizeof__ support for pickle

2014-08-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Required patch is already committed. Here is updated patch.

--
stage:  -> patch review
versions: +Python 3.4, Python 3.5 -Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file36415/pickle_sizeof-3.4.patch

___
Python tracker 

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



[issue15696] Correct __sizeof__ support for mmap

2014-08-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4aba144b752d by Serhiy Storchaka in branch '2.7':
Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows.
http://hg.python.org/cpython/rev/4aba144b752d

New changeset ca4a22256bf8 by Serhiy Storchaka in branch '3.4':
Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows.
http://hg.python.org/cpython/rev/ca4a22256bf8

New changeset f543171d7f41 by Serhiy Storchaka in branch 'default':
Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows.
http://hg.python.org/cpython/rev/f543171d7f41

--
nosy: +python-dev

___
Python tracker 

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



[issue20291] Argument Clinic should understand *args and **kwargs parameters

2014-08-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Yes, I agree we should follow the Python level semantics, and only capture the 
excess positional arguments. For the record, the four builtins I flagged as 
needing this in order to add introspection information:

__build_class__
- 2 positional only args, arbitrary additional args
- checks size with PyTuple_GET_SIZE
- uses PyTuple_GET_ITEM x2 + PyTuple_GetSlice to unpack

print
- only arbitrary position args, iterates and extracts using PyTuple_GetItem
- uses PyArg_ParseTupleAndKeywords with an empty tuple to extract the 
keyword-only args

min
max
- use a shared helper function min_max
- uses the args tuple directly if size > 1
- otherwise uses PyArg_UnpackTuple to extract the supplied iterable
- uses PyArg_ParseTupleAndKeywords with an empty tuple to extract the 
keyword-only args
- this "one arg means iterable" style API might need to be a special case...

--

___
Python tracker 

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



[issue22219] python -mzipfile fails to add empty folders to created zip

2014-08-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think zipfile should add an entry for directories as zip tool does. Here is a 
patch. In additional it fixes zipfile -c for some corner cases (when arguments 
end with /, . or .. component).

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue20042] Python Launcher, Windows, fails on scripts w/ non-latin names

2014-08-19 Thread eryksun

eryksun added the comment:

The problem is skip_whitespace mistakenly calls isspace instead of iswspace. 

http://hg.python.org/cpython/file/c0e311e010fc/PC/launcher.c#l48

isspace has undefined behavior when the argument is "not EOF or in the range of 
0 through 0xFF":

http://msdn.microsoft.com/en-us/library/y13z34da%28v=vs.100%29.aspx

The display of debug messages should be handled in its own issue. IMO, setting 
stderr to _O_WTEXT mode or _O_U16TEXT mode looks reasonable. The launcher 
already uses wide-character strings and the wprintf family. It's just the 
default _O_TEXT mode ends up encoding to the console codepage. 

Regarding msg206744, %s in wide-character format strings is OK for VC++ 10:

http://msdn.microsoft.com/en-us/library/hf4y5e3w%28v=vs.100%29.aspx

This will be a legacy mode in VC++ 14 (CPython 3.5?): 

http://blogs.msdn.com/b/vcblog/archive/2014/06/18/crt-features-fixes-and-breaking-changes-in-visual-studio-14-ctp1.aspx

P.S.
In case someone wants an easy issue, I noticed a bug. There should only be one 
%s in the format string that starts on line 262:

http://hg.python.org/cpython/file/c0e311e010fc/PC/launcher.c#l262

--
nosy: +eryksun

___
Python tracker 

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



[issue1757072] Zipfile robustness

2014-08-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Original issue was fixed in cc3255a707c7. Issue reported in msg73317 was fixed 
in issue14315. Is there something left about this issue?

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

___
Python tracker 

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



[issue15125] argparse: positional arguments containing - in name not handled well

2014-08-19 Thread Keith Hughitt

Keith Hughitt added the comment:

Any progress on this issue? Still persists in Python 3.4.1.

--
nosy: +khughitt

___
Python tracker 

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



[issue15795] Zipfile.extractall does not preserve file permissions

2014-08-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The TarFile.extract() method has the set_attrs parameter which controls similar 
behavior but is less flexible. It would be good to unify zipfile and tarfile 
abilities. set_attrs also controls setting file owner and time. When we restore 
unsafe uid/gid/sticky bits, it would be worth to restore also file owner. And 
it would be not bad to restore file time.

--
assignee:  -> serhiy.storchaka
nosy: +lars.gustaebel, serhiy.storchaka
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue1742205] ZipFile.writestr writes incorrect extended local headers

2014-08-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For now zip -T doesn't complain.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue22208] tarfile can't add in memory files (reopened)

2014-08-19 Thread Lars Gustäbel

Lars Gustäbel added the comment:

tarfile needs to know the size of a file object beforehand because the tar 
header is written first followed by the file object's data. If the file object 
is not based on a real file descriptor, tarfile cannot simply use os.fstat() 
but the user has to pass the size somehow. And I doubt that it's a good idea to 
add size arguments to TarFile.add() and .addfile() because it might lead to 
confusion.

I think tarfile is rather good at exposing the important parts of its low-level 
api to the programmer, in a way that still leaves some work for him to do but 
without getting in his way.  I don't see why manually creating TarInfo objects 
is such a big deal. It is the far superior way because it offers the maximum 
freedom for the programmer - admittedly at the cost of a slightly steeper 
learning curve. And we have to account for many different use cases that people 
have. For example, you don't mention what you think creating directories from 
scratch should be like in your opinion.

With regard to the usage of the size attribute the documentation for 
TarFile.addfile() says clearly:

"""Add the TarInfo object tarinfo to the archive. If fileobj is given, 
tarinfo.size bytes are read from it and added to the archive. You can create 
TarInfo objects using gettarinfo()."""

--

___
Python tracker 

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



[issue22228] Adapt bash readline operate-and-get-next function

2014-08-19 Thread Lele Gaifax

New submission from Lele Gaifax:

Bash implements an handy extension to the history/readline library called 
"operate-and-get-next" bound by default to Ctrl-O that lets you repeat an 
arbitrary sequence of input lines possibly editing some of them.

This patch adapts the extension to the Python readline module.

Since I have no way of testing it against the libedit alternative library, it 
targets only the real readline library.

--
files: readline.patch
keywords: patch
messages: 225523
nosy: lelit, steven.daprano
priority: normal
severity: normal
status: open
title: Adapt bash readline operate-and-get-next function
type: enhancement
Added file: http://bugs.python.org/file36414/readline.patch

___
Python tracker 

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



[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-08-19 Thread Marco Paolini

Marco Paolini added the comment:

> I don't understand how keeping a strong refrence would fix anything. You
> only provided one example (async-gc-bug.py) which uses Queue objects but
> keep weak references to them. Keeping strong references to tasks is not the
> right fix. You must keep strong references to queues. If a queue is
> destroyed, how can you put an item into it? Otherwise, the task will wait
> forever. Keeping a strong refrence to the task just hides the bug. Or I
> missed something.

The original asyncio-gc-issue.py wasn't written by me, and yes, as you say it 
does have the reference bug you describe. I argue that bug shouldn't cause 
tasks to die: it should rather limit (as gc proceeds) the number of queues 
available to the producer in the WeakSet() and leaving alive all consumer 
waiting on an unreachable queue.

Please look at my test2.py or even better test3.py for a simpler example.

Note that in my issue_22163_patch_0.diff I only keep strong refs to futures a 
task is waiting on. Just as asyncio is already doing with asyncio.sleep() 
coroutine.

> I dislike the idea of keeping strong references to tasks, it may create
> even more reference cycles. We already have too many cycles with exceptions
> stored in futures (in tasks).
We are also already keeping strong refs to futures like asyncio.sleep

I dislike the idea of randomly losing tasks.

I also dislike the idea of forcing the user to manage strong refs to its tasks. 
All 3rd party libraries will have to invent their own way and it will lead to 
even more leaks/cycles very hard to debug.

Not just exceptions: everytime a task is yielding on a future asyncio creates a 
reference cycle.

> The current unit test uses low level functions to remove a variable using a
> frame object. Can you provide an example which shows the bug without using
> low level functions?

My issue_22163_patch_0.diff only clears references by setting variables to 
`None`. No low level stuff needed.
 
My test2.py example script also doesn't use any low level stuff

I just uploaded test3.py with a simpler (and possibly more realistic) example.

--
Added file: http://bugs.python.org/file36413/test3.py

___
Python tracker 

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



[issue22227] Simplify tarfile iterator

2014-08-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

TarFile iteration can be simplified by using a generator instead of iterator 
class. Attached patch get rid of the TarIter class and decrease sources size by 
16 lines.

--
components: Library (Lib)
files: tarfile_tariter.diff
keywords: patch
messages: 225521
nosy: lars.gustaebel, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Simplify tarfile iterator
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36412/tarfile_tariter.diff

___
Python tracker 

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



[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-08-19 Thread STINNER Victor

STINNER Victor added the comment:

I don't understand how keeping a strong refrence would fix anything. You
only provided one example (async-gc-bug.py) which uses Queue objects but
keep weak references to them. Keeping strong references to tasks is not the
right fix. You must keep strong references to queues. If a queue is
destroyed, how can you put an item into it? Otherwise, the task will wait
forever. Keeping a strong refrence to the task just hides the bug. Or I
missed something.

I dislike the idea of keeping strong references to tasks, it may create
even more reference cycles. We already have too many cycles with exceptions
stored in futures (in tasks).

The current unit test uses low level functions to remove a variable using a
frame object. Can you provide an example which shows the bug without using
low level functions?

--

___
Python tracker 

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



[issue22090] Decimal and float formatting treat '%' differently for infinities and nans.

2014-08-19 Thread Mark Dickinson

Mark Dickinson added the comment:

The decimal.py part LGTM.  (The rest looks good, too, but I haven't tested it.) 
 This seems like one of those bugs that probably isn't worth backporting to 
3.4, but given the projected longevity of 2.7 it might be worth applying there.

--

___
Python tracker 

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



[issue22215] "embedded NUL character" exceptions

2014-08-19 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



[issue22215] "embedded NUL character" exceptions

2014-08-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

BDFL have approved the idea 
(http://permalink.gmane.org/gmane.comp.python.devel/149000). Could anyone 
please make the review of concrete patch?

--

___
Python tracker 

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