[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Ethan Furman

Ethan Furman added the comment:

Hopefully the final bit of code, plus docs.

Code changes:  

  _names_ are reserved

  
Doc changes (different from the PEP):

  examples of AutoEnum, UniqueEnum, and OrderedEnum

--
Added file: http://bugs.python.org/file30504/pep-0435.08.stoneleaf.patch

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


Removed file: http://bugs.python.org/file30504/pep-0435.08.stoneleaf.patch

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


Added file: http://bugs.python.org/file30505/pep-0435.08.stoneleaf.patch

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


Removed file: http://bugs.python.org/file30505/pep-0435.08.stoneleaf.patch

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Ethan Furman

Ethan Furman added the comment:

Apologies for the noise -- was having trouble getting the correct patch 
attached.  :/

--
Added file: http://bugs.python.org/file30506/pep-0435.09.stoneleaf.patch

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



[issue18111] Add a default argument to min max

2013-06-08 Thread Phil Connell

Changes by Phil Connell pconn...@gmail.com:


--
nosy: +pconnell

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



[issue18112] PEP 442 implementation

2013-06-08 Thread Phil Connell

Changes by Phil Connell pconn...@gmail.com:


--
nosy: +isoschiz, pconnell

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



[issue18129] Fatal Python error: Cannot recover from stack overflow.

2013-06-08 Thread Phil Connell

Changes by Phil Connell pconn...@gmail.com:


--
nosy: +pconnell

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



[issue16715] Get rid of IOError. Use OSError instead

2013-06-08 Thread koobs

koobs added the comment:

Commit to 3.3 broke at least my FreeBSD buildbot:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%20dtrace%203.3/builds/641/steps/test/logs/stdio

Also setting +Version: Python 3.3 on this.

--
nosy: +koobs
versions: +Python 3.3

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



[issue15528] Better support for finalization with weakrefs

2013-06-08 Thread Łukasz Langa

Łukasz Langa added the comment:

Your patch leaks references with subinterpreters, which was exposed by 
functools.singledispatch using weakref. While the actual bug is in atexit 
(which doesn't properly unregister on subinterpreter termination), now all uses 
of weakref leak.

Context: http://mail.python.org/pipermail/python-dev/2013-June/126755.html

PJE suggests importing atexit and registering finalize only when it's actually 
used. I guess this would be the easiest workaround.

--
assignee:  - sbt
nosy: +lukasz.langa
resolution: fixed - 
status: closed - open

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



[issue16715] Get rid of IOError. Use OSError instead

2013-06-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I don't think so. The idle test, test_idle, passed. The patch did not even 
affect any of the three idle files that it currently tests. Just because a 
commit triggers a test does not mean that it is the cause of any failure that 
happens. The log says the failure was in test_subprocess.
'''
FAIL: test_wait_timeout (test.test_subprocess.ProcessTestCaseNoPoll)
--
Traceback (most recent call last):
  File 
/usr/home/buildbot/python/3.3.koobs-freebsd/build/Lib/test/test_subprocess.py,
 line 953, in test_wait_timeout
p.wait(timeout=0.0001)
AssertionError: TimeoutExpired not raised
'''
As I interpret the traceback, this did not fail is the re-run.

I did not set 3.3, nor reopen, because this patch is primarily part of a new 
issue, #18151. I cross-referenced this one so that if anyone else thought of 
backporting some of the mega patch, this backport would be recorded here.

--

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



[issue18111] Add a default argument to min max

2013-06-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
stage:  - patch review
versions:  -Python 3.5

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



[issue16715] Get rid of IOError. Use OSError instead

2013-06-08 Thread koobs

koobs added the comment:

Apologies for the noise Terry, rebuilding passes. 

Unsetting versions: 3.3

Is the failure on the build I reported worth opening an issue for?

--
versions:  -Python 3.3

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



[issue17343] Add a version of str.split which returns an iterator

2013-06-08 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue7796] No way to find out if an object is an instance of a namedtuple

2013-06-08 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +eric.snow

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



[issue18143] ssl.get_default_verify_paths()

2013-06-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Your raw parameter is one too many IMO. You should find a way to present all 
relevant information in a single API call.

--

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



[issue15528] Better support for finalization with weakrefs

2013-06-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d6ad9d7468f7 by Richard Oudkerk in branch 'default':
Issue #15528: Delay importing atexit until weakref.finalize() used.
http://hg.python.org/cpython/rev/d6ad9d7468f7

--

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Ethan Furman

Ethan Furman added the comment:

So, which is better?

To have a @unique class decorator as part of the module, or to have a 
UniqueEnum recipe in the docs?

A decorator is immediately usable, but requires remembering an extra line of 
code.

An example requires being put into a local utility module, but also serves as a 
guide to customising Enums.  (Took be about five tries to get it right. :/ )

--

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



[issue17375] Add docstrings to methods in the threading module

2013-06-08 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
nosy:  -eli.bendersky

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



[issue1772673] Replacing char* with const char*

2013-06-08 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
nosy:  -eli.bendersky

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Eli Bendersky

Eli Bendersky added the comment:

Nick prudently moved the unique discussion to its own issue - 18042. Let's get 
the initial implementation  docs committed first (without unique in the 
implementation, although it's fine to have it as an example in the docs for 
now), close this issue, and then discuss in 18042 whether unique should be part 
of the stdlib-provided API or not.

--

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Ethan Furman

Ethan Furman added the comment:

Good idea, thanks.

--

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Eli Bendersky

Eli Bendersky added the comment:

I sent a fresh review - nothing major; it's very near commit readiness now. 
Additional changes can be done after the initial commit. We have time until 3.4 
beta (November 2013) to tweak stuff (and the documentation whenever...)

--

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



[issue18042] Provide enum.unique class decorator

2013-06-08 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

+1 for the decorator!

--

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



[issue18042] Provide enum.unique class decorator

2013-06-08 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
nosy: +barry

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



[issue18143] ssl.get_default_verify_paths()

2013-06-08 Thread Christian Heimes

Christian Heimes added the comment:

How about a single return value:

DefaultVerifyPaths = collections.namedtuple(DefaultVerifyPaths,
cafile capath openssl_cafile_env openssl_cafile openssl_capath_env 
openssl_capath)

--

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



[issue15528] Better support for finalization with weakrefs

2013-06-08 Thread Richard Oudkerk

Richard Oudkerk added the comment:

 PJE suggests importing atexit and registering finalize only when it's 
 actually used. I guess this would be the easiest workaround.

Done.

--
status: open - closed

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



[issue8902] add datetime.time.now() for consistency

2013-06-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
versions: +Python 3.4 -Python 3.3

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



[issue18159] ConfigParser getters not available on SectionProxy

2013-06-08 Thread João Bernardo

João Bernardo added the comment:

 Overriding __getattr__ doesn't look like the best solution

Another idea would be to allow the proxy class to be selectable, but this would 
require the user to do much more coding for this simple thing...

I believe a proxy should be dynamic enough to avoid having to duplicate every 
function definition.

--

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



[issue18113] Memory leak in curses.panel

2013-06-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue18110] Nested set comprehensions in class scope fail

2013-06-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
stage:  - needs patch

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



[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2013-06-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti, orsenthil

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



[issue18156] Add an 'attr' attribute to AttributeError

2013-06-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
nosy: +ezio.melotti

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



[issue18152] Idle: add 2.7 backport script

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

 'Import' is as easy to use as Graft and as far as I know, the result 
 when successful is the same.

I use import while importing patches from the tracker, but once I committed on 
2.x it's easier to just graft instead of importing again (importing often 
requires you to generate a new patch and possibly you have to commit manually 
again after the import).

 I know I 'should' learn to use kdiff3 effectively, but it seldom works
 right for me,

That's what learning it is supposed to avoid :)

 and the live repository is the wrong place to learn by failure.

As long as you check the result before pushing there shouldn't be any problems. 
 If the merge goes wrong you can always rollback and try again (or try a 
different approach).  You can also use hg diff -c tip to see the diff of the 
last commit.

--

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



[issue14015] surrogateescape largely missing from documentation

2013-06-08 Thread A.M. Kuchling

Changes by A.M. Kuchling li...@amk.ca:


--
nosy: +akuchling

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



[issue17134] Use Windows' certificate store for CA certs

2013-06-08 Thread Christian Heimes

Christian Heimes added the comment:

New patch with fixed doc string and indention.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa377189%28v=vs.85%29.aspx
 explains how encoding type shall be interpreted. I haven't seen PKCS#7 certs 
on my Windows system, though.

Instead of a flag I could also return a string: CERTIFICATE for 
X509_ASN_ENCODING cert, X509 CRL for X509_ASN_ENCODING CRL or PKCS7 for 
PKCS#7 encoded certs.

--
Added file: http://bugs.python.org/file30507/enumcertstore3.patch

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



[issue18143] ssl.get_default_verify_paths()

2013-06-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 How about a single return value:

 DefaultVerifyPaths = collections.namedtuple(DefaultVerifyPaths,
  cafile capath openssl_cafile_env openssl_cafile openssl_capath_env 
 openssl_capath)

Sounds good.

--

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



[issue14797] Deprecate imp.find_module()/load_module()

2013-06-08 Thread Thomas Heller

Thomas Heller added the comment:

 The modulefinder usage is directly exposed in its API as the return
 value of a find_module method, which makes removal a pain. Adding
 Thomas Heller to see what he has to say.

Some months ago, I have started to implement a brand-new modulefinder,
which is based on importlib.  It has a different API, but the (barely)
documented API functions remain the same or could be made compatible.
The advantage against the current modulefinder is that it finds modules
in zipfiles, for example in zipped eggs.

IMO it is not yet ready for inclusion into Python 3.4, but given the
plans for the first alpha release in August I will hopefully find
time to work on it a little bit more.

If someone wants to read the code, or try it out:

Modulefinder:
http://code.google.com/p/ctypes-stuff/source/browse/trunk/mf/mf4.py

Test:
http://code.google.com/p/ctypes-stuff/source/browse/trunk/mf/maketest.py

Thomas

--

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



[issue18168] plistlib output self-sorted dictionary

2013-06-08 Thread Mher Movsisyan

Mher Movsisyan added the comment:

I think this is not a bug. plistlib api accepts dict (not OrderedDict) and 
sorted output is a valid output. plistlib sorts dictionaries to be consistent 
with Apple's tools.

property list format [1] uses CFDictionary [2] with CFString keys. CFDictionary 
is unordered and the plist example in the format [1] is unordered too. But 
plutil [3] command sorts dictionaries. It is easy to observe by self-converting 
plist files with plutil -convert xml1 test.plist command.

1. 
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/plist.5.html
 

2. 
http://developer.apple.com/library/mac/#documentation/CoreFoundation/Reference/CFDictionaryRef/Reference/reference.html

3. 
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/plutil.1.html

--
nosy: +mher.movsisyan

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



[issue7796] No way to find out if an object is an instance of a namedtuple

2013-06-08 Thread Eric Snow

Eric Snow added the comment:

It may not enough, but the use of namedtuples (vs. plain tuples) with 
functools.singledispatch() would be messier without a NamedTuple ABC (or other 
base type).  Of course, when would you want to dispatch specifically on 
namedtuple?  I can think of a few relatively weak uses, but not enough to 
justify the cost of establishing a common base class for namedtuple.

--

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



[issue18168] plistlib output self-sorted dictionary

2013-06-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +hynek, ned.deily, ronaldoussoren

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



[issue10652] test___all_ + test_tcl fails (Windows installed binary)

2013-06-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
versions: +Python 2.7

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



[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Roman Zeyde

New submission from Roman Zeyde:

Reproduction:

Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
Type help, copyright, credits or license for more information.
 import struct
 struct.pack('!L', 0x01020304)
'\x01\x02\x03\x04'
 struct.pack('L', 0x01020304)
'\x01\x02\x03\x04'
 struct.pack('L', 0x01020304)
'\x04\x03\x02\x01'
 struct.pack('L', 0x01020304)
'\x04\x03\x02\x01\x00\x00\x00\x00' ### WAT??? ###
 

As far as I see at the source code 
(http://hg.python.org/releasing/2.7.4/file/9290822f2280/Modules/_struct.c#l703),
 sizeof(long) is used as the size of 'L', which is equal to 8 at 64bit Linux...

The problem is that the results of packing with 'L' returns 8 bytes,
instead of 4 - as was expected from the documentation...

--
components: Interpreter Core
messages: 190817
nosy: Roman.Zeyde
priority: normal
severity: normal
status: open
title: struct.pack() behaves strangely for 'L' on 64bit Linux
type: behavior
versions: Python 2.7

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



[issue18041] mention issues with code churn in the devguide

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

 I’ve actually seen two contrary kinds of advice

and the best approach is most of the times something in between.  Doing minor 
cleanups while touching the code is fine, but if most of the changes are 
cleanups then it gets distracting.  In that case it's better to do the cleanups 
in a separate commit (either before or after).

Regarding rewrapping paragraphs in the docs the situation is a bit different.  
There are 3 options:
1) change and rewrap in the same commit;
2) change but avoid rewrapping so that the changes are easier to detect;
3) like 2, but then add the rewrapping in a separate commit;

3) is overkill IMHO, and I don't think I've seen it used very often.
2) makes the diff more readable, but leaves the code unwrapped making it less 
readable for everyone else (and I would argue that reading code happens more 
often than reading diffs).
1) makes the diff less readable, but leaves wrapped code and it's IMHO the best 
compromise, and thus what I usually do.


However, I think that the actual problem pointed out in the linked issue is 
about mass changes, rather than cleanups while touching code for other reasons. 
 Even for that it depends on the case: how many files/lines are affected, what 
benefits are brought by the change, how complex are the changes, how likely is 
to introduce new bugs while doing them and so on.

A couple of generic guidelines could be added to the devguide, but there's no 
hard rule for this.

--

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



[issue18034] Last two entries in the programming FAQ are out of date (import related)

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

imp.reload() doesn't seem to be deprecated, and importlib.reload() doesn't 
exist.  Is there another alternative or it just hasn't been moved somewhere 
else?

--

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



[issue4153] Unicode HOWTO up to date?

2013-06-08 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Continuing my tour of the howtos, here's a patch making many of the changes 
discussed here and on issue13997.  Changes made:

* state that python3 source encoding is UTF-8, and give examples

* mention surrogateescape in the 'tips and tricks' section, and 
backslashreplace in the Python's Unicode Support section.

* default filesystem encoding is now UTF-8, not ascii.

* link to Nick Coghlan's and Ned Batchelder's notes/presentations.

* remove revision history

* remove usage of I think, I'm not going to, etc.

* update acks section

Things I did *not* do, though they were suggested:

* Move tip Software should only work with Unicode strings internally from the 
last section to somewhere earlier and more prominent.  Perhaps it could go 
somewhere in the Python's Unicode Support section.

* mention codecs.StreamRecoder and StreamReaderWriter (I could put this in 
'tips and tricks').

* Examples should be properly marked up to allow sphinx to run them and check 
the output.  (May not be possible.)

* mention unicode support in re module

* clarify some more terms (e.g. codepoints, code units, characters, possibly 
scalar values etc.) -- I don't see why they matter, since we don't use them.

--
Added file: http://bugs.python.org/file30508/unicode-howto.txt

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



[issue18036] How do I create a .pyc file? FAQ entry is out of date

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

FTR here's a link to the FAQ: 
http://docs.python.org/3/faq/programming.html#how-do-i-create-a-pyc-file

--
keywords: +easy

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



[issue18034] Last two entries in the programming FAQ are out of date (import related)

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

FTR here is a link to the FAQs: 
http://docs.python.org/3/faq/programming.html#import-x-y-z-returns-module-x-how-do-i-get-z

--

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



[issue18033] Example for Profile Module shows incorrect method

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

Thanks for the patches, however the Python 2 example doesn't work.
I think a BytesIO should be used instead of a StringIO, and print_stats() only 
returns a pstats.Stats instance, without actually printing any result.
I wonder if print_results was an old method that has been removed and if now 
there's another way to print the results.
I haven't tried on Python 3 yet, but the same comment might apply there too.

--
stage: needs patch - patch review
versions: +Python 3.3

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



[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Stefan Krah

Stefan Krah added the comment:

The docs say:

Native size and alignment are determined using the C compiler’s sizeof 
expression. This is always combined with native byte order.


sizeof(long) is 8 on your platform, so I don't see anything wrong here.
Or is another part of the documentation unclear?

--
nosy: +skrah
status: open - pending
type: behavior - 

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



[issue17691] Fix test discovery for test_univnewlines.py

2013-06-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a2e093e98d45 by Ezio Melotti in branch '3.3':
#17691: test_univnewlines now works with unittest test discovery.  Patch by 
Zachary Ware.
http://hg.python.org/cpython/rev/a2e093e98d45

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

--
nosy: +python-dev

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



[issue17691] Fix test discovery for test_univnewlines.py

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

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

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



[issue18048] Merging test_pep263.py and test_coding.py

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

 e.g. test_source_encoding

This SGTM.  I particularly dislike test_pep*, especially when I can't remember 
the pep number.

--

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



[issue12226] use HTTPS by default for uploading packages to pypi

2013-06-08 Thread anatoly techtonik

anatoly techtonik added the comment:

This should have been backported to Python 2. I expect some related attacks on 
EuroPython.

--

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



[issue18124] Broken build on target machine with incorrect hostname (non-ascii)

2013-06-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage:  - committed/rejected

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



[issue18126] Update links to NumPy resources in documentation

2013-06-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dacd8f430e0e by Ezio Melotti in branch '2.7':
#18126: update NumPy links in the documentation.  Patch by Yury V. Zaytsev.
http://hg.python.org/cpython/rev/dacd8f430e0e

New changeset aafa11c1dd61 by Ezio Melotti in branch '3.3':
#18126: update NumPy links in the documentation.  Patch by Yury V. Zaytsev.
http://hg.python.org/cpython/rev/aafa11c1dd61

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

--
nosy: +python-dev

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



[issue18126] Update links to NumPy resources in documentation

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!

--
assignee: docs@python - ezio.melotti
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue17691] Fix test discovery for test_univnewlines.py

2013-06-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
assignee:  - ezio.melotti

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



[issue18053] Add checks for Misc/NEWS in make patchcheck

2013-06-08 Thread Ezio Melotti

Ezio Melotti added the comment:

Not sure it's worth making the logic more complicated just to save one line in 
some occasions.  Hiding the messages about configure and pyconfig.h.in when 
they are not needed would save two lines and it should be simpler to do, but if 
you have something specific in mind feel free to propose a patch.

--

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



[issue12226] use HTTPS by default for uploading packages to pypi

2013-06-08 Thread Donald Stufft

Donald Stufft added the comment:

I would +! backporting this, but It's not massively required since it only 
protects against passive attacks.

It would however make things a little nicer.

--

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



[issue12226] use HTTPS by default for uploading packages to pypi

2013-06-08 Thread anatoly techtonik

anatoly techtonik added the comment:

If somebody sponsor my visit to EuroPython, I will dedicate some time to 
prepare a demo uploading rogue packages using sniffed credentials over WiFi 
without owner's consent. After moving to CDN no upload logs are available, so 
it is even more secure for attacker to do this stuff.

--

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



[issue12226] use HTTPS by default for uploading packages to pypi

2013-06-08 Thread Donald Stufft

Donald Stufft added the comment:

Uploading always hits the backend servers and thus has the same logging as 
before

Merely switching to HTTPS only provides protections against passive attacks. 
You need verification to protect against active attacks (which are simple and 
easy to do as well). Like I said, not a bad move and I'd be in agreement on 
doing it but if the powers that be decide it's too big of a change it's not 
going to massively decrease the security.

--

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



[issue18034] Last two entries in the programming FAQ are out of date (import related)

2013-06-08 Thread Brett Cannon

Brett Cannon added the comment:

Hasn't been moved yet. And the __import__ question should probably be rephrased 
as don't do this.

--

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



[issue18034] Last two entries in the programming FAQ are out of date (import related)

2013-06-08 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
dependencies: +Document/deprecate imp

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



[issue4153] Unicode HOWTO up to date?

2013-06-08 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Updated version of my patch, which adds two more todo items and handles Ezio's 
review comments:

* Switch from Greek examples to French, and remove non-Latin-1 characters.

* Change language for bytes.decode to but supports a few more possible 
handlers.

* Describe Unicode support in the re module.

* Describe StreamRecoder.  I don't see why StreamReaderWriter would need to be 
mentioned.

I do not intend to do the remaining items on the todo list (clarify some more 
terms; make it work with doctest).

--
Added file: http://bugs.python.org/file30509/unicode-howto.txt

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



[issue18106] There are unused variables in Lib/test/test_collections.py

2013-06-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +rhettinger

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



[issue18038] Unhelpful error message on invalid encoding specification

2013-06-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee:  - serhiy.storchaka

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



[issue18101] Tk.split() doesn't work with nested Unicode strings

2013-06-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee:  - serhiy.storchaka

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



[issue6632] Include more fullwidth chars in the decimal codec

2013-06-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +lukasz.langa

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



[issue18170] define built-in exceptions in Python code

2013-06-08 Thread Brett Cannon

New submission from Brett Cannon:

This quite possibly won't work because of performance, but I have been 
wondering how feasible it would be to define as many core exception types as 
possible in pure Python code and then freeze the module for loading. It would 
have the benefit of making maintenance easier (e.g. all of the PEP 3151 
exceptions would have been simpler to add). It also would make it easier on 
other VMs by minimizing the number of exceptions that have to be written in 
their implementation language.

Implementation-wise, it's probably easiest to start with leaf exceptions in the 
inheritance hierarchy and then slowly port more and more. Any exceptions ported 
to pure Python would have their PyExc_* variable set to their parent so that 
the variable is initialized to some exception before any Python code is 
touched. The real trick will come down to dealing with situations where some 
specific C API has been exposed (e.g. UnicodeError).

Even if this experiment turns out to be feasible and reasonable in terms of 
simplifying C code, the other question is performance. If this costs more than 
a couple percent of overall performance (and quite possibly not even at that 
expense) this would not be worth it.

--
components: Interpreter Core
messages: 190837
nosy: brett.cannon
priority: low
severity: normal
stage: needs patch
status: open
title: define built-in exceptions in Python code
type: enhancement
versions: Python 3.4

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



[issue18053] Add checks for Misc/NEWS in make patchcheck

2013-06-08 Thread R. David Murray

R. David Murray added the comment:

It's not about saving lines in the output, it's about saving space in the 
developer's brain/workflow efficiency.  That said, it is only valuable if it is 
reasonably reliable.

--

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



[issue18111] Add a default argument to min max

2013-06-08 Thread Julian Berman

Julian Berman added the comment:

New patchset addressing review. Not sure why upload.py isn't working for me (I 
assume it should?)

--
Added file: http://bugs.python.org/file30510/minmax.patch

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



[issue18162] Add index attribute to IndexError

2013-06-08 Thread Éric Araujo

Éric Araujo added the comment:

regex?  do you mean weakref?

--
nosy: +eric.araujo

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



[issue4153] Unicode HOWTO up to date?

2013-06-08 Thread Nick Coghlan

Nick Coghlan added the comment:

amk's latest patch looks like a very nice improvement to me.

One suggested wording tweak for the aside about the simplified
history: s/The average Python programmer doesn't need to know the
historical details/The precise historical details aren't relevant to
understanding how to use Unicode effectively/ (and then continue with
; if you're curious ... as it does now)

--

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Ethan Furman

Ethan Furman added the comment:

Doc updates are in.

I removed the 'unique, constant' from the first line of the intro, as neither 
of those things are necessarily true.

--
Added file: http://bugs.python.org/file30511/pep-0435.10.stoneleaf.patch

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



[issue18081] test_logging failure in WarningsTest on buildbots

2013-06-08 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18054] Add more exception related assertions to unittest

2013-06-08 Thread Robert Collins

Robert Collins added the comment:

Hey, feel free to +nosy me on unittest things :). Julian pinged me on IRC about 
this - Jml and I would be delight to prepare a patchset for assertThat for 
unittest and as much of the core of Matchers as makes sense. The bare core can 
come in without any of the things that Michael is concerned about vis-a-vis 
unneeded complexity in testtools [e.g. nothing about arbitrary attachments is 
needed].

We can state from experience - both ours and users that have adopted it - that 
the decoupling assertThat brings is very effective at ending the 
forced-hierarchy-or-mixin mess that self-homed assertions brings. A while back 
we rewrote the entire core of testtools own assertions to be Matcher based :).

https://testtools.readthedocs.org/en/latest/for-test-authors.html#matchers has 
the documentation on the Matcher protocol and what it looks like for users.

Structurally, we decouple the raising of AssertionError from the act of 
determining whether a particular condition is met - this frees one from needing 
to have a reference to a test case to honour failureException, and from needing 
to subclass to share condition logic - unrelated test classes can how share 
condition logic by sharing a matcher definition.

It also lends itself rather naturally to higher order definitions of matchers, 
as matchers are now standalone objects with no required connection to a test 
case : you can curry and compose matchers easily.

We make matchers have a nice __str__, so that their structure can be printed 
out by assertThat when an error has occurred even if they have been curried or 
compose or defined much earlier.

So - is there some interest in this? If so, I can put together a patchset with 
just the core, and let you see what it looks like.

--
nosy: +rbcollins

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-06-08 Thread Ethan Furman

Ethan Furman added the comment:

Hmm -- I was confusing member names with member values;  I'll put 'unique' back 
in.

--

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