[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Can you please provide an example of data for which the tostring method fails? 
I can't reproduce this on simple data.

>>> import xml.etree.ElementTree as ET
>>> ET.tostring(ET.XML('qwerty'), method='text', 
>>> encoding='unicode')
'qwerty'

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue6975] symlinks incorrectly resolved on POSIX platforms

2013-01-10 Thread Hynek Schlawack

Changes by Hynek Schlawack :


--
title: symlinks incorrectly resolved on Linux -> symlinks incorrectly resolved 
on POSIX platforms

___
Python tracker 

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



[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I found such example. It happens when the data contains XML entity.

>>> ET.tostring(ET.XML('a&'), method='text', 
>>> encoding='unicode')
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/xml/etree/ElementTree.py", line 1171, in 
tostring
ElementTree(element).write(stream, encoding, method=method)
  File "/home/serhiy/py/cpython/Lib/xml/etree/ElementTree.py", line 824, in 
write
_serialize_text(write, self._root)
  File "/home/serhiy/py/cpython/Lib/xml/etree/ElementTree.py", line 1057, in 
_serialize_text
write(part)
TypeError: string argument expected, got 'list'


Indeed, itertext() returns a list of lists instead of list of strings.

>>> list(ET.XML('a&').itertext())
[['a', '&']]

The bug is in the C implementation of itertext().

--

___
Python tracker 

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



[issue16909] urlparse: add userinfo attribute

2013-01-10 Thread Olof Johansson

Olof Johansson added the comment:

Thank you for you feedback. I agree, the reason I wanted this was because of a 
corner case, but otoh, the username:password syntax is the real corner case 
imho. Of course, I understand that this must be supported for backwards 
compatability.

(For fully RFC compliant URLs however, userinfo would be the same as user since 
: in userinfo isn't allowed, so again, you have a very valid point for your 
corner case argument.)

The patch was developed against 2.7, so it won't apply on 3.4, but looking at 
3.4, urlparse already has a _userinfo property method, but it splits the 
userinfo in a tuple of (username, password). It would be easy to adapt the 
change to 3.4, but I'll wait until I get additional feedback.

--

___
Python tracker 

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



[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Frank

Frank added the comment:

It happens whenever the method is called, regardless of input. I'm using HTML 
that has been tidied first with HTML entities (if any) converted to unicode 
values.

--

___
Python tracker 

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



[issue16912] Wrong float sum w/ 10.14+10.1 and 10.24+10.2

2013-01-10 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Frank

Frank added the comment:

Scratch that, it happens whenever there are XML entities (<, " and 
friends) that are appearing the text as you pointed out.

--

___
Python tracker 

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



[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch for 3.3+. 2.7 and 3.2 are not affected.

--
keywords: +patch
stage: needs patch -> patch review
versions: +Python 3.4
Added file: http://bugs.python.org/file28666/etree_itertext.patch

___
Python tracker 

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



[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue16894] Function attribute access doesn't invoke methods in dict subclasses

2013-01-10 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +daniel.urban

___
Python tracker 

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



[issue16865] ctypes arrays >=2GB in length causes exception

2013-01-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

In _ctypes.c there are (only!) two occurrences of the "long" type... both are 
related to ctypes arrays and look suspect.

--

___
Python tracker 

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



[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays

2013-01-10 Thread gac

New submission from gac:

I had cause to use smtplib to help me pinpoint why some outgoing mail was 
failing, but found that while it offered verbose logging (via debuglevel 1) 
this was without timestamps, making it difficult to make my case to the server 
operator that it was a server-side delay causing the issue. I've changed 
smtplib.py to add a second debugging level which includes timestamps down to 
microsecond granularity so that the debug log produced can pinpoint when a 
server isn't responding promptly.

debuglevel 1 is unchanged, so anyone depending on the output from this being in 
a particular format won't be affected (either by setting debuglevel to "1" or 
"true"), but if debuglevel 2 is used explicitly then the standard output is 
preceded by a timestamp.

--
components: Library (Lib)
files: smtplib.py.patch
keywords: patch
messages: 179538
nosy: gac
priority: normal
severity: normal
status: open
title: timestamping in smtplib.py to help troubleshoot server timeouts/delays
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file28667/smtplib.py.patch

___
Python tracker 

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



[issue16874] setup.py upload option repeated in docs

2013-01-10 Thread Marek Šuppa

Marek Šuppa added the comment:

So what do you think should be done here?

Just removing the "or --repository=" part?

--
nosy: +mrshu

___
Python tracker 

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



[issue16874] setup.py upload option repeated in docs

2013-01-10 Thread Berker Peksag

Berker Peksag added the comment:

I think the problem is the usage of `:option:`.

|:option:`--repository=` or :option:`--repository=`| should be 
written like |:option:`--repository=*url*` or :option:`--repository=*section*`|

See:

- http://hg.python.org/cpython/file/default/Doc/distutils/uploading.rst#l39
- http://hg.python.org/cpython/file/default/Doc/distutils/uploading.rst#l28

Patch attached.

--
keywords: +patch
nosy: +berker.peksag
Added file: http://bugs.python.org/file28668/distutils-upload-markup.diff

___
Python tracker 

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



[issue16715] Get rid of IOError. Use OSError instead

2013-01-10 Thread Andrew Svetlov

Andrew Svetlov added the comment:

It's not a typo.
1. LoadError is inherited from OSError so LoadError exception is also caught.
2. Pointed code just resets cookie state and reraises exception, exception type 
is saved.

The code is correct from my perspective.

--

___
Python tracker 

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



[issue13198] Remove duplicate definition of write_record_file

2013-01-10 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Eric, if you want to keep distutils2 issues on the tracker for a while — I'm ok 
with that.

--

___
Python tracker 

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



[issue16915] mode of socket.makefile is more limited than documentation suggests

2013-01-10 Thread Antoon Pardon

New submission from Antoon Pardon:

The documentation of socket.makefile states that its arguments are interpreted 
the same way as by the built-in open() function. However the mode argument of 
socket.makefile only allows 'r', 'w' and 'b'.

That some options are not allowed seems perfectly normal, like there being no 
use of an 'x' option but the documentation should probably reflect that.

But I don't see why the 't' should cause trouble. If people can open a file 
explicitly in text mode, I don't see why it wouldn't be possible to explicitly 
ask for text mode in socket.makefile

--
components: Library (Lib)
messages: 179543
nosy: Antoon.Pardon
priority: normal
severity: normal
status: open
title: mode of socket.makefile is more limited than documentation suggests
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue16076] xml.etree.ElementTree.Element is no longer pickleable

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d6dadfecf22 by Eli Bendersky in branch '3.3':
Issue #16076: make _elementtree.Element pickle-able in a way that is compatible
http://hg.python.org/cpython/rev/8d6dadfecf22

New changeset 4c268b7c86e6 by Eli Bendersky in branch 'default':
Issue #16076: make _elementtree.Element pickle-able in a way that is compatible
http://hg.python.org/cpython/rev/4c268b7c86e6

--

___
Python tracker 

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



[issue16917] Misleading missing parenthesis syntax error

2013-01-10 Thread Dražen Lučanin

New submission from Dražen Lučanin:

When running this script:

things = ['a', 'b']
things.append('c'
for a in things:
print a

I get the following output:

$ python script.py 
  File "script.py", line 3
for a in things:
   ^
SyntaxError: invalid syntax

the SyntaxError is very misguiding. The error is in a missing parenthesis after 
the append call, but the error output points to the colon in the for loop. It 
got me looking for some invisible characters around the colon (which sometimes 
do pop up in my IPython notebook in OS X).

Expected behaviour - the interpreter should warn me that I have an unmatched 
parenthesis or at least give some hint as to what possible tokens were expected 
instead of a colon to help me identify the faulty expression. It is hard to 
match all parentheses as it is, let alone when the error caused by them shows 
up in a different line pointing to a token of a different expression with a 
very vague description.

--
components: Interpreter Core
messages: 179547
nosy: kermit666
priority: normal
severity: normal
status: open
title: Misleading missing parenthesis syntax error
type: compile error
versions: Python 2.7

___
Python tracker 

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



[issue16916] The Extended Iterable Unpacking (PEP-3132) for byte strings doesn't match the specification

2013-01-10 Thread Marco Buttu

New submission from Marco Buttu:

The PEP 3132 said:
"""
... if seq is a slicable sequence, all the following assignments are equivalent 
if seq has at least three elements:

a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
"""

But this doesn't happen for byte strings:

>>> seq = b'xyz'
>>> a, b, c = seq[0], seq[1:-1], seq[-1]
>>> a, b, c
(120, b'y', 122)
>>> a, *b, c = seq
>>> a, b, c
(120, [121], 122)

Tested on Python3.3 and Python3.2 (Linux Ubuntu 11.04)

--
components: Interpreter Core
messages: 179545
nosy: marco.buttu
priority: normal
severity: normal
status: open
title: The Extended Iterable Unpacking (PEP-3132) for byte strings doesn't 
match the specification
type: behavior
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue16076] xml.etree.ElementTree.Element is no longer pickleable

2013-01-10 Thread Eli Bendersky

Eli Bendersky added the comment:

Fixed in 3.3 and default. Thanks for the good work, Daniel. A separate issue 
can be opened for TreeBuilder.

--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16917] Misleading missing parenthesis syntax error

2013-01-10 Thread Dražen Lučanin

Changes by Dražen Lučanin :


--
type: compile error -> behavior

___
Python tracker 

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



[issue16917] Misleading missing parenthesis syntax error

2013-01-10 Thread Ezio Melotti

Ezio Melotti added the comment:

The colon is the first invalid char, for example this is valid python and works:
>>> things = ['a', 'b']
>>> things.append('c'
... for a in things)
>>> things
['a', 'b',  at 0xb76dacfc>]

In your case Python expects a genexp like things.append('c' for a in things), 
and when it finds the ':' it gives error.
If you use e.g. a 'while', you will see the error earlier:
>>> things = ['a', 'b']
>>> things.append('c'
... while True:
  File "", line 2
while True:
^
SyntaxError: invalid syntax

--
nosy: +ezio.melotti
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16917] Misleading missing parenthesis syntax error

2013-01-10 Thread Mark Dickinson

Mark Dickinson added the comment:

> The error is in a missing parenthesis after the append call

Well, that's one *possible* cause of the error.  But fixing that missing 
parenthesis isn't the only way to make the code correct, and Python doesn't 
have any reasonable way to guess which of the various possible errors you made 
or what you intended to write.  For example, the following is valid code:

things = ['a', 'b']
things.append('c'
for a in things)

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d965ff47cf94 by Eli Bendersky in branch '3.3':
Issue #16913: Fix Element.itertext()'s handling of text with XML entities.
http://hg.python.org/cpython/rev/d965ff47cf94

New changeset 9ab8632e7213 by Eli Bendersky in branch 'default':
Issue #16913: Fix Element.itertext()'s handling of text with XML entities.
http://hg.python.org/cpython/rev/9ab8632e7213

--
nosy: +python-dev

___
Python tracker 

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



[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Eli Bendersky

Eli Bendersky added the comment:

Fixed. Thanks.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16076] xml.etree.ElementTree.Element is no longer pickleable

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c46054b49b6c by Eli Bendersky in branch '3.3':
Update Misc/NEWS for issue #16076
http://hg.python.org/cpython/rev/c46054b49b6c

--

___
Python tracker 

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



[issue16613] ChainMap.new_child could use improvement

2013-01-10 Thread Walter Dörwald

Walter Dörwald added the comment:

I'd like to have this feature too. However the code should use

   d if d is not None else {}

instead of

   d or {}

For example I might want to use a subclass of dict (lowerdict) that converts 
all keys to lowercase. When I use an empty lowerdict in new_child(), 
new_child() would silently use a normal dict instead:

   class lowerdict(dict):
   def __getitem__(self, key):
   return dict.__getitem__(
   self,
   key.lower() if isinstance(key, str) else key
   )
   
   import collections
   
   cm = collections.ChainMap(lowerdict(), lowerdict())
   
   cm2 = cm.new_child(lowerdict())
   
   print(type(cm2.maps[0]))

This would print .

--
nosy: +doerwalter

___
Python tracker 

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



[issue15442] Expand the list of default dirs filecmp.dircmp ignores

2013-01-10 Thread Eli Bendersky

Eli Bendersky added the comment:

Attaching an alternative patch, that goes one (little) step further. Instead of 
repeating the ignored list all over the place (code, docstrings, ReST docs), 
the module exposes DEFAULT_IGNORES so everything can refer to it.

Also added some tests for this feature.

The patch is only vs. default (3.4), of course.

--
Added file: http://bugs.python.org/file28669/eli_issue15442.1.patch

___
Python tracker 

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-10 Thread Eli Bendersky

Eli Bendersky added the comment:

Ariel, are you interested in pursuing this issue?

Serhiy, I see you assigned this to yourself - would you like to submit a patch?

--

___
Python tracker 

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



[issue16917] Misleading missing parenthesis syntax error

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For better syntax error messages see issue1634034.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16917] Misleading missing parenthesis syntax error

2013-01-10 Thread Dražen Lučanin

Dražen Lučanin added the comment:

Yes, sure, I agree with both comments. Fors are a bit disambiguous in
this context in comparison to while loops. But something in the style
of Ezio's explanation might come in handy in the error output.

e.g.

SyntaxError: invalid syntax. "," or ")" expected in the argument list
of the method append, but ':' found instead.

(or the equivalent that's possible on that syntactic tree level)

Something that might explain that it's some sort of list being parsed,
not a for-loop command. It would point the coder in the right
direction, speeding him up.

This would all be a bit simpler if an indent was obligatory after
inserting a newline in the middle of a command. Then this would pass
OK

things.append('c'
for a in things)

while this would fail

things.append('c'
for a in things)

with a syntax error on the first line, because the second line
would've been interpreted as a new command, not a continuation of the
first one.

I don't know if something like that would be possible, due to some
other aspects, though...

On Thu, Jan 10, 2013 at 3:23 PM, Mark Dickinson  wrote:
>
> Mark Dickinson added the comment:
>
>> The error is in a missing parenthesis after the append call
>
> Well, that's one *possible* cause of the error.  But fixing that missing 
> parenthesis isn't the only way to make the code correct, and Python doesn't 
> have any reasonable way to guess which of the various possible errors you 
> made or what you intended to write.  For example, the following is valid code:
>
> things = ['a', 'b']
> things.append('c'
> for a in things)
>
> --
> nosy: +mark.dickinson
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue16509] sqlite3 docs do not explain check_same_thread

2013-01-10 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue16917] Misleading missing parenthesis syntax error

2013-01-10 Thread Ezio Melotti

Ezio Melotti added the comment:

> This would all be a bit simpler if an indent was obligatory after
> inserting a newline in the middle of a command.

This is not such a bad idea, but it is not backward-compatible and it would be 
inconsistent with how parentheses works in other situations.

Developers usually learn that they should look back at least till the previous 
line while investigating syntax errors.  Even in C (and similar languages) it's 
common that errors reported on one line are caused by e.g. a missing ';' on the 
previous line.

--

___
Python tracker 

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



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2013-01-10 Thread R. David Murray

R. David Murray added the comment:

For the record, this is a regression introduced by the fix for issue 9750.  I 
plan to commit the fix shortly, thanks for the report and patch.

--
nosy: +r.david.murray
stage:  -> commit review
type: crash -> behavior
versions: +Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue9750] sqlite3 iterdump fails on column with reserved name

2013-01-10 Thread R. David Murray

R. David Murray added the comment:

For the record, this patch also introduced another regression (issue 15545).

--

___
Python tracker 

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



[issue10182] match_start truncates large values

2013-01-10 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Note that this change is causing problems with genshi due to API backward 
incompatibility.  This is reported here:

https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1097783

The reason the user found it in Ubuntu first is that we track hg tip, but I've 
reproduced it in my own hg tip, and the diff of r80680 makes it pretty obvious.

I'm not saying the change should necessarily be reverted, but it *is* a 
backward incompatibility, and at a minimum the NEWS file (and release notes for 
2.7.4) should make it clear that the return types have changed.  As we're 
seeing, it breaks at least one existing package.

--
nosy: +barry

___
Python tracker 

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



[issue10182] match_start truncates large values

2013-01-10 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Nosied Benjamin since this is a release issue.  Re-opened, assigned to him, and 
release blocked for 2.7.4.

--
assignee:  -> benjamin.peterson
nosy: +georg.brandl, larry
priority: normal -> release blocker
status: closed -> open

___
Python tracker 

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



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2cdb599172ab by R David Murray in branch '3.2':
#15545: fix sqlite3.iterdump regression on unsortable row_factory objects.
http://hg.python.org/cpython/rev/2cdb599172ab

New changeset 6a85894c428f by R David Murray in branch '3.3':
merge #15545: fix sqlite3.iterdump regression on unsortable row_factory objects.
http://hg.python.org/cpython/rev/6a85894c428f

New changeset 7a62b5ee32ec by R David Murray in branch 'default':
merge #15545: fix sqlite3.iterdump regression on unsortable row_factory objects.
http://hg.python.org/cpython/rev/7a62b5ee32ec

New changeset bb4e4f0cec2e by R David Murray in branch '2.7':
#15545: sort iterdump via SQL instead of in python code
http://hg.python.org/cpython/rev/bb4e4f0cec2e

--
nosy: +python-dev

___
Python tracker 

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



[issue10182] match_start truncates large values

2013-01-10 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue16613] ChainMap.new_child could use improvement

2013-01-10 Thread Vinay Sajip

Vinay Sajip added the comment:

> d if d is not None else {}

Your intention makes sense, though I would prefer to write it as:

if d is None:
d = {}
return self.__class__(d, *self.maps)

--

___
Python tracker 

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



[issue16218] Python launcher does not support unicode characters

2013-01-10 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Thanks!

--

___
Python tracker 

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



[issue9750] sqlite3 iterdump fails on column with reserved name

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2cdb599172ab by R David Murray in branch '3.2':
#15545: fix sqlite3.iterdump regression on unsortable row_factory objects.
http://hg.python.org/cpython/rev/2cdb599172ab

New changeset 6a85894c428f by R David Murray in branch '3.3':
merge #15545: fix sqlite3.iterdump regression on unsortable row_factory objects.
http://hg.python.org/cpython/rev/6a85894c428f

New changeset 7a62b5ee32ec by R David Murray in branch 'default':
merge #15545: fix sqlite3.iterdump regression on unsortable row_factory objects.
http://hg.python.org/cpython/rev/7a62b5ee32ec

New changeset bb4e4f0cec2e by R David Murray in branch '2.7':
#15545: sort iterdump via SQL instead of in python code
http://hg.python.org/cpython/rev/bb4e4f0cec2e

--

___
Python tracker 

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



[issue10182] match_start truncates large values

2013-01-10 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Actually, 2.7 should just use PyInt_FromSsize_t, which only promotes when 
needed.

--

___
Python tracker 

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



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2013-01-10 Thread R. David Murray

R. David Murray added the comment:

Peter, I see you've made contributions before, but you don't show as having a 
contributor agreement on file according to the tracker.  Have you sent one in?  
If not, would you, please?

Thanks again for the fix.

--
components: +Library (Lib) -None
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue10182] match_start truncates large values

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0f5067d9e1d8 by Benjamin Peterson in branch '2.7':
use PyInt_FromSsize_t instead of PyLong_FromSsize_t (#10182)
http://hg.python.org/cpython/rev/0f5067d9e1d8

--

___
Python tracker 

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



[issue10182] match_start truncates large values

2013-01-10 Thread Benjamin Peterson

Benjamin Peterson added the comment:

It's good you were able to report this before we released anything.

--
status: open -> closed

___
Python tracker 

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



[issue16918] Fix test discovery for test_codecs.py

2013-01-10 Thread Zachary Ware

New submission from Zachary Ware:

Here's the fix for test_codecs.py, I believe.  I had a few headaches trying to 
get this patch created without changing some of the characters or adding a BOM 
to the file, and at one point the test was failing for no apparent reason.  
This version of the patch seems to work on my machine, though.

--
components: Tests
files: test_codecs_discovery.diff
keywords: patch
messages: 179571
nosy: brett.cannon, ezio.melotti, zach.ware
priority: normal
severity: normal
status: open
title: Fix test discovery for test_codecs.py
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file28670/test_codecs_discovery.diff

___
Python tracker 

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



[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays

2013-01-10 Thread R. David Murray

Changes by R. David Murray :


--
components: +email
nosy: +barry, r.david.murray
stage:  -> patch review

___
Python tracker 

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



[issue16919] Fix test discovery for test_crypt.py

2013-01-10 Thread Zachary Ware

New submission from Zachary Ware:

Here's a fix for test_crypt.py, inspired by Ezio's mention of using setUpModule 
in issue 16905.

I can't test this on a platform that actually has _crypt at the moment, but I 
should be able to later today if nobody else has before then.  Some tinkering 
has shown me that it /should/ work, though.

--
components: Tests
files: test_crypt_discovery.diff
keywords: patch
messages: 179572
nosy: brett.cannon, ezio.melotti, zach.ware
priority: normal
severity: normal
status: open
title: Fix test discovery for test_crypt.py
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file28671/test_crypt_discovery.diff

___
Python tracker 

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



[issue6975] symlinks incorrectly resolved on POSIX platforms

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch rewritten using recursion. Non-recursive version is not stack limited 
(and a little faster), but recursive version is perhaps more understandable. 
Some comments added.

--
Added file: http://bugs.python.org/file28672/posix_realpath_2.patch

___
Python tracker 

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



[issue1634034] Show "expected" token on syntax error

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

>  >>> dict(a = i for i in range(10))
> +SyntaxError: invalid syntax - ')' expected
>
> The () are ok, the message is misleading.

"dict(a = i)" is valid syntax, the compiler expects ")" instead of invalid 
"for".

> 'name' here is a bit vague.

The compiler actually expects a name (using Python terminology, see for example 
NameError). Of course you can propose an other name for "name" (this is just an 
entity in _PyParser_TokenDescs array).

>  >>> def f(x, None):
>  ... pass
> +SyntaxError: invalid syntax - ')' expected
>
>  >>> def f(*None):
>  ... pass
> +SyntaxError: invalid syntax - ')' expected
>
> Here the () are ok too.

The compiler means "def f(x,)" and "def f(*)", not "def f()" as you possible 
expects.

--

___
Python tracker 

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



[issue16919] Fix test discovery for test_crypt.py

2013-01-10 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> ezio.melotti
stage:  -> patch review

___
Python tracker 

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Serhiy, I see you assigned this to yourself - would you like to submit a 
> patch?

Not right now. This is low priority for me too. But I want to see this feature 
in 3.4.

--

___
Python tracker 

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



[issue16918] Fix test discovery for test_codecs.py

2013-01-10 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> ezio.melotti
stage:  -> patch review

___
Python tracker 

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



[issue1634034] Show "expected" token on syntax error

2013-01-10 Thread Ezio Melotti

Ezio Melotti added the comment:

I'm not saying that these errors are wrong -- just that they are misleading 
(i.e. they might lead the user on the wrong path, and make finding the actual 
problem more difficult).

It should be noted that the examples I pasted don't include a full traceback 
though.  The presence of the caret (^) in the right place will definitely make 
things clearer.

--

___
Python tracker 

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



[issue16920] multiprocessing.connection listener gets MemoryError on recv

2013-01-10 Thread John Brearley

New submission from John Brearley:

Using a multiprocessing.connection listener, I can accept an incoming socket 
OK, but when I do conn.recv(), I get memory error. The attached script 
mpl_bug.py will readily reproduce the issues on WinXP & WinVista, see sample 
output below:


c:\>python mpl_bug.py
main server listening on host  port 10500
main created simple_client 
simple_client connecting to host localhost port 10500
main conn:  waiting
for data
simple_client sending: b'abcd'
simple_client waiting for data
Traceback (most recent call last):
  File "mpl_bug.py", line 61, in 
data=conn.recv()   ;# Memory Error occurs here <<<==
==
  File "c:\python33\lib\multiprocessing\connection.py", line 251, in recv
buf = self._recv_bytes()
  File "c:\python33\lib\multiprocessing\connection.py", line 405, in _recv_bytes

return self._recv(size)
  File "c:\python33\lib\multiprocessing\connection.py", line 380, in _recv
chunk = read(handle, remaining)
MemoryError


--
files: mpl_bug.py
messages: 179577
nosy: jbrearley
priority: normal
severity: normal
status: open
title: multiprocessing.connection listener gets MemoryError on recv
versions: Python 3.3
Added file: http://bugs.python.org/file28673/mpl_bug.py

___
Python tracker 

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



[issue16920] multiprocessing.connection listener gets MemoryError on recv

2013-01-10 Thread John Brearley

Changes by John Brearley :


--
versions: +Python 3.2

___
Python tracker 

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



[issue16921] Docs of subprocess.CREATE_NEW_CONSOLE are wrong

2013-01-10 Thread Torsten Landschoff

New submission from Torsten Landschoff:

The documentation of CREATE_NEW_CONSOLE at 
http://docs.python.org/3/library/subprocess.html#subprocess.CREATE_NEW_CONSOLE 
states:

This flag is always set when Popen is created with shell=True.

This does not fit the code which does

if (_subprocess.GetVersion() >= 0x8000 or 
os.path.basename(comspec).lower() == "command.com"):
# Win9x, or using command.com on NT. We need to
creationflags |= _subprocess.CREATE_NEW_CONSOLE

So the statement is only true on very old versions on Windows. I suggest to fix 
the documentation (patch attached) or to remove that obsolete hack (and drop 
support for Windows <= NT).

--
components: Windows
files: create_new_console.diff
keywords: patch
messages: 179578
nosy: torsten
priority: normal
severity: normal
status: open
title: Docs of subprocess.CREATE_NEW_CONSOLE are wrong
versions: Python 3.5
Added file: http://bugs.python.org/file28674/create_new_console.diff

___
Python tracker 

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



[issue16920] multiprocessing.connection listener gets MemoryError on recv

2013-01-10 Thread John Brearley

John Brearley added the comment:

In V3.2.2.3, the conn.accept() was failing to resolve the socket address.

--

___
Python tracker 

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



[issue16922] ElementTree.findtext() returns empty bytes object instead of empty string

2013-01-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

>>> import xml.etree.cElementTree as ET
>>> ET.XML('').findtext('empty')
b''

--
components: XML
files: etree_finditer_empty.patch
keywords: patch
messages: 179580
nosy: eli.bendersky, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: ElementTree.findtext() returns empty bytes object instead of empty string
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file28675/etree_finditer_empty.patch

___
Python tracker 

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



[issue16922] ElementTree.findtext() returns empty bytes object instead of empty string

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I see yet one possible bug, using PyBytes_FromString() in list_join() on 3.2. 
But I can't demonstrate an example.

--

___
Python tracker 

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



[issue16902] Add OSS module support for Solaris

2013-01-10 Thread brian-cameron-oracle

brian-cameron-oracle added the comment:

Since Modules/ossaudiodev.c has the following line (which is not surrounded by 
any conditional #ifdef sort of things):

#include 

This means that the OSS plugin will only build on a system that has this header 
file, so it is safe to check for on any system.  How can the Module code build 
if the header can't be found?

The code will only compile if the CFLAGS used when building the
module is setup to include /usr/include or /usr/local/include, but
this is normally taken care of by default.

If users need to specify their OSS headers are in some weird 
non-standard location, then they can use CFLAGS or other Makefile mechanisms to 
specify the compiler arguments they would then need to build anything that uses 
their non-standard OSS.

Or am I just confused by your question?

--

___
Python tracker 

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



[issue8145] Documentation about sqlite3 isolation_level

2013-01-10 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2013-01-10 Thread R. David Murray

R. David Murray added the comment:

I believe that the complete list of test files still located outside of 
Lib/test are:

  tkinter/test
  distutils/tests
  ctypes/tests
  lib2to3/tests
  sqlite3/test
  unittest/test
  
That last is somewhat ironic since Michael opened the issue :).

I'm considering working on some of the uncommitted patches for sqlite3, so I 
may take on moving those tests.

--
components: +Tests
nosy: +asvetlov, benjamin.peterson
stage:  -> needs patch
type: behavior -> enhancement
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Some general notes. Nitpick: check foo() < 0 is more used than foo() == 0. An 
exception raised after failed close() can hide original exception raised 
before. I left more specific comments on Rietveld.

Only a small part of the proposed changes may be approved by me. About the 
majority of changes only the module maintainer can say how they are safe and 
how to do correctly (they looks too risky for me). Some of the changes are 
obviously wrong.

--

___
Python tracker 

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



[issue11205] Evaluation order of dictionary display is different from reference manual.

2013-01-10 Thread Guido van Rossum

Guido van Rossum added the comment:

I am sticking with my opinion from before: the code should be fixed.  It 
doesn't look like assignment to me.

I am fine with making this a "feature" only fixed in 3.4.  (You can even fix 
the docs in 3.3 as long as you fix them back for 3.4.)

Minor note for Ezio: dict(k=v, ...) doesn't have this problem because k is just 
a keyword, not an expression.

--

___
Python tracker 

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



[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Marek Šuppa

Marek Šuppa added the comment:

Thanks for the review.

Do you think I should split it into multiple patches to make it easier to look 
through?

It might be that some changes are completely wrong. This is the first time I 
did something with cpython core code.

--

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2013-01-10 Thread R. David Murray

R. David Murray added the comment:

Talked to Michael in IRC.  He isn't particularly in favor of the move of the 
unittest tests, but doesn't object if someone else wants to do it.  So, 
unassigning the issue from him.

--
assignee: michael.foord -> 

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2013-01-10 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

ctypes/tests is within my area of interests and may prove to be one of the 
harder pieces.  I'll try to move it and report the results.  I have not worked 
with the rest, so unless it is truly trivial this will have to wait for another 
volunteer.

--

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2013-01-10 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I honestly don't see the point of moving tests around.

--

___
Python tracker 

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



[issue16900] SSL sockets don't give resource warnings

2013-01-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Indeed, SSLSocket.__del__ doesn't seem to have a point.

--
nosy: +pitrou
stage:  -> needs patch

___
Python tracker 

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



[issue16886] Doctests in test_dictcomp depend on dict order

2013-01-10 Thread Frank Wierzbicki

Frank Wierzbicki added the comment:

Switched to unittest style away from doctests and created patch against 3.3. 
Note that at this time test_dictcomp.py is identical in 3.3 and 3.4 so merging 
should be pretty easy :)

--
Added file: http://bugs.python.org/file28676/dictcomp3.3.patch

___
Python tracker 

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



[issue16886] Doctests in test_dictcomp depend on dict order

2013-01-10 Thread Frank Wierzbicki

Frank Wierzbicki added the comment:

This patch of test_dict_comp.py was made against 2.7. It differs from the 3.3 
version only one line "from test import test_support as support"

--
Added file: http://bugs.python.org/file28677/dictcomp2.7.patch

___
Python tracker 

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



[issue16923] test_ssl kicks up a lot of ResourceWarnings

2013-01-10 Thread Benjamin Peterson

New submission from Benjamin Peterson:

Now #16900 is fixed, we get gunk like this:

 $ ./python -Wall Lib/test/regrtest.py -uall test_ssl
[1/1] test_ssl
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
/home/benjamin/dev/python/3.3/Lib/test/test_ssl.py:211: ResourceWarning: 
unclosed 
  del ss
/home/benjamin/dev/python/3.3/Lib/test/test_ssl.py:232: ResourceWarning: 
unclosed 
  ss = ssl.wrap_socket(s)
/home/benjamin/dev/python/3.3/Lib/test/test_ssl.py:232: ResourceWarning: 
unclosed 
  ss = ssl.wrap_socket(s)
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
/home/benjamin/dev/python/3.3/Lib/test/test_ssl.py:374: ResourceWarning: 
unclosed 
  ss = ssl.wrap_socket(s, server_side=True, certfile=CERTFILE)
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
/home/benjamin/dev/python/3.3/Lib/test/test_ssl.py:874: ResourceWarning: 
unclosed 
  cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT")
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
Resource 'ipv6.google.com' is not available
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
/home/benjamin/dev/python/3.3/Lib/unittest/case.py:385: ResourceWarning: 
unclosed 
  function()
1 test OK.


This should be fixed.

--
keywords: easy
messages: 179594
nosy: benjamin.peterson
priority: normal
severity: normal
stage: needs patch
status: open
title: test_ssl kicks up a lot of ResourceWarnings
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue16900] SSL sockets don't give resource warnings

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c8105251cc1f by Benjamin Peterson in branch '3.3':
remove __del__ because it's evil and also prevents the ResourceWarning on the 
socket from happening (closes #16900)
http://hg.python.org/cpython/rev/c8105251cc1f

New changeset e23d51f17cce by Benjamin Peterson in branch 'default':
merge 3.3 (#16900)
http://hg.python.org/cpython/rev/e23d51f17cce

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Well, here is a patch which add short_empty_elements flag (as for XMLGenerator) 
to write(), tostring() and tostringlist() methods of ElementTree.

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2013-01-10 Thread Brett Cannon

Brett Cannon added the comment:

Two reasons for collecting all of the tests in a single location:

1) Facilitates test discovery
2) It makes packaging of CPython easier for Linux distros that prefer to leave 
the tests out of the core package

--

___
Python tracker 

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



[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, I forgot press "Push All My Drafts" button.

Actually only patch for _cursesmodule.c looks safe at first glance (but curses 
maintainer can decide better). You can split the patch on several patches, but 
be very careful. You should research the entire module to understand to what 
effects the changes will lead and what changes should be. I would not recommend 
this task for beginners.

--
keywords:  -easy

___
Python tracker 

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file28678/etree_short_empty_elements.patch

___
Python tracker 

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



[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Marek Šuppa

Marek Šuppa added the comment:

That is probably right.

I was way too foolish to start with this but won't stop now.

I'll try to iterate on your feedback.

Thanks!

--

___
Python tracker 

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



[issue16715] Get rid of IOError. Use OSError instead

2013-01-10 Thread py.user

py.user added the comment:

Andrew Svetlov wrote:
> LoadError is inherited from OSError

the comment for the function doesn't tell it
today it's inherited from OSError and tomorrow it may inherit from ANYError

--

___
Python tracker 

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-10 Thread Sven Brauch

Sven Brauch added the comment:

Here's another version now which I think could be used like this. All tests 
have been adjusted. I'll append two patches, one just containing the changes to 
the parser for ease of review, and one full diff which also contains changes to 
the generated files and the test adjustments.

Please point out any remaining problems you see with this so I can fix them.

--
Added file: http://bugs.python.org/file28679/readable.diff

___
Python tracker 

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-10 Thread Sven Brauch

Sven Brauch added the comment:

Attached is the full diff this time.

--
Added file: http://bugs.python.org/file28680/full.diff

___
Python tracker 

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



[issue16923] test_ssl kicks up a lot of ResourceWarnings

2013-01-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou

___
Python tracker 

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



[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread STINNER Victor

STINNER Victor added the comment:

./Python/traceback.c:write(fd, &c, 1);
./Python/traceback.c:write(fd, "\"", 1);
./Python/traceback.c:write(fd, "\"", 1);
./Python/traceback.c:write(fd, "\n", 1);
./Python/traceback.c:write(fd, "\n", 1);

Oh, I wrote these ones. It is code called by the faulthandle module, from a 
signal handler. So only async-safe functions can be called (no thread, no 
memory allocation, no lock!, etc.).

A simple fix would be to mark that we don't care if write() fails, but 
(void)write(fd, ...); doesn't make the warning quiet.

--
nosy: +haypo

___
Python tracker 

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



[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread STINNER Victor

STINNER Victor added the comment:

diff -r 0acc5626a578 Modules/faulthandler.c
@@ -445,7 +445,10 @@
-write(thread.fd, thread.header, thread.header_len);
+if (write(thread.fd, thread.header, thread.header_len) == -1) {
+PyErr_SetFromErrno(PyExc_IOError);
+return; 
+}
 
I wrote faulthandler to debug deadlocks, memory corruptions and other cases 
where Python internals are no consistency anymore.

faulthandler_thread() is not a Python thread, but a C thread. I don't know if 
it's legal to call PyErr_SetFromErrno(). And it would be really surprising to 
get a Python exception whereas it does not come from Python code.

I would prefer to just ignore if write() failed here.

--

___
Python tracker 

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-10 Thread Sven Brauch

Sven Brauch added the comment:

The patch review tool currently throws errors on submitting any form 
(http://pastie.org/pastes/5665048/text) so please forgive me for answering here 
once more. I'll copy this information (patch + message) to the review as soon 
as the website is working again.

> In ast.c, use the LINENO macro for n_lineno.
Done.

> http://bugs.python.org/review/16795/diff/7080/Lib/test/test_ast.py#newcode183
> Lib/test/test_ast.py:183: def _assertTrueorder(self, ast_node,
parent_pos, reverse_check = False):
> Wrap everything here by 80 chars.
Done.

> http://bugs.python.org/review/16795/diff/7080/Lib/test/test_ast.py#newcode198
> Lib/test/test_ast.py:198: self.assertTrue(node_pos <= parent_pos if
> reverse_check else node_pos >= parent_pos)
> Lift the condition out of the assert call.
Done.

> http://bugs.python.org/review/16795/diff/7080/Lib/test/test_ast.py#newcode467
> Lib/test/test_ast.py:467: self.maxDiff = None
> A comment explaining what this is for would be nice.
Sorry, this was for testing purposes only, and I forgot to remove it.

> http://bugs.python.org/review/16795/diff/7080/Lib/test/test_ast.py#newcode589
> Lib/test/test_ast.py:589: 0, 0, 0, 0)
> These extra parameters are optional now, right? They needn't be passed
> then.
Unfortunately not: Altough the question mark in the asdl file is present and I 
made fairly sure to regenerate all the derived files, the parameters are still 
mandatory.

URL of the patch review: http://bugs.python.org/review/16795/

--
Added file: http://bugs.python.org/file28681/full2.diff

___
Python tracker 

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-10 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Could you post an example of the error, please?

--

___
Python tracker 

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-10 Thread Sven Brauch

Sven Brauch added the comment:

The above post has an example for trying to add a patch, here's what happens 
when I try to post a reply: http://pastie.org/pastes/5665144/text
I also tried with another web browser, so it's unlikely that it's the browser's 
fault (but maybe the user's? ;)

--

___
Python tracker 

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-10 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Ah, sorry, I was talking about the failure of optional arguments.

--

___
Python tracker 

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



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-01-10 Thread Sven Brauch

Sven Brauch added the comment:

Ah, whops, I misunderstood that.

The error is rather generic:
Traceback (most recent call last):
  File "./Lib/test/test_ast.py", line 796, in test_lambda
self._check_arguments(fac, self.expr)
  File "./Lib/test/test_ast.py", line 596, in _check_arguments
check(arguments(args=args), "must have Load context")
  File "./Lib/test/test_ast.py", line 593, in arguments
kwarg, kwargannotation, defaults, kw_defaults)
TypeError: arguments constructor takes either 0 or 12 positional arguments

It's very generic in C too:
Python/ast.c:1571:42: error: macro "arguments" requires 13 arguments, but only 
9 given

--

___
Python tracker 

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



[issue16899] Add support for C99 complex type (_Complex) as ctypes.c_complex

2013-01-10 Thread Vladimir Rutsky

Vladimir Rutsky added the comment:

Yes, I managed to pass and operate with matrices of complex numbers to pure C 
and Fortran programs by using Numpy and their ctype adapters (only for whole 
matrices, they don't provide c_complex type; in general see 
http://www.scipy.org/Cookbook/Ctypes for details).

I suppose pure python solution that suggested in provided by you link works too:

class Complex64(Structure):
_fields_ = [("real", c_float), ("imag", c_float)]

But I'm unsure is this is expected behavior or luck, and on some platform this 
code will not work due to different complex numbers internal representation.

Any way this should be implemented in libffi first, and then in ctypes, so this 
feature request should be postponed, IMO.

--

___
Python tracker 

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



[issue16920] multiprocessing.connection listener gets MemoryError on recv

2013-01-10 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Why are you connecting to a multiprocessing listener with a raw socket?  You 
should be using multiprocessing.connection.Client to create a client connection.

Connection.send(obj) writes a 32 bit unsigned int (in network order) to the 
socket representing the length of the pickled data for obj, followed by the 
pickled data itself.

Since you are doing a raw socket write, the server connection is 
misenterpreting the first 4 bytes of your message "abcd" as the length of the 
message.  So the receiving end needs to allocate space for

struct.unpack("!I", "abcd")[0] == 1633837924 ~ 1.5Gb

causing the MemoryError.

--
nosy: +sbt
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue13934] sqlite3 test typo

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b8b26feb3e1a by R David Murray in branch '3.2':
#13934: document sqlite version strings, use correct one in test.
http://hg.python.org/cpython/rev/b8b26feb3e1a

New changeset cdf9142a0c84 by R David Murray in branch '3.3':
merge #13934: document sqlite version strings, use correct one in test.
http://hg.python.org/cpython/rev/cdf9142a0c84

New changeset aef7db0d3893 by R David Murray in branch 'default':
merge #13934: document sqlite version strings, use correct one in test.
http://hg.python.org/cpython/rev/aef7db0d3893

New changeset 315949b1842e by R David Murray in branch '2.7':
#13934: document sqlite version strings.
http://hg.python.org/cpython/rev/315949b1842e

--
nosy: +python-dev

___
Python tracker 

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



[issue13934] sqlite3 test typo

2013-01-10 Thread R. David Murray

R. David Murray added the comment:

These patches are small enough a contributor agreement is not required, but it 
would still be great if you would submit one, poq.

--
nosy: +r.david.murray
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16924] try: except: ordering error

2013-01-10 Thread Justin Eittreim

New submission from Justin Eittreim:

When running multiple nested loops (to emulate the circumstances of a program 
running multiple different modules at once,) each with their own try: except: 
block (in this case for KeyboardInterrupt,) the order of operations seems to 
fall out of place. As you can see in the screenshot, even though the inner-most 
loop should never have been left (or ended for that matter,) the parent loop 
catches the exception in its place on occasion. While this isn't necessarily a 
huge issue, for certain things it can be rather annoying and downright 
confusing. For most all other languages, for example, the inner-most loop 
would, of course, catch the exception first.

Requesting more insight on this issue.

--
components: None
files: 2013-01-10 17_55_13-Python Shell.png
messages: 179613
nosy: DivinityArcane
priority: normal
severity: normal
status: open
title: try: except: ordering error
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file28682/2013-01-10 17_55_13-Python 
Shell.png

___
Python tracker 

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



[issue15109] sqlite3.Connection.iterdump() dies with encoding exception

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2a417ad8bfbf by R David Murray in branch '2.7':
#15109: revert '%'->'format' changes in 4b105d328fe7 to fix regression.
http://hg.python.org/cpython/rev/2a417ad8bfbf

--
nosy: +python-dev

___
Python tracker 

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



[issue15109] sqlite3.Connection.iterdump() dies with encoding exception

2013-01-10 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16893] Create IDLE help.txt from Doc/library/idle.rst

2013-01-10 Thread Todd Rovito

Todd Rovito added the comment:

I think getting this issue fixed makes sense, it would save time and remove 
duplication.

--

___
Python tracker 

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



  1   2   >