[issue22226] Refactor dict result handling in Tkinter

2014-08-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch refactors code which converts the result of Tcl call to Python 
dict. Added new private function _splitdict() which does this in more robust 
manner.

Also this patch fixes a bug in Treeview.heading(). The heading subcommand of 
ttk::treeview return options dict in which one key surprisingly was not '-' 
prefixed.

% ttk::treeview t
% .t heading #0
-text {} -image {} -anchor center -command {} state {}

Current code unconditionally cuts s from the state key.

 from tkinter import ttk
 t = ttk.Treeview()
 t.heading('#0')
{'anchor': 'center', 'tate': '', 'image': '', 'text': '', 'command': ''}

--
assignee: serhiy.storchaka
components: Tkinter
files: tkinter_splitdict.diff
keywords: patch
messages: 225515
nosy: gpolo, serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Refactor dict result handling in Tkinter
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36411/tkinter_splitdict.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6
___
___
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 R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +r.david.murray

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



[issue22216] smtplip STARTTLS fails at second attampt due to unsufficiant quit()

2014-08-19 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22216
___
___
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 still don't see why TarFile.add() can't be changed to accept a file like 
object so users don't have to fumble around with a TarInfo object when they 
just want add a file like object, and don't care about the permission bits and 
whatnot. It also says un the TarInfo section that you get those objects from 
gettarinfo(), and its not clear (at least to me) that you can just manually 
construct one, and that you only need the size property set.

I still the easiest way to solve this is to have gettarinfo() or add() accept 
file like objects that don't have file descriptors, as it would go a long way 
to simplifying the use of this module as well. (in zip file you don't ever have 
to worry about ZipInfo objects unless you need them...)

--

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



[issue22220] Ttk extensions test failure

2014-08-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry, it was wrong link. Correct one is:
http://buildbot.python.org/all/builders/x86%20XP-4%203.4/builds/411/steps/test/logs/stdio

Build #411 failed, build #412 successful, and build #413 failed again. May be 
this is test order depending failure.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue0
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue22215
___
___
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 storch...@gmail.com:


--
assignee:  - serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22215
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue22090
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue21163
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue7
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue21163
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue8
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue22208
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue1742205
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue15795
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue15125
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue1757072
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue20042
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue22219
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue20291
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue15696
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue15513
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue9
___
___
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 storch...@gmail.com:


--
versions: +Python 3.5 -Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18595
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue22230
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue22230
___
___
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 breamore...@yahoo.co.uk:


--
nosy: +BreamoreBoy, Rosuav

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8
___
___
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 storch...@gmail.com:


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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15696
___
___
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 geoffsp...@gmail.com:


--
nosy: +geoffreyspear

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19884
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue22208
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue21389
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue22208
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue19628
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue19628
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue22179
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue19628
___
___
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 berker.pek...@gmail.com:


--
nosy: +christian.heimes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22211
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue7283
___
___
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 a...@moreati.org.uk:


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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12006
___
___
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 breamore...@yahoo.co.uk:


--
nosy: +BreamoreBoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12006
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue21308
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue21308
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue8797
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue21308
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue21308
___
___
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 rep...@bugs.python.org
 http://bugs.python.org/issue21308
 ___

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21308
___
___
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(ubugs.python.org)
conn.request(POST, uhttp://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(ubugs.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 rep...@bugs.python.org
http://bugs.python.org/issue22231
___
___
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 rep...@bugs.python.org
http://bugs.python.org/issue21308
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com