[issue18989] reuse of enum names in class creation inconsistent

2013-09-14 Thread Georg Brandl

Georg Brandl added the comment:

It can be changed up to beta1, with good reasons of course. Many PEPs are 
actually out of date with respect to the actual implementation in minor points.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue18989] reuse of enum names in class creation inconsistent

2013-09-14 Thread Georg Brandl

Georg Brandl added the comment:

That said, for a PEP that has seen so much discussion before being accepted, 
the agreed-on API should not be changed lightly.

--

___
Python tracker 

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



[issue18968] Find a way to detect incorrectly skipped tests

2013-09-14 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +xdegaye

___
Python tracker 

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



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2013-09-14 Thread Georg Brandl

Georg Brandl added the comment:

Should be fixed now in 3.2 too.

--
status: open -> closed

___
Python tracker 

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



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2013-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c18c18774e24 by Georg Brandl in branch '3.2':
Fix tkinter regression introduced by the security fix in #16248.
http://hg.python.org/cpython/rev/c18c18774e24

--

___
Python tracker 

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



[issue18993] There is an overshadowed and invalid test in testmock.py

2013-09-14 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The duplicate_code_names.py script in issue 16079 did find that there
are duplicate test_attribute_deletion tests in testmock.py (see
http://bugs.python.org/file27376/std_lib_duplicates.txt).

--
nosy: +xdegaye

___
Python tracker 

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



[issue18907] urllib2.open FTP open times out at 20 secs despite timeout parameter

2013-09-14 Thread Charles-François Natali

Changes by Charles-François Natali :


--
status: open -> pending

___
Python tracker 

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



[issue18709] SSL module fails to handle NULL bytes inside subjectAltNames general names (CVE-2013-4238)

2013-09-14 Thread Georg Brandl

Georg Brandl added the comment:

Christian, is the -py32 patch still up to date?

--
nosy: +larry
priority: critical -> release blocker

___
Python tracker 

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



[issue16201] socket.gethostbyname incorrectly parses ip

2013-09-14 Thread Charles-François Natali

Charles-François Natali added the comment:

Alright, I committed it to default.

I don't think it should go into 2.7 or 3.3, since it's more an
enhancement than a bug fix.

--

___
Python tracker 

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



[issue18825] Making msg optional on logging.exception() and similar variants

2013-09-14 Thread Vinay Sajip

Changes by Vinay Sajip :


--
status: pending -> closed

___
Python tracker 

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



[issue18824] Adding LogRecord attribute "traceback"

2013-09-14 Thread Vinay Sajip

Vinay Sajip added the comment:

basicConfig() is for simple usage only. You can use a custom Formatter subclass 
to meet your specific requirements.

--
nosy: +vinay.sajip
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue18993] There is an overshadowed and invalid test in testmock.py

2013-09-14 Thread Michael Foord

Michael Foord added the comment:

On balance I think that this test failing is *correct* (after deleting an 
attribute the old mock should *not* come back). I'd rather adjust the test to 
assert this than just remove it though.

--

___
Python tracker 

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



[issue18993] There is an overshadowed and invalid test in testmock.py

2013-09-14 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Michael, attached the patch to accommodate your request. Yeah, I think this is 
the best way because I have seen no possible solutions to make both tests work 
without altering them.

Xavier, that's cool. I didn't know such tool exists. Usually I found the 
duplicate function/method by using flake plugin in Vim.

--
Added file: 
http://bugs.python.org/file31754/fix_overshadowed_test_in_testmock.patch

___
Python tracker 

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



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2013-09-14 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Fix still needs to be applied on 3.1 branch.

--
priority: deferred blocker -> release blocker
status: closed -> open
versions: +Python 3.1 -Python 3.2

___
Python tracker 

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



[issue19016] autospecced namedtuples should be truthy by default

2013-09-14 Thread Shawn Krisman

New submission from Shawn Krisman:

import mock
from collections import namedtuple

Foo = namedtuple('Foo', bar)
mock_foo = mock.create_autospec(Foo)

if mock_foo:
print('the namedtuple is truthy')
else:
print('the namedtuple is not truthy')


The expected behavior is that it should print "the namedtuple is truthy." 
Instead it prints "the namedtuple is not truthy." Almost all namedtuples are 
truthy, the exception being the nearly useless namedtuple with 0 fields. The 
problem stems from the fact that tuples have a __len__ defined which is what is 
used derive truthiness. MagicMocks define __len__ to be zero by default. 
Workarounds to the problem are very difficult because you cannot simply define 
__len__ to be a nonzero number and have the mock work correctly. 


In general MagicMock has defaults that encourage the mocks to be very truthy 
all around:

__bool__ -- True
__int__ -- 1
__complex__ -- 1j
__float__ -- 1.0
__index__ -- 1

So it was interesting to me to find out that __len__ was defined to be 0. The 
fix that I am proposing is to make 1 the new default for __len__. I believe 
this is a more useful default in general because an instance of a class with a 
__len__ attribute will likely be truthy far more often then not.


There are of course backwards compatibility issues to consider here, however I 
don't think many people are assuming this behavior. Certainly nobody in the 
python code base.

--
components: Library (Lib)
files: namedtuple_truthiness.patch
keywords: patch
messages: 197698
nosy: michael.foord, skrisman
priority: normal
severity: normal
status: open
title: autospecced namedtuples should be truthy by default
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file31755/namedtuple_truthiness.patch

___
Python tracker 

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



[issue18989] reuse of enum names in class creation inconsistent

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le samedi 14 septembre 2013 à 07:03 +, Georg Brandl a écrit :
> Georg Brandl added the comment:
> 
> That said, for a PEP that has seen so much discussion before being
> accepted, the agreed-on API should not be changed lightly.

I agree with that.
Also, I think it was argued that Enums are by design "restricted"
classes in that they forbid certain things in the name of convenience
and expectability. I think it is a reasonable design point and, as such,
Enums needn't be as flexible and versatile as normal classes.

--

___
Python tracker 

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



[issue1602] windows console doesn't print or input Unicode

2013-09-14 Thread Drekin

Drekin added the comment:

Hello again. I have rewritten the custom stdio objects and implemented them as 
raw io reading and writing bytes in UTF-16-LE encoding. They are then wrapped 
in standard BufferedReader/Writer and TextIOWrapper objects. This approach also 
solves a bug of wrong string length given to WriteConsoleW when the string 
contained supplementary character. Since we are waiting for Ctrl-C signal to 
arrive, this implmentation doesn't suffer from 
http://bugs.python.org/issue18597 . It seems to work when main script is 
executed however it doesn't work in Python interactive REPL since the REPL 
doesn't use sys.stdin for input. However it uses its encoding which results in 
mess when sys.stdin is changed to object with different encoding like 
UTF-16-LE. See http://bugs.python.org/issue17620 .

--
Added file: http://bugs.python.org/file31756/streams.py

___
Python tracker 

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



[issue19017] selectors: towards uniform EBADF handling

2013-09-14 Thread Charles-François Natali

New submission from Charles-François Natali:

Currently, in case of invalid file descriptor (which can happen easily e.g. if 
the user closes the FD before unregistering it), selector.select() will react 
differently depending on the backend:

SelectSelector fails with EBADF
PollSelector returns EVENT_READ/EVENT_WRITE for the FD (translated from 
poll()'s POLLNVAL)
EpollSelector returns nothing (epoll silently removes the FD from the set of 
monitored FD, there's no EPOLLNVAL)
KqueueSelector behaves like EpollSelector

One possibility would be for PollSelector.select() to raise EBADF in case of 
POLLNVAL. That would be consistent with select, but not with epoll and kqueue.

Another possibility would be to silently fix those, i.e. in case of 
EBADF/POLLNVAL in select/poll, remove the offending FD from the list of 
monitored FDs. That's what libev does (see e.g. 
http://cvs.schmorp.de/libev/ev_poll.c?revision=1.39&view=markup and 
http://cvs.schmorp.de/libev/ev.c?revision=1.457&view=markup), and that's also 
what twisted does, at least for select (see 
http://twistedmatrix.com/trac/browser/trunk/twisted/internet/selectreactor.py#L77).

One advantage is that once we've detected a bad FD, we remove it so we're sure 
we won't loop endlessly: e.g. for poll, if the user doesn't try to use the FD 
no exception will be raised and selector.select() keep reporting the FD ready.

(Note that performing this cleanup is easy for poll since it's flagged with 
POLLNVAL, but for select this requires looping over the registered FDs, but 
since that's only called in case of error, it's not performance critical, see 
Twisted's code)

I personally favor the later solution.

Second point: if we opt for the later solution, we should probably update 
{EpollSelector,KqueueSelector}.unregister() to silently catch an error if the 
FD wasn't registered in the underlying epoll/kqueue.
That's what libev does, and amusingly that's what the select module already 
does:
http://hg.python.org/cpython/file/c9644c1f9c94/Modules/selectmodule.c#l1329

Third point: should the current select behavior (ignoring epoll.unregister() 
error) be kept?

Thoughts?

--
messages: 197701
nosy: giampaolo.rodola, gvanrossum, haypo, neologix, pitrou, sbt
priority: normal
severity: normal
stage: needs patch
status: open
title: selectors: towards uniform EBADF handling
type: enhancement

___
Python tracker 

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



[issue19017] selectors: towards uniform EBADF handling

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Another possibility would be to silently fix those, i.e. in case of
> EBADF/POLLNVAL in select/poll, remove the offending FD from the list of
> monitored FDs.

Or we could remove the fd *and* still raise an error the first time, or at 
least a warning. It sounds like a programming error, so I'm not sure it's a 
good idea to silence it.

Note that Twisted still logs an error message. Also, Tornado lets errors 
through:
https://github.com/facebook/tornado/blob/master/tornado/ioloop.py#L652
https://github.com/facebook/tornado/blob/master/tornado/platform/select.py#L61

--
nosy: +glyph

___
Python tracker 

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



[issue19017] selectors: towards uniform EBADF handling

2013-09-14 Thread Charles-François Natali

Charles-François Natali added the comment:

> Or we could remove the fd *and* still raise an error the first time, or at 
> least a warning. It sounds like a programming error, so I'm not sure it's a 
> good idea to silence it.

Yeah, sure. By "silently" I meant "without user intervention", sorry
for the confusion.

Now I'm not sure between raising an error or just logging it.

--

___
Python tracker 

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



[issue19017] selectors: towards uniform EBADF handling

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Now I'm not sure between raising an error or just logging it.

If "logged", it should be a Warning rather than an actual logging call,
IMO.

--

___
Python tracker 

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



[issue16201] socket.gethostbyname incorrectly parses ip

2013-09-14 Thread Charles-François Natali

Charles-François Natali added the comment:

Closing, thanks for the report!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions:  -Python 2.7, Python 3.3

___
Python tracker 

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



[issue13758] compile() should not encode 'filename' (at least on Windows)

2013-09-14 Thread Drekin

Drekin added the comment:

Since this issue was fixed, shouldn't it be marked fixed here?

--

___
Python tracker 

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



[issue18989] reuse of enum names in class creation inconsistent

2013-09-14 Thread Eli Bendersky

Eli Bendersky added the comment:

On Fri, Sep 13, 2013 at 7:11 PM, Nick Coghlan wrote:

>
> Nick Coghlan added the comment:
>
> +1 from me to just allow the names to be overwritten, even by another enum
> member.
>

Even though I was in favor of this in the initial discussions (obviously,
as I'm generally in favor of Enum being less magic and special) and had to
agree with the consensus, I think it's too late now - unless we want to
reopen the pandora box. Otherwise, it would not be fair, IMHO. In the
original discussions a lot of people gave their opinions and had the
context to chime in - now changing this "quietly" in the bug tracker with
only a handful of participants isn't appropriate.

The current behavior is fine, I think. The vast majority of enums will not
have methods, and some amount of safety against typos in member definitions
makes sense. Methods have other rules anyway (such as being definable in
subclasses), and since their uses are rarer and arguably more deliberate,
leaving them with more a Pythonic nature should be fine. This behavior is
documented in the PEP and documentation and is fairly well understood.
Also, we can always lift restrictions later without breaking existing code,
if it's deemed that some restrictions are too much.

--

___
Python tracker 

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



[issue18059] Add multibyte encoding support to pyexpat

2013-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

1) Expat itself responsible for this guard. It has all necessary information 
and provides an input of required size for custom converter.

2) Yes, this is a problem. I'm working on another approach, when full encoding 
table built at first request for the encoding (and than cache it). It makes 
decoding individual characters fast, but requires about 0.5 sec for 
initialization. Is such approach more suitable?

--

___
Python tracker 

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



[issue18709] SSL module fails to handle NULL bytes inside subjectAltNames general names (CVE-2013-4238)

2013-09-14 Thread Charles-François Natali

Changes by Charles-François Natali :


--
nosy:  -neologix

___
Python tracker 

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



[issue13758] compile() should not encode 'filename' (at least on Windows)

2013-09-14 Thread STINNER Victor

STINNER Victor added the comment:

Closed.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note: I haven't renamed transformdict to TransformDict yet.

--

___
Python tracker 

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Updated patch adding the getitem() method.

--
Added file: http://bugs.python.org/file31757/transformdict2.patch

___
Python tracker 

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



[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I'd rather not propagate more options all the way through, especially 
> as this is some thing that should be decided by the test framework and 
> is unlikely to be something you want to turn on and off per test run
> (which is what command line options are for). Frameworks that want to 
> disable this behaviour should use a TestSuite that overrides
> _removeAtIndex.

That sounds like a completely disproportionate solution. Why would you have to 
override the TestSuite class just to change an option and restore old 
behaviour? Why don't you simply expose the cleanup flag on TestSuite instances?

--
status: closed -> open

___
Python tracker 

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



[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

For the record, this change broke the --forever option in Tulip's test script, 
which is why I'm caring. Setting the _cleanup flag to False seems to restore 
old behaviour, except that _cleanup is (obviously) a private API.

--

___
Python tracker 

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



[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note: ideally, the --forever flag wouldn't reuse TestCase instances but rather 
create new ones.

--

___
Python tracker 

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



[issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode()

2013-09-14 Thread R. David Murray

R. David Murray added the comment:

As I said, not exactly any of the above.

I'll get back to this after I finish the new email code (which should happen 
before the end of the month).  I need to take some time to look over the RFCs 
and real world examples and come up with the most appropriate rules.

--

___
Python tracker 

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



[issue19012] liburl2: bad proxy configuration throws "getaddrinfo" error

2013-09-14 Thread R. David Murray

R. David Murray added the comment:

The getaddrinfo error message should *not* refer to proxies, because 
getaddrinfo does not do anything involving proxy configuration.  

Presumably the error occurred when liburl2 tried to resolve the proxy.  So, it 
is liburl2 that needs to make sure that error is placed in a comprehensible 
context.  liburl2 is not an stdlib module.  You should report your problem to 
the liburl2 maintainers.

--
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
versions: +3rd party -Python 2.7

___
Python tracker 

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



[issue18989] reuse of enum names in class creation inconsistent

2013-09-14 Thread Nick Coghlan

Nick Coghlan added the comment:

OK, rechecking PEP 435, I see that disallowing reuse of a name was indeed 
explicitly accepted as part of the defined API: 
http://www.python.org/dev/peps/pep-0435/#duplicating-enum-members-and-values

In that case, I switch my perspective to agree with Ethan that overwriting it 
with a method or descriptor should *also* be disallowed. The PEP is currently 
silent on that question, and as Ethan notes in the original post, the weird 
middle ground of the current behaviour is thoroughly confusing:

>>> class Disallowed(Enum):
... a = 1
... a = 2
... 
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in Disallowed
  File "/home/ncoghlan/devel/py3k/Lib/enum.py", line 87, in __setitem__
raise TypeError('Attempted to reuse key: %r' % key)
TypeError: Attempted to reuse key: 'a'


>>> class Allowed(Enum):
... a = 1
... @property
... def a(self):
... return 2
... 
>>> Allowed.a

>>> Allowed().a
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __call__() missing 1 required positional argument: 'value'
>>> Allowed(1).a
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/ncoghlan/devel/py3k/Lib/enum.py", line 218, in __call__
return cls.__new__(cls, value)
  File "/home/ncoghlan/devel/py3k/Lib/enum.py", line 439, in __new__
raise ValueError("%s is not a valid %s" % (value, cls.__name__))
ValueError: 1 is not a valid Allowed
>>> Allowed('a').a
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/ncoghlan/devel/py3k/Lib/enum.py", line 218, in __call__
return cls.__new__(cls, value)
  File "/home/ncoghlan/devel/py3k/Lib/enum.py", line 439, in __new__
raise ValueError("%s is not a valid %s" % (value, cls.__name__))
ValueError: a is not a valid Allowed
>>> Allowed['a'].a
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/ncoghlan/devel/py3k/Lib/enum.py", line 255, in __getitem__
return cls._member_map_[name]
KeyError: 'a'

--

___
Python tracker 

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



[issue19017] selectors: towards uniform EBADF handling

2013-09-14 Thread STINNER Victor

STINNER Victor added the comment:

Would it be possible to emit an event "invalid fd" with the fd? So the user
can decide what to do on such case: ignore, log, raise an exception, ...

--

___
Python tracker 

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



[issue18907] urllib2.open FTP open times out at 20 secs despite timeout parameter

2013-09-14 Thread John Nagle

John Nagle added the comment:

The server operator at the US Securities and Exchange Commission writes to me: 
"There was a DNS issue that affected the availability of FTP at night. We 
believe it is resolved. Please let us know if you encounter any further 
problems.  Thanks, SEC Webmaster".

So this may have been a DNS related issue, perhaps a load balancer referring 
the connection to a dead machine.  Yet, for some reason, the Windows command 
line FTP client can recover from this problem after 20 seconds? What are they 
doing right? Completely retrying the open?

--
status: pending -> open

___
Python tracker 

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



[issue18206] The license url in site.py should always use X.Y.Z form of version number

2013-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7c18b799841e by R David Murray in branch '3.3':
#18206: Fix test for existence of license URL.
http://hg.python.org/cpython/rev/7c18b799841e

New changeset 321c3c9cd1b5 by R David Murray in branch 'default':
Merge #18206: Fix test for existence of license URL.
http://hg.python.org/cpython/rev/321c3c9cd1b5

New changeset 9354325d2ee4 by R David Murray in branch 'default':
#18206: Re-fix license URL.
http://hg.python.org/cpython/rev/9354325d2ee4

--

___
Python tracker 

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



[issue18206] The license url in site.py should always use X.Y.Z form of version number

2013-09-14 Thread R. David Murray

R. David Murray added the comment:

You are right, there was a further typo in the 3.4 URL that I missed.

Yes, requires_resource('network') is what I was referring to (though using 
transient_internet is also a very good idea :).  I also changed the urllib call 
to only do a HEAD request.  No need to rename the LICENSE file, I just pulled 
the info out of the data structure.  It's a white box test, but then so is 
parsing the "See" line at all, so I think it is acceptable.

(I wonder if it would be worthwhile to have transient_internet call 
requires_resource('network')?)

--
status: open -> closed

___
Python tracker 

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



[issue18937] add unittest assertion for logging

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

David told me he was in favour of keeping INFO the default, so I'll leave it 
like that.

--

___
Python tracker 

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



[issue18937] add unittest assertion for logging

2013-09-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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

___
Python tracker 

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



[issue18937] add unittest assertion for logging

2013-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f5815747f58 by Antoine Pitrou in branch 'default':
Issue #18937: Add an assertLogs() context manager to unittest.TestCase to 
ensure that a block of code emits a message using the logging module.
http://hg.python.org/cpython/rev/4f5815747f58

--
nosy: +python-dev

___
Python tracker 

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



[issue18206] The license url in site.py should always use X.Y.Z form of version number

2013-09-14 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for making these changes (and correcting some of my mistakes), RDM.
They are much better now.

On Sat, Sep 14, 2013 at 10:38 AM, R. David Murray wrote:

>
> R. David Murray added the comment:
>
> You are right, there was a further typo in the 3.4 URL that I missed.
>
> Yes, requires_resource('network') is what I was referring to (though using
> transient_internet is also a very good idea :).  I also changed the urllib
> call to only do a HEAD request.  No need to rename the LICENSE file, I just
> pulled the info out of the data structure.  It's a white box test, but then
> so is parsing the "See" line at all, so I think it is acceptable.
>
> (I wonder if it would be worthwhile to have transient_internet call
> requires_resource('network')?)
>
> --
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue18059] Add multibyte encoding support to pyexpat

2013-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a totally rewritten patch, which builds decoding table at first request 
for encoding and save it in the cache. Decoding should be very fast.

Do you have large testing XML files with multibyte encodings? Could you please 
measure the time of parsing this files and for comparision the time of parsing 
this files encoded with utf-8 and utf-16?

--
Added file: http://bugs.python.org/file31758/pyexpat_multibyte_encodings.patch

___
Python tracker 

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



[issue18059] Add multibyte encoding support to pyexpat

2013-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file31758/pyexpat_multibyte_encodings.patch

___
Python tracker 

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



[issue18059] Add multibyte encoding support to pyexpat

2013-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file31759/pyexpat_multibyte_encodings_5.patch

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Artem Fokin

New submission from Artem Fokin:

Suppose we have the following code:

from heapq import merge

def iterable():
lst = range(10)
for i in xrange(20):
yield lst[i]

it1, it2= iterable(), iterable()

print list(merge(it1, it2)) # no IndexError
#output is: [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9]


The reason is that in heapq.merge 
http://hg.python.org/cpython/file/7c18b799841e/Lib/heapq.py#l372 try-catch 
clause for IndexError is too broad

while 1:
try:
while 1:
v, itnum, next = s = h[0]   # raises IndexError when h is empty
yield v
s[0] = next()   # raises StopIteration when 
exhausted, 
_heapreplace(h, s)  # restore heap condition
except _StopIteration:
_heappop(h) # remove empty iterator
except IndexError:
return

s[0] = next() also may raise different kinds of exceptions including IndexError 
which will be silently suppressed. 
For example, this loop can be rewritten as

while 1:
try:
while 1:
try:
v, itnum, next = s = h[0]   # raises IndexError when h is 
empty
except IndexError:
return
yield v
s[0] = next()   # raises StopIteration when 
exhausted, 
_heapreplace(h, s)  # restore heap condition
except _StopIteration:
_heappop(h) # remove empty iterator

--
components: Library (Lib)
messages: 197726
nosy: afn
priority: normal
severity: normal
status: open
title: Heapq.merge suppreses IndexError from user generator
type: behavior
versions: 3rd party, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 
3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-14 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't object to adding the tests.

--

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Artem Fokin

Changes by Artem Fokin :


--
versions:  -3rd party, Python 2.6, Python 3.4, Python 3.5

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Artem Fokin

Artem Fokin added the comment:

Oh, it seems that in current cpython branch this problem is fixed by checking 
condition _len(h) > 1:
http://hg.python.org/cpython/file/1dc925ee441a/Lib/heapq.py#l373
But is it possible to fix it for the previous branches?

--

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +rhettinger, stutzbach

___
Python tracker 

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



[issue19019] Investigate using Apple clang for building OS X installers

2013-09-14 Thread Ned Deily

New submission from Ned Deily:

On the python-dev mailing list, Raymond Hettinger asks:
> I was exercising the alpha two release of 3.4 and noticed that
> it is still being built under GCC 4.2.1.  
> 
> Is there any reason we have to use an old compiler?

Yes, kinda.  It's because the 64-bit/32-bit installer we supply is designed to 
run on multiple versions of OS X: 10.6 (Snow Leopard), 10.7, 10.8, and the 
upcoming 10.9.  The safest way to ensure that the bits produced (executables, 
shared libs, and .so bundles) are linked with compatible versions of system 
shared libraries and frameworks is to build on the lowest supported system, 
10.6, or - carefully - with a 10.6 SDK on a newer system.  The standard 
compiler in the Apple Developer Tools for 10.6 is gcc 4.2.  The most recent 
Developer Tools for 10.8 and 10.7 systems, Xcode 4.6.x, have a mature clang but 
do not provide a 10.6 SDK.  Even with using an SDK, it's still possible to end 
up inadvertently linking with the wrong versions of system libraries.  We have 
been burned by that in the past.

> I would like to see it built under the latest version of Clang
> (like the other tools on the Mac) or under GCC 4.8.1.
> I've better using the latter for many months.  It works great
> and produces *much* better code (in terms of readability
> for those of us who look at assembly output and in terms
> of speed (approx 20-25% better for cpu bound code)).
> 
> I'm wondering whether is some issue that forces us to use
> GCC 4.2.1 or whether that is just an artifact of continuing
> to do what we've always been doing.

I'd like to move to Apple's latest clang, as well.  (Apple is dropping gcc 
totally from the next release of Xcode.)  There are a couple of approaches that 
may work and still reliably support multiple versions of OS X.  Investigating 
this is on my list of things to do prior to the next alpha.

--
assignee: ned.deily
components: Build, Macintosh
messages: 197729
nosy: ned.deily
priority: normal
severity: normal
stage: needs patch
status: open
title: Investigate using Apple clang for building OS X installers
versions: Python 3.4

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread R. David Murray

R. David Murray added the comment:

It was checked in as an optimization, but if it fixes a bug I don't see why it 
couldn't be backported.  A unit test would be helpful, if you feel like writing 
one.

--
nosy: +r.david.murray
versions:  -Python 3.1, Python 3.2

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This seems like a good reason for a backport.

Add a unittest and I'll take care of the rest.

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Artem Fokin

Artem Fokin added the comment:

Which branch should I add a unit-test to?
Here is a patch that adds a unit-test to the current one.

--
keywords: +patch
Added file: http://bugs.python.org/file31760/unittest_patch.diff

___
Python tracker 

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Uploading new patch with added transform_func property.

--
Added file: http://bugs.python.org/file31761/transformdict3.patch

___
Python tracker 

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



[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Michael Foord

Michael Foord added the comment:

Can that be fixed in tulip?

--

___
Python tracker 

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



[issue11798] Test cases not garbage collected after run

2013-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Yes, but that's not the point. Legitimate use cases can be broken by the 
change, so at least there should be an easy way to disable the new behaviour.

--

___
Python tracker 

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



[issue19020] Regression: Windows-tkinter-idle, unicode, and 0xxx filename

2013-09-14 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Current 3.3.2+ repository build (32 bit) and 3.4.0a2 repository build (32 bit) 
and installation (64 bit) have a problem that did not exist in my Win6 3.3.2 
installation (64 bit). (Bruce Sherwood discovered the symption with some 
installed version of 3.4.0a?) Adding to recent files a path with a directory or 
file whose name begins with '0' causes Idle to stop with a traceback such as 
given below. Currently, opening *any* file causes the recent files list to be 
rebuilt (seen in traceback). So the problem happens whether one opens a new 
file with a leading 0 somewhere or if there merely is one such already on the 
list.

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python34\lib\tkinter\__init__.py", line 1475, in __call__
return self.func(*args)
  File "C:\Python34\lib\idlelib\IOBinding.py", line 179, in open
flist.open(filename, self.loadfile)
  File "C:\Python34\lib\idlelib\FileList.py", line 34, in open
return action(filename)
  File "C:\Python34\lib\idlelib\IOBinding.py", line 240, in loadfile
self.updaterecentfileslist(filename)
  File "C:\Python34\lib\idlelib\IOBinding.py", line 521, in 
updaterecentfileslist
self.editwin.update_recent_files_list(filename)
  File "C:\Python34\lib\idlelib\EditorWindow.py", line 915, in 
update_recent_files_list
menu.delete(0, END)  # clear, and rebuild:
  File "C:\Python34\lib\tkinter\__init__.py", line 2739, in delete
if 'command' in self.entryconfig(i):
  File "C:\Python34\lib\tkinter\__init__.py", line 2749, in entryconfigure
return self._configure(('entryconfigure', index), cnf, kw)
  File "C:\Python34\lib\tkinter\__init__.py", line 1247, in _configure
self.tk.call(_flatten((self._w, cmd:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 14: 
invalid start byte

'invalid start byte' 0xc0 has appeared before in other issues.

Bruce got this with
  H:\HP_Documents\0PythonWork\AirplaneKinematics\accel2.py
I get 12' instead of '14' with
  F:\Python\mypy\0...' (file or directory, must be 0, not 1)
It appears that the string is being improperly 're-cooked' at some point, so 
that '\x' sequences are 1 position rather than 2.

At the point of failure, I believe tk is checking whether a particular menuitem 
has an associated callback that should be deleted before the menuitem itself is 
deleted (before later being rebuilt). (It is a separate issue of whether we 
could just adjust the recent file list (sub sub menu) rather than deleting and 
rebuilding it, possibly the same as it was. Even if we did, the issue would 
still arise when opening a new '0' file, or when closing Idle.)

--
messages: 197736
nosy: bsherwood, ezio.melotti, haypo, serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Regression: Windows-tkinter-idle, unicode, and 0xxx filename
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue6699] IDLE: Warn user about overwriting a file that has a newer version on filesystem

2013-09-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +bsherwood

___
Python tracker 

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



[issue19021] AttributeError in Popen.__del__

2013-09-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Sometimes closing IDLE I got such exception:

Exception ignored in: >
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/subprocess.py", line 890, in __del__
TypeError: 'NoneType' object is not callable

It is happened because the builtins module was destroyed before running __del__ 
in process of garbage collecting.

Here is a patch which should fix the bug. Anothe possible solution is get rid 
from getattr and catch AttributeError instead.

See also issue16650.

--
components: Library (Lib)
files: subprocess_del_getattr.patch
keywords: patch
messages: 197737
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: AttributeError in Popen.__del__
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31762/subprocess_del_getattr.patch

___
Python tracker 

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



[issue19020] Regression: Windows-tkinter-idle, unicode, and 0xxx filename

2013-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perhaps this is caused by issue18101.

--

___
Python tracker 

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



[issue18856] Added test coverage for calendar print functions

2013-09-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

--
assignee:  -> ezio.melotti
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions:  -Python 2.7

___
Python tracker 

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



[issue18856] Added test coverage for calendar print functions

2013-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 442e23bbec48 by Ezio Melotti in branch '3.3':
#18856: improve test coverage of the calendar module.  Patch by Madison May.
http://hg.python.org/cpython/rev/442e23bbec48

New changeset 81da2ed0c563 by Ezio Melotti in branch 'default':
#18856: merge with 3.3.
http://hg.python.org/cpython/rev/81da2ed0c563

--
nosy: +python-dev

___
Python tracker 

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



[issue18995] Enum does not work with reversed

2013-09-14 Thread Ethan Furman

Ethan Furman added the comment:

Well, I totally messed up the commit message, but the code is now in place.  
Thanks, Vajrasky Kok!

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

___
Python tracker 

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



[issue18929] inspect.classify_class_attrs ignores metaclass

2013-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b0517bb271ad by Ethan Furman in branch 'default':
Close #18929: inspect.classify_class_attrs will now search the metaclasses 
(last) to find where an attr was defined.
http://hg.python.org/cpython/rev/b0517bb271ad

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

___
Python tracker 

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



[issue18693] help() not helpful with enum

2013-09-14 Thread Ethan Furman

Ethan Furman added the comment:

Okay, here's the patch after the inspect portion was committed in #18929.

Summary:
  - added __objclass__ to each enum member
  - added __module__ to the class dir
  - aded any extra methods defined to the instance dir
  - changed _RouteClassAttributeToGetattr to use the wrapped doc if it exists
  - added more useful __doc__s to value and name
  - added another test :)

--
resolution: fixed -> 
Added file: http://bugs.python.org/file31763/issue18693.stoneleaf.02.patch

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0ff5bb61c6a1 by Raymond Hettinger in branch '3.3':
Issue #19018: The heapq.merge() function no longer suppresses IndexError
http://hg.python.org/cpython/rev/0ff5bb61c6a1

--
nosy: +python-dev

___
Python tracker 

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



[issue18958] Exception('No JSON object could be decoded') when parsing a valid JSON

2013-09-14 Thread Anoop Thomas Mathew

Anoop Thomas Mathew added the comment:

Patch for BOM signature documentation in json.loads

--
keywords: +patch
nosy: +Anoop.Thomas.Mathew
Added file: 
http://bugs.python.org/file31764/json_BOM_signature_documentation.patch

___
Python tracker 

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



[issue11344] Add os.path.splitpath(path) function

2013-09-14 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue16650] Popen._internal_poll() references errno.ECHILD outside of the local scope

2013-09-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions:  -Python 3.2

___
Python tracker 

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



[issue16650] Popen._internal_poll() references errno.ECHILD outside of the local scope

2013-09-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

sorry for noise

--
nosy: +terry.reedy
versions: +Python 3.2

___
Python tracker 

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



[issue19021] AttributeError in Popen.__del__

2013-09-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 56a3c0bc4634 by Raymond Hettinger in branch '2.7':
Issue #19018: The heapq.merge() function no longer suppresses IndexError
http://hg.python.org/cpython/rev/56a3c0bc4634

--

___
Python tracker 

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



[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I think this patch is a false solution and should be reverted. Oleg should have 
been told to use sys.version to make the correct call. Given how Python is, 
that is the correct solution to his problem.

The result of this patch is #19021: an AttributeError on shutdown when getattr 
gets cleared before the Popen instance.

The problem of Python putting out an uncatchable error message when deleting an 
uninitialized instance is generic and not specific to Popen.

class C():
def __init__(self): self.a = 1
def __del__(self): self.a

try:
C(1)
except (TypeError, AttributeError): pass

# prints
Exception AttributeError: "'C' object has no attribute 'a'" in > ignored

If there is to be any change, it should be as generic as the problem. Perhaps 
that message should simply be eliminated. Perhaps it should be a Warning, which 
could be blocked. Perhaps there should be a real AttributeError chained with 
the TypeError.


What we should not do and should not tell people to do is add at least one 
getattr call to every __del__ method.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue19018] Heapq.merge suppreses IndexError from user generator

2013-09-14 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The same issue arises when an exception is raised during the __init__ 
execution, rather than in the call argument match phase, and the exception is 
caught.

class C():
def __init__(self): self.a = self.b
def __del__(self): self.a

try:
C()
except AttributeError): pass
# print same message as before about self.a in __del__

What is different is that if the exception raised within __init__ is not 
caught, only the normal traceback is printed.

--

___
Python tracker 

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



[issue19021] AttributeError in Popen.__del__

2013-09-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The condition was changed from self._child_created to the getattr call in 
#12085. As explained in msg197748, I think that change should be reverted (and 
this issue closed). I think elaborating a bad patch only makes it worse.

--

___
Python tracker 

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



[issue1602] windows console doesn't print or input Unicode

2013-09-14 Thread Glenn Linderman

Glenn Linderman added the comment:

Hi Drekin. Thanks for your work in progressing this issue. There have been a 
variety of techniques proposed for this issue, but it sounds like yours has 
built on what the others learned, and is close to complete, together with issue 
17620.

Is this in a form that can be used with Python 3.3? or 3.4 alpha? Can it be 
loaded externally from a script, or must it be compiled into Python, or both?

I've been using a variant of davidsarah's patch since 2 years now, but would 
like to take yours out for a spin. Is there a Complete Idiot's guide to using 
your patch? :)

--

___
Python tracker 

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



[issue1602] windows console doesn't print or input Unicode

2013-09-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

>From reading the module,
  import stream; stream.enable()
replaces sys.stdin/out/err with new classes.

--

___
Python tracker 

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