[issue17324] SimpleHTTPServer serves files even if the URL has a trailing slash

2013-09-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a58b620e4dc9 by Senthil Kumaran in branch '2.7':
Fix SimpleHTTPServer's request handling case on trailing '/'.
http://hg.python.org/cpython/rev/a58b620e4dc9

New changeset 1fcccbbe15e2 by Senthil Kumaran in branch '3.3':
Fix http.server's request handling case on trailing '/'.
http://hg.python.org/cpython/rev/1fcccbbe15e2

New changeset b85c9d2a5227 by Senthil Kumaran in branch 'default':
Fix http.server's request handling case on trailing '/'.
http://hg.python.org/cpython/rev/b85c9d2a5227

--
nosy: +python-dev

___
Python tracker 

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



[issue17324] SimpleHTTPServer serves files even if the URL has a trailing slash

2013-09-13 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for the patches, Vajrasky and Karl. Fixed in currently active (3.4,3.3 
and 2.7) versions of python.

--
assignee:  -> orsenthil
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed
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



[issue18725] Multiline shortening

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch. It get rid of TextWrap.shorten() because TextWrap.fill() 
supersedes it and because "placeholder" now a parameter of TextWrap. Module 
level shorten() is left but I doubt about it.

--
keywords: +patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file31736/textwrap_max_lines.patch

___
Python tracker 

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



[issue18468] re.group() should never return a bytearray

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, seems I again did not attach a patch. Now I understand why there were no 
any feedback so long time.

--
keywords: +needs review, patch
Added file: http://bugs.python.org/file31737/re_group_type.patch

___
Python tracker 

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



[issue18682] [PATCH] remove bogus codepath from pprint._safe_repr

2013-09-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Are there tests for all the "builtin scalars"?

--

___
Python tracker 

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



[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-09-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c7fdb0637d0b by Serhiy Storchaka in branch 'default':
Issue #18818: The "encodingname" part of PYTHONIOENCODING is now optional.
http://hg.python.org/cpython/rev/c7fdb0637d0b

--
nosy: +python-dev

___
Python tracker 

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



[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Ezio and Vajrasky for the review.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
type: behavior -> enhancement
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



[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-09-13 Thread Lars Buitinck

Lars Buitinck added the comment:

Ok. Do you (or jnoller?) have time to review my proposed patch, at least before 
3.4 is released? I didn't see it in the release schedule, so it's probably not 
planned soon, but I wouldn't want the API to change *again* in 3.5.

--

___
Python tracker 

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



[issue9951] introduce bytes.hex method

2013-09-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue19008] tkinter: UnboundLocalError: local variable 'sys' referenced before assignment

2013-09-13 Thread Laurence McGlashan

New submission from Laurence McGlashan:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python2.7/site-packages/sk1/__init__.py", line 21, in 

app.main.main()
  File "/usr/lib64/python2.7/site-packages/sk1/app/main.py", line 150, in main
application = SketchApplication(filename, options.display, 
options.geometry, run_script = options.run_script)
  File "/usr/lib64/python2.7/site-packages/sk1/app/skapp.py", line 155, in 
__init__
TkApplication.__init__(self, screen_name = screen_name, geometry = geometry)
  File "/usr/lib64/python2.7/site-packages/sk1/app/skapp.py", line 60, in 
__init__
self.init_tk(screen_name, geometry)
  File "/usr/lib64/python2.7/site-packages/sk1/app/skapp.py", line 185, in 
init_tk
TkApplication.init_tk(self, screen_name = screen_name, geometry = geometry)
  File "/usr/lib64/python2.7/site-packages/sk1/app/skapp.py", line 63, in 
init_tk
self.root = Tk(screenName = screen_name, baseName = self.tk_basename, 
className = self.tk_class_name)
  File "/usr/lib64/python2.7/lib-tk/Tkinter.py", line 1748, in __init__
if not sys.flags.ignore_environment:
UnboundLocalError: local variable 'sys' referenced before assignment


Patch attached.

--
components: Tkinter
files: Tkinter.patch
keywords: patch
messages: 197563
nosy: Laurence.McGlashan
priority: normal
severity: normal
status: open
title: tkinter: UnboundLocalError: local variable 'sys' referenced before 
assignment
versions: Python 2.7
Added file: http://bugs.python.org/file31738/Tkinter.patch

___
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-13 Thread Michael Foord

Michael Foord added the comment:

Well, they actually test slightly different scenarios - they're *not* just 
duplicates of each other.

--

___
Python tracker 

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



[issue19008] tkinter: UnboundLocalError: local variable 'sys' referenced before assignment

2013-09-13 Thread Laurence McGlashan

Changes by Laurence McGlashan :


--
type:  -> crash

___
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-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 63f25483c8f6 by Eli Bendersky in branch '3.3':
Issue #18945: Add tests for tempfile name collision handling.
http://hg.python.org/cpython/rev/63f25483c8f6

New changeset c902ceaf7825 by Eli Bendersky in branch 'default':
Issue #18945: Add tests for tempfile name collision handling.
http://hg.python.org/cpython/rev/c902ceaf7825

--
nosy: +python-dev

___
Python tracker 

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



[issue19008] tkinter: UnboundLocalError: local variable 'sys' referenced before assignment

2013-09-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Security bug in tkinter allows for untrusted, arbitrary code 
execution.

___
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-13 Thread Eli Bendersky

Eli Bendersky added the comment:

Thanks Vlad, committed to 3.3/3.4; would you like to provide the 2.7 patch?

--

___
Python tracker 

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



[issue18911] minidom does not encode correctly when calling Document.writexml

2013-09-13 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue18998] iter() not working in ElementTree

2013-09-13 Thread Eli Bendersky

Eli Bendersky added the comment:

I can't reproduce it with the most recent default branch (Python 3.4.0a2+ 
(default:c7fdb0637d0b, Sep 13 2013, 05:29:00)) either.

Unless I'm missing something, there's no issue here. Let me know if something 
else can be done. Otherwise I'll close the issue in a couple of days.

--

___
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-13 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Added file: http://bugs.python.org/file31739/tempfile_collision_tests_27

___
Python tracker 

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



[issue18997] Crash when using pickle and ElementTree

2013-09-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 39823ebfc731 by Eli Bendersky in branch '3.3':
Issue #18997: fix ElementTree crash with using pickle and __getstate__.
http://hg.python.org/cpython/rev/39823ebfc731

New changeset bda5a87df1c8 by Eli Bendersky in branch 'default':
Merge for Issue #18997: Issue #18997: fix ElementTree crash with using pickle 
and __getstate__.
http://hg.python.org/cpython/rev/bda5a87df1c8

--
nosy: +python-dev

___
Python tracker 

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



[issue18997] Crash when using pickle and ElementTree

2013-09-13 Thread Eli Bendersky

Eli Bendersky added the comment:

Fixed the patch and committed. Thanks.

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



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

2013-09-13 Thread R. David Murray

R. David Murray added the comment:

We don't generally backport tests unless they are part of a bug fix.  It's not 
a blanket prohibition, but normally the risk of false positives in a 
maintenance release on platforms not covered by our buildbots outweighs the 
benefits of adding the tests.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue9951] introduce bytes.hex method

2013-09-13 Thread Arnon Yaari

Arnon Yaari added the comment:

You can follow the discussion I linked in the ticket description for an answer:
http://psf.upfronthosting.co.za/roundup/tracker/issue3532
Mainly the answer is: to conform to PEP 358 and to provide the opposite of 
bytes.fromhex.
I agree that you can use binascii, but apparently it was decided that this 
functionality is good to have in the builtins (what used to be 
encode/decode('hex') in Python 2.x, and what is now bytes.fromhex, with the 
missing bytes.hex). In addition, binascii works a little differently - already 
discussed in the given link...

--
status: pending -> open

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated. Added tests. The locale_alias mapping updated to be 
self-consistency (i.e. for every name in locale_alias.values() normalize(name) 
== name).

--
assignee: docs@python -> serhiy.storchaka
keywords:  -easy
nosy: +lemburg
stage: needs patch -> patch review
versions:  -Python 3.2
Added file: http://bugs.python.org/file31740/locale_parse_2.patch

___
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-13 Thread Eli Bendersky

Eli Bendersky added the comment:

On Fri, Sep 13, 2013 at 6:28 AM, R. David Murray wrote:

>
> R. David Murray added the comment:
>
> We don't generally backport tests unless they are part of a bug fix.  It's
> not a blanket prohibition, but normally the risk of false positives in a
> maintenance release on platforms not covered by our buildbots outweighs the
> benefits of adding the tests.
>

These tests are very related to an actual bug-fix (
http://bugs.python.org/issue18849). Moreover, they cover a previously
uncovered feature which resulted in very intermittent heisen-bugs where
temp file creation was occasionally failing on some platforms. IMHO having
this covered is worth the small maintenance burden of the tests - who
knows, it may uncover real problems. What do you think?

--

___
Python tracker 

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



[issue18844] allow weights in random.choice

2013-09-13 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue19009] Enhance HTTPResponse.readline() performance

2013-09-13 Thread Kristján Valur Jónsson

New submission from Kristján Valur Jónsson:

Some applications require reading http response data in "long" polls as it 
becomes available.  This is used, e.g. to receive "notifications" over a HTTP 
stream.
Using response.read(large_buffer) is not possible because this will attempt to 
fullfill the entire request (using multiple underlying recv() calls), negating 
the attempt to get data as it becomes available.
Using "readline", and using \n boundaries in the data, this problem can be 
overcome.
Currently, readline is slow because it will attempt to read one byte at a time. 
 Even if it is doing so from a buffered stream, it is still doing it one 
character at a time.
This patch adds a "peek" method to HttpResponse, which works both for chunked 
and non-chunked transfer encoding, thus improving the performance of readline.  
IOBase.readline will use peek() to determine the readahead it can use, instead 
of one byte which it must use by default.

--
components: Library (Lib)
files: peek.patch
keywords: patch
messages: 197574
nosy: kristjan.jonsson
priority: normal
severity: normal
status: open
title: Enhance HTTPResponse.readline() performance
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file31741/peek.patch

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread R. David Murray

R. David Murray added the comment:

It would be great if this could get a review by MAL, since it looks like a 
non-trivial change.

Also, you have some (commented out) debug prints in there.

--

___
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-13 Thread Eli Bendersky

Eli Bendersky added the comment:

I agree with David. This is yet another case where we try to go against Python 
and make enum special, and I'm against this. Nothing prevents users from 
accidentally overriding their own members and methods in normal classes as 
well. This is trivially discoverable with tests. Let's please stop making enum 
more and more complex with all these needless type checks. We'll never get out 
of it.

--

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 13.09.2013 15:30, Serhiy Storchaka wrote:
> 
> Serhiy Storchaka added the comment:
> 
> Patch updated. Added tests. The locale_alias mapping updated to be 
> self-consistency (i.e. for every name in locale_alias.values() 
> normalize(name) == name).

Could you elaborate on the alias changes ?

Were those coming from an updated X11 local.alias file ?

If so, I'd suggest to create two patches: one with the alias
updates (which can then also be backported) and one with the
new normalization code (which is a new feature and probably
cannot be backported).

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

--

___
Python tracker 

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



[issue17394] Add slicing support to collections.deque

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What type should be a result of slicing? List, tuple, deque, other?

--

___
Python tracker 

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



[issue17087] Improve the repr for regular expression match objects

2013-09-13 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Serhiy, at the first glance, that repr doesn't make sense to me, thus it seems 
a little difficult to comprehend.

--

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Also, you have some (commented out) debug prints in there.

These debug prints were in old code.

--

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread R. David Murray

R. David Murray added the comment:

Ah, I see.  I only scanned the patch quickly, obviously.

--

___
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-13 Thread R. David Murray

R. David Murray added the comment:

If they are part of a bug fix, then sure.  That wasn't clear from this issue, 
though.  On the other hand, if the tests in that other issue cover the actual 
bug, and these have any chance of *introducing* test failures (especially if 
they are heisenburgs, although I'm assuming the point is that they are not), 
then I'd say no.  The issue with backporting tests isn't about "maintenance 
burden" (backporting tests actually makes the maintenance burden smaller, not 
larger).  The issue is potential effectively spurious test failures in the 
field in a maintenance release.

To put it another way: the right place to find test bugs is in a feature 
release, which we then fix in the next maintenance release.  We do *not* want 
to find test bugs in maintenance releases.

--

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Could you elaborate on the alias changes ?
> Were those coming from an updated X11 local.alias file ?

No, they are not from X11 local.alias file. They are a result of the 
test_locale_alias self-test, I have fixed all failures.

This test can't be backported without rest of changes, because they fix other 
error, for example processing encodings with hyphen. Without them 
test_locale_alias will fail even with updated locale_alias. I.e. we can 
backport either changes to locale_alias without tests, or changes to 
locale_alias with all changes to parser and tests, or changes to parser and all 
tests except test_locale_alias.

Current code doesn't work with locales with modifiers and locales with 
hyphenated encodings.

--

___
Python tracker 

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2013-09-13 Thread Sam Ferencik

Sam Ferencik added the comment:

Are you asking *what* distutils does?

It tackles the problem completely differently on Windows, Unix, and OS X.

--

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch without changes to locale_alias.

--

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file31742/locale_parse_2a.patch

___
Python tracker 

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2013-09-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Are you asking *what* distutils does?

Yup :-) I'm not a distutils maintainer, so I hardly know how it does
things internally.

> It tackles the problem completely differently on Windows, Unix, and
> OS X.

Ah... but does it compute the result by itself or simply queries some
kind of external information?
If the former, then it should be simple to give it the right bitness
value (32 vs. 64). If the latter, things will get a bit more...
interesting :-)

--
title: distutils.utils.get_platform() for 32-bit Python on a64-bit machine 
-> distutils.utils.get_platform() for 32-bit Python on   a   64-bit machine

___
Python tracker 

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



[issue19009] Enhance HTTPResponse.readline() performance

2013-09-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This sounds ok on the principle. I suppose one can't simply wrap the "fp" 
inside a BufferedReader?
I think it would be good to add tests for the peek() implementation, though.

--
nosy: +orsenthil, pitrou, serhiy.storchaka
stage:  -> patch review
versions: +Python 3.4 -Python 3.5

___
Python tracker 

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



[issue18902] Make ElementTree event handling more modular to allow custom targets for the non-blocking parser

2013-09-13 Thread Stefan Behnel

Stefan Behnel added the comment:

> Also, +1 for allowing start-ns and end-ns event callbacks on parser targets, 
> although that's a different feature entirely.

Actually, I take that back. I can't see a use case for this feature, and it 
doesn't really fit with the notion of fully qualified tag names in ElementTree 
(which itself is a great feature). I'm -0.7 on adding this.

--

___
Python tracker 

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2013-09-13 Thread Éric Araujo

Éric Araujo added the comment:

FTR the Mac OS code does some normalization: 
http://hg.python.org/cpython/file/bda5a87df1c8/Lib/_osx_support.py#l473

Code for linux just returns the value from uname, as Same said: 
http://hg.python.org/cpython/file/bda5a87df1c8/Lib/distutils/util.py#l75

--

___
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-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

What if I redefine an existing key inside a subclass?

--

___
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-13 Thread Ethan Furman

Ethan Furman added the comment:

One cannot subclass an Enum that has already defined keys.

--

___
Python tracker 

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



[issue19009] Enhance HTTPResponse.readline() performance

2013-09-13 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

The problem is that self.fp is already a Buffered stream, and such streams are 
documented to have their read() and readinto() calls make multiple system calls 
to fullfill the request.

My original goal was actually to make response.read(amt) not try to make 
multiple read() calls, so that one could have other delimiters than newline.  
It is simple for the chunked case, but I don't know how to bypass it for 
response.fp, since it is already a buffered file that has no guaranteed such 
behaviour wait, one can simply call peek() on it and know how much one can 
get :)

But anyway, the use case I have actually uses newlines as record separators in 
the http stream, so this enhancement seems less intrusive.

I'll add unit tests.  There ought to be ready-made HTTPResponse tests already 
that I can use as templates.

--

___
Python tracker 

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2013-09-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> On Unix, specifically, the return value is heavily based on os.uname().

Ouch. Then I'm afraid this is a probably a won't fix :-/

--

___
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-13 Thread Ethan Furman

Ethan Furman added the comment:

Perhaps you meant, what if you define a key in a subclass that shadows a 
method/property in a parent class?

I'm inclined to say that would be acceptable, since one reason for subclassing 
is to add or make changes to the parent class' behavior.

--

___
Python tracker 

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2013-09-13 Thread Sam Ferencik

Sam Ferencik added the comment:

It's very hacky on all of Windows, Unix, and OS X. That's why I don't feel 
confident to propose a solution.

On Unix, specifically, the return value is heavily based on os.uname(). It 
seems that the maintainers of OS X have started with the same but then chose to 
diverge and instead use a list of values.

--

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 13.09.2013 16:34, Serhiy Storchaka wrote:
> 
> Serhiy Storchaka added the comment:
> 
>> Could you elaborate on the alias changes ?
>> Were those coming from an updated X11 local.alias file ?
> 
> No, they are not from X11 local.alias file. They are a result of the 
> test_locale_alias self-test, I have fixed all failures.
> 
> This test can't be backported without rest of changes, because they fix other 
> error, for example processing encodings with hyphen. Without them 
> test_locale_alias will fail even with updated locale_alias. I.e. we can 
> backport either changes to locale_alias without tests, or changes to 
> locale_alias with all changes to parser and tests, or changes to parser and 
> all tests except test_locale_alias.
> 
> Current code doesn't work with locales with modifiers and locales with 
> hyphenated encodings.

Then I don't understand changes such as:

-'chinese-s':'zh_CN.eucCN',
+'chinese-s':'zh_CN.gb2312',

or

-'sp':   'sr_CS.ISO8859-5',
-'sp_yu':'sr_CS.ISO8859-5',
+'sp':   'sr_RS.ISO8859-5',
+'sp_yu':'sr_RS.ISO8859-5',

The .test_locale_alias() checks that the normalize()
function returns the the alias given in the alias table.

If you have to make changes to the alias table that cause the
encoding to or locale to change, something is wrong with
normalize() function.

Note that we are using the X11 locale.alias file as basis for
the mapping, so any such changes need to be found there as
well.

The Tools/i18n/makelocalealias.py script can be used to create
an updated listing.

Please remember that the output of the alias table
is a C runtime locale string. Those do not necessarily
use the same encodings as we do in Python.

Perhaps we should open a separate ticket for the update of the
alias table. I just ran the script on my older dev system
and it returned this list of changes compared to what's in
Python 2.7:

#added 'ar_in'
#added 'as_in'
#added 'be_bg'
#added 'bo_in'
#added 'en_dk'
#added 'hne_in'
#added 'ks_in'
#added 'mai_in'
#added 'ml_in'
#added 'ne_np'
#added 'or_in'
#added 'pa_pk'
#added 'sd_in'
#added 'sd_in@devanagari'
#added 'te_in'
#updated 'univ' -> 'en_US.utf' to 'en_US.UTF-8'
#added 'ur_in'
#added 'zh_sg'

--

___
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-13 Thread Ethan Furman

Ethan Furman added the comment:

In any other (normal) class, this works:
==
-->class Okay:
...   red = 1
...   green = 2
...   blue = 3
...   red = 4
==

But not in Enum.

And this works:
==
-->class Color:
...   red = 1
...   green = 2
...   blue = 3
...   def red(self):
... return 42
... 
--> Color.red

==

This only works in Enum because we added code to deal with it.  If we hadn't, 
we'd see this:
==
>
==

So right now the rule is:  you can overwrite an enum member with anything 
besides another enum member.  Considering the point of the Enum class is to 
create enum members this rule is nonsensical as it allows the removal of 
already created members.

At the very least the rule should be: enum members cannot be overwritten.

I prefer to have the rule: enum members cannot overwrite anything else, and 
cannot be overwritten by anything else.  This seems to me to be a simpler, more 
consistent rule, and more in keeping with what an enumeration should be doing.

--

___
Python tracker 

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



[issue19009] Enhance HTTPResponse.readline() performance

2013-09-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> My original goal was actually to make response.read(amt) not try to
> make multiple read() calls, so that one could have other delimiters
> than newline.  It is simple for the chunked case, but I don't know
> how to bypass it for response.fp, since it is already a buffered
> file that has no guaranteed such behaviour wait, one can simply
> call peek() on it and know how much one can get :)

Or you can use read1()?

--

___
Python tracker 

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



[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Then I don't understand changes such as:
>
> -'chinese-s':'zh_CN.eucCN',
> +'chinese-s':'zh_CN.gb2312',
>
> or
>
> -'sp':   'sr_CS.ISO8859-5',
> -'sp_yu':'sr_CS.ISO8859-5',
> +'sp':   'sr_RS.ISO8859-5',
> +'sp_yu':'sr_RS.ISO8859-5',
>
> The .test_locale_alias() checks that the normalize()
> function returns the the alias given in the alias table.
>

It also test normalize(locale_alias[localname]) == locale_alias[localname]
== normalize(localname). I.e. that applying normalize() twice doesn't
change a result.

chinese-s is mapped to zh_CN.eucCN, but eucCN is mapped to gb2312. sp is
mapped to sr_CS.ISO8859-5, but sr_CS is mapped to sr_RS.UTF-8 and then
.ISO8859-5 replaces UTF-8. Of course we can recursive call normalize(), but
it will be more practical just update the mapping.

--

___
Python tracker 

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2013-09-13 Thread Sam Ferencik

Sam Ferencik added the comment:

Well, the maintainers of Mac OS didn't consider it a won't fix - and have this 
working properly. I don't see why we couldn't try to copy what they did.

Actually, I think the impact of changing this for 32-bit Python on 64-bit Linux 
should be quite small, no?

--

___
Python tracker 

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



[issue19009] Enhance HTTPResponse.readline() performance

2013-09-13 Thread R. David Murray

R. David Murray added the comment:

See also issue 13541?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue19009] Enhance HTTPResponse.readline() performance

2013-09-13 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Intersting. I didn't know about that.  My excuse is that I never use 3.x except 
when I'm porting some CCP enhancements for cpython.

Here's a thought:  HTTPResponse inherits from RawIOBase.  Only the BufferedIO 
classes have read1() and are documented to have more than one system calls on 
their read() methods.  Yet, HTTPResponse will happily behave in that way.
So, either HTTPResponse, being a non-buffered IO object, should not work in 
that way, or we could add a read1() method to it.

--

___
Python tracker 

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



[issue18948] deliberately crashing tests should prevent core dumps

2013-09-13 Thread Valerie Lambert

Valerie Lambert added the comment:

Great! Thanks for putting together a list. I've incorporated SuppressCoreFiles 
into these tests and have used the test suite without any errors. Again, I'm 
testing these on Ubuntu.

--
keywords: +patch
Added file: http://bugs.python.org/file31743/issue-18948.patch

___
Python tracker 

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



[issue19009] Enhance HTTPResponse.readline() performance

2013-09-13 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

I should add, I fully support the use case that response.read(amt=None) needs 
to read to the end of the response.  It is only the read(amt=bufsize) use case 
I'm thinking of, and that could be handled with a read1() method.

--

___
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-13 Thread Eli Bendersky

Eli Bendersky added the comment:

Benjamin, what do you think?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue17087] Improve the repr for regular expression match objects

2013-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Well, then first will commit a simpler patch. I left comments on Rietveld.

--

___
Python tracker 

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



[issue18902] Make ElementTree event handling more modular to allow custom targets for the non-blocking parser

2013-09-13 Thread Stefan Behnel

Stefan Behnel added the comment:

I created a separate ticket #19010 for the inheritance issue.

--

___
Python tracker 

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2013-09-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Well, the maintainers of Mac OS didn't consider it a won't fix - and
> have this working properly. I don't see why we couldn't try to copy
> what they did.

Ah, ok. Then a patch would be welcome :-)

> Actually, I think the impact of changing this for 32-bit Python on
> 64-bit Linux should be quite small, no?

Well, if you can get the semantics reliably right, yes, probably.

--

___
Python tracker 

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



[issue19010] Make XMLPullParser in ElementTree inherit from XMLParser

2013-09-13 Thread Stefan Behnel

New submission from Stefan Behnel:

As mentioned in tickets #18902 and #17741, the XMLPullParser in the external 
lxml.etree package inherits from the existing XMLParser class. This makes the 
interface simpler, both simpler to explain and to implement.

The implementation in ElementTree should do the same.

--
components: Library (Lib), XML
messages: 197605
nosy: eli.bendersky, scoder
priority: normal
severity: normal
status: open
title: Make XMLPullParser in ElementTree inherit from XMLParser
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue17087] Improve the repr for regular expression match objects

2013-09-13 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Here's the new version. I added a few replies on the Rietveld.

--
Added file: http://bugs.python.org/file31744/sre_repr2.patch

___
Python tracker 

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



[issue19011] Enum should have a __getattr__ that makes all the instances available from an instance

2013-09-13 Thread Chris Lambacher

New submission from Chris Lambacher:

The use case for this is that when you are in a template and you want to use 
the Enum instances in a conditional, then you need to pass the Enum class to 
the template or start using someenumvariable.__class__.someenumvalue. Instead 
it would be useful to be able to do someenumvariable.someenumvalue. 
Implimenting as __getattr__ on enum class allows real attributes to take 
precedence and also allows for overriding of behaviour in child classes.

--
components: Library (Lib)
files: getattr_for_enum_class.patch
keywords: patch
messages: 197611
nosy: lambacck
priority: normal
severity: normal
status: open
title: Enum should have a __getattr__ that makes all the instances available 
from an instance
versions: Python 3.4
Added file: http://bugs.python.org/file31745/getattr_for_enum_class.patch

___
Python tracker 

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



[issue19011] Enum should have a __getattr__ that makes all the instances available from an instance

2013-09-13 Thread Ethan Furman

Ethan Furman added the comment:


--> class Test:
...   this = 'that'
...   these = 'those'
... 
--> Test.this
'that'
--> Test.this.these
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'str' object has no attribute 'these'


This is not normal Python behavior, nor does it seem to be behavior intrinsic 
to enumerations.  It also adds an Alice-in-Wonderland quality to Enums:

--> red = Color.red
--> red.blue.blue.red.green.blue



We're going to have to live without this particular "feature".

--
assignee:  -> ethan.furman
nosy: +barry, eli.bendersky, ethan.furman
resolution:  -> 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



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

2013-09-13 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Okay, I found the difference.

The second test case is to test the case on which we delete the attribute of 
the mock instance before being referenced by any variable. The we make sure the 
attribute is gone for good.

The first test case is to test the case on which we delete the attribute of the 
mock instance after being referenced by any variable (or maybe just needed to 
be used by __getattr__), then we make sure the attribute is resetted to the 
original value, not deleted.

I oversight this because I never thought that people could rely on this 
behaviour.

--

___
Python tracker 

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



[issue18960] First line can be executed twice

2013-09-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I thought that that was the specification*: the encoding comment should be the 
first line unless it has to be the second line to allow for an executable 
comment. Executing a non-comment first line twice is definitely contrary to the 
intent of the PEP.

* I have not read it recently ;-).

When running that snippet from 3.3.2 Idle editor, 'first' is only printed once. 
I consider this to be correct and I would not want to change Idle to match the 
buggy behavior.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue17087] Improve the repr for regular expression match objects

2013-09-13 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Added the new version.

--
Added file: http://bugs.python.org/file31746/sre_repr3.patch

___
Python tracker 

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



[issue19011] Enum should have a __getattr__ that makes all the instances available from an instance

2013-09-13 Thread Ethan Furman

Ethan Furman added the comment:

My apologies, you are correct.

I am still against this for the Alice reason, but lets see what the others 
think.

--
resolution: rejected -> 
status: closed -> open

___
Python tracker 

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



[issue19011] Enum should have a __getattr__ that makes all the instances available from an instance

2013-09-13 Thread Chris Lambacher

Chris Lambacher added the comment:

You are not comparing the same thing. Normally when there is a class parameter, 
those are available from instances of the class.

>>> class Test:
...pass
...
>>> Test.this = Test()
>>> Test.that = Test()
>>> Test.this.that
<__main__.Test instance at 0x7ff681bd3560>
>>>
>>> isinstance(Test.this, Test)
True
>>> from enum import IntEnum

>>> class Color(IntEnum):
... red = 1
... blue = 2
... green = 3
...
>>> isinstance(Color.red, Color)
True
>>>

--

___
Python tracker 

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



[issue18960] First line can be executed twice

2013-09-13 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 13.09.2013 19:24, Terry J. Reedy wrote:
> 
> Terry J. Reedy added the comment:
> 
> I thought that that was the specification*: the encoding comment should be 
> the first line unless it has to be the second line to allow for an executable 
> comment. Executing a non-comment first line twice is definitely contrary to 
> the intent of the PEP.
> 
> * I have not read it recently ;-).
> 
> When running that snippet from 3.3.2 Idle editor, 'first' is only printed 
> once. I consider this to be correct and I would not want to change Idle to 
> match the buggy behavior.

Agreed. The PEP never intended to allow executable first lines in
a Python code file.

--
nosy: +lemburg

___
Python tracker 

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



[issue18951] In unittest.TestCase.assertRegex change "re" and "regex" to "r"

2013-09-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

[The information in titles, especially long titles that do not fit in the title 
box (on my system, at least) should be repeated in the opening message.]

The point of the patch is to use the same name for the same object in the two 
columns* and to use a single letter to be consistent with the rest of the 
table. I think the patch should be applied.

* Using 're' and 'regex' to mean the same object *is* confusing.

--
nosy: +terry.reedy
stage:  -> commit review

___
Python tracker 

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



[issue18961] Non-UTF8 encoding line

2013-09-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Which behavior do you propose to change? Does PEP263 specify the response to a 
self-contradictory encoding comment? What do you think it should say?

I raising is the better behavior. 

Idle notices that it cannot save the file with iso8859-15 encoding, so it saves 
it with utf-8 encoding instead. Any Python-aware editor that recognizes and 
uses the encoding cookie would have to either do the same or refuse to save 
until the encoding specification were changed.

Trying to run the file brings up a error box with SyntaxError: encoding 
problem: utf-8. Note that Idle runs a syntax check before creating a new 
subprocess, connecting to it, and trying to actually run the file. Closing the 
box takes one back to the editor as the spot where the error was noticed, which 
in this case is at the end of the line.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue18965] 2to3 can produce illegal bytes literals

2013-09-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +benjamin.peterson

___
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-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 540a9c69c2ea by Charles-François Natali in branch 'default':
Issue #16201: socket: Use inet_pton()/inet_addr() instead of ad-hoc parsing for
http://hg.python.org/cpython/rev/540a9c69c2ea

--
nosy: +python-dev

___
Python tracker 

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



[issue19011] Enum should have a __getattr__ that makes all the instances available from an instance

2013-09-13 Thread Chris Lambacher

Chris Lambacher added the comment:

For what it's worth, I was confused by the inability to access the class 
members from the instance for like 3 or 4 weeks until I realized that the 
instances were not actually on the class and the implications of that for class 
attribute access.

--

___
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-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
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-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
components: +Tests

___
Python tracker 

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



[issue18974] Use argparse in the diff script

2013-09-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue19006] UnitTest docs should have a single list of assertions

2013-09-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I like the current division, but agree that
  The TestCase class provides a number of methods to check for and
  report failures, such as:

is slightly misleading. I would change it to
  The TestCase class provides a number of methods to check for and
  report failures. The most commonly used are:
  ...
  More are listed in the Regex, Comparisons, and Type-specific tables.

where each of Regex, Comparisons, and Type-specific link to their respective 
tables. (Repaint the link names if you wish ;-).

--
nosy: +terry.reedy

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-13 Thread Brett Cannon

Brett Cannon added the comment:

Attached is my rough attempt at a script to auto-generate Misc/NEWS from commit 
logs. Key points:

- Works from the hg log in XML format as dumped to a file
- Considers a commit newsworthy if it isn't a merge and either has an issue 
number or has an "interesting" path (e.g. not an HTML file) and details (i.e. 
the stuff after a \n\n)
- Uses paths in the commit to determine what category the commit belongs to

Decisions to make:

- How to exactly flag a commit should not be in NEWS (I say it doesn't contain 
"#\d+:" to signify an issue and lacks any details after a \n\n)
- How often to run (e.g. at release time, anyone, post-commit hook, etc.)

--
nosy: +brett.cannon
Added file: http://bugs.python.org/file31747/newsworthy.py

___
Python tracker 

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



[issue19006] UnitTest docs should have a single list of assertions

2013-09-13 Thread Roy Smith

Roy Smith added the comment:

The new text suggested by terry.reedy works for me.

--

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I like the script name :-)... Other than that, can you attach a NEWS file such 
as generated by this script?

--

___
Python tracker 

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



[issue18951] In unittest.TestCase.assertRegex change "re" and "regex" to "r"

2013-09-13 Thread py.user

py.user added the comment:

ok, I will repeat patch contents in message by words to avoid guessing

--

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-13 Thread Brett Cannon

Brett Cannon added the comment:

Example file at Antoine's request. Just don't forget, very rough and not at all 
finished. =) We probably can't use something like this until Python 3.5 in 
order to make sure everyone uses commit messages that make sense, but you can 
get a sense of whether it has a chance of working.

I should also mention that it would be easy to have multiple outputs, e.g. a 
reST one that links to the actual commit as well as the issue in order to have 
a pretty version for the website, etc.

--
Added file: http://bugs.python.org/file31748/very_early_output.txt

___
Python tracker 

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



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

2013-09-13 Thread py.user

py.user added the comment:

Senthil Kumaran changed the pattern

from: r'^See (http://www\.python\.org/[^/]+/license.html)$'
  to: r'^See (http://www\.python\.org/download/releases/[^/]+/license/)$'

test doesn't pass

[guest@localhost cpython]$ ./python
Python 3.4.0a2+ (default, Sep 14 2013, 05:56:46) 
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> license()
See http://www.python.org/3.4/license.html
>>>


make test
...
[265/380/3] test_site
test test_site failed -- Traceback (most recent call last):
  File "/home/guest/tmp/tests/misc/git/example/cpython/Lib/test/test_site.py", 
line 416, in test_license_page
self.assertIsNotNone(mo, msg='can\'t find appropriate url in license')
AssertionError: unexpectedly None : can't find appropriate url in license
...

--

___
Python tracker 

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



[issue18951] In unittest.TestCase.assertRegex change "re" and "regex" to "r"

2013-09-13 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!
I also updated the table entry for assertRaisesRegex and assertWarnsRegex.
I avoid using "regex" instead of "re" or "r" to keep it short and avoid 
confusion with the re/regex modules.  The documentation of the methods uses 
"regex", but there it's OK.

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage: commit 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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-13 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



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

2013-09-13 Thread py.user

Changes by py.user :


--
status: closed -> pending

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Decisions to make:

Another important question: how do we manage manual edits to Misc/NEWS? Is the 
script smart enough to recognize those edits and not override them?

--

___
Python tracker 

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



[issue18951] In unittest.TestCase.assertRegex change "re" and "regex" to "r"

2013-09-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 03e94f9884ce by Ezio Melotti in branch '3.3':
#18951: use consistent names in unittest docs.
http://hg.python.org/cpython/rev/03e94f9884ce

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

New changeset 6d8ff8c57d38 by Ezio Melotti in branch '2.7':
#18951: use consistent names in unittest docs.
http://hg.python.org/cpython/rev/6d8ff8c57d38

--
nosy: +python-dev

___
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-13 Thread Sjoerd

New submission from Sjoerd:

I'm sorry for providing very little information, but I don't have the system at 
hand anymore. Therefore I will try to reproduce what I know, hoping that you 
recognise the problem. If not, I will get back to the system and try to obtain 
the necessary information.

Calling liburl2.openurl('http://www.google.com') gave me an getaddrinfo error. 
Therefore, I checked my DNS configuration, which seemed okay and I issued a 
socket.getaddrinfo('www.google.com'), which correctly returned an IP address. 
Finally, I found out that I had an old, non-existing (?) proxy configuration in 
the Windows registry (that indeed turned up when calling liburl2.getproxies()). 
Removing the proxy configuration from my Windows registry solved the problem.

Is it preliminary to conclude that the getaddrinfo error may actually mean 
several things (not only a simple getaddrinfo problem)? If so, I suggest that 
the error message be broadened ("DNS lookup or proxy problem"), because it took 
me several hours to find the proxy problem.

--
components: Library (Lib)
messages: 197629
nosy: SjoerdOptLand
priority: normal
severity: normal
status: open
title: liburl2: bad proxy configuration throws "getaddrinfo" error
type: behavior
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



[issue18937] add unittest assertion for logging

2013-09-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Question: should the default level threshold be INFO or WARNING?
My initial patch uses INFO, but WARNING might be better since that's also 
logging's default level filter when not configured.

--

___
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-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is an alternative C implementation. It adds to the dict class support of 
the __transform__() method. If this method is defined in dict subclass it used 
to transforming keys. collections.TransformDict is just utilizes this feature 
as collections.defaultdict utilizes __missing__(). This patch changes twice 
less C code than previous one (227 vs 474 lines).

--
Added file: http://bugs.python.org/file31749/dict__transform__.patch

___
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-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Does it slow down regular dicts?

I were surprized, but yes. The ComplexPythonFunctionCalls test from pybench is 
40% slower with ctransformdict.patch (and I still don't known why). With 
dict__transform__.patch it is only 2% slower. All other pybench tests are 
approximately equal.

--

___
Python tracker 

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



[issue19013] unittest's own test suite is not CLI-friendly

2013-09-13 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Nothing happens when you try to execute it on the command line:

$ ./python -m unittest.test
/home/antoine/cpython/default/python: No module named unittest.test.__main__; 
'unittest.test' is a package and cannot be directly executed
$ ./python -m unittest.test.test_case
$

--
components: Library (Lib), Tests
messages: 197634
nosy: ezio.melotti, michael.foord, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: unittest's own test suite is not CLI-friendly
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue18059] Add multibyte encoding support to pyexpat

2013-09-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +scoder

___
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-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> > Does it slow down regular dicts?
> 
> I were surprized, but yes. The ComplexPythonFunctionCalls test from
> pybench is 40% slower with ctransformdict.patch (and I still don't
> known why). With dict__transform__.patch it is only 2% slower. All
> other pybench tests are approximately equal.

Did you try any other microbenchmarks? Your approach sounds promising.

--

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-13 Thread R. David Murray

R. David Murray added the comment:

Just to be clear: the reason I am opposed is that the audience for Misc/NEWS is 
different from the audience for commit messages, and I would prefer that the 
text reflect that.  Mine do :)

--

___
Python tracker 

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



[issue18955] Confusing documentation in Lib/importlib/util.py

2013-09-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +brett.cannon
type:  -> enhancement

___
Python tracker 

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



  1   2   >