[issue8853] getaddrinfo should accept port of type long

2012-12-19 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread anatoly techtonik

New submission from anatoly techtonik:

http://docs.python.org/3/library/binascii

- binascii.hexlify(data)
+ binascii.hexlify(bytes)

tag:easy

--
assignee: docs@python
components: Documentation
messages: 177727
nosy: docs@python, techtonik
priority: normal
severity: normal
status: open
title: Rename `data` argument names to `bytes`
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Why? The binascii module consistently uses "data" to refer to binary data. For 
example: 
"Return the hexadecimal representation of the binary data. Every byte of data 
is converted ..."

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Hum, io objects are not supposed to close themselves when they run out of data.
Even if HTTPResponse chooses to close the underlying socket (to clean unused 
resources?), it should not report itself as a closed io.IOBase.
Subsequent calls read() should return b"", this is the io.RawIOBase way to 
indicate EOF.

To fix this particular example, it seems enough to delete the "@property def 
closed(self)" from HTTPResponse. Note the XXX just above:
"""
# XXX This class should probably be revised to act more like
# the "raw stream" that BufferedReader expects.
"""
But close() should be modified as well, and internal calls to close() should be 
changed to only close the underlying socket.

--
nosy: +amaury.forgeotdarc, pitrou

___
Python tracker 

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



[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2012-12-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks as a known bug in io.TextIOWrapper which call read() even previous 
read() returned an empty data. There was a related issue, I can't found it now.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue15112] argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional

2012-12-19 Thread Tim Cuthbertson

Changes by Tim Cuthbertson :


--
nosy: +gfxmonk

___
Python tracker 

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2012-12-19 Thread Tim Cuthbertson

Changes by Tim Cuthbertson :


--
nosy: +gfxmonk

___
Python tracker 

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



[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

buffer.read() never returns empty data in this case.

--

___
Python tracker 

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



[issue16725] Add 'ident' property to SysLogHandler like in Python 3.x

2012-12-19 Thread Jakob Eriksson

New submission from Jakob Eriksson:

Can we have the same ident property for the SysLogHandler in the Python 2.7 
library, like it was introduced in the 3.x library?


( Like http://hg.python.org/cpython/rev/6baa90fa2b6d )

--
components: Library (Lib)
hgrepos: 165
messages: 177732
nosy: b-jakob-v
priority: normal
severity: normal
status: open
title: Add 'ident' property to SysLogHandler like in Python 3.x
versions: Python 2.7

___
Python tracker 

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



[issue16725] Add 'ident' property to SysLogHandler like in Python 3.x

2012-12-19 Thread Jakob Eriksson

Changes by Jakob Eriksson :


--
type:  -> enhancement

___
Python tracker 

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



[issue16726] expat ParseFile expects bytes, not string

2012-12-19 Thread Michiel de Hoon

New submission from Michiel de Hoon:

The expat parser in xml.parsers.expat has a Parse method and a ParseFile 
method. The Parse method parses a string, however the ParseFile method wants 
bytes.

This is a minimal example of the Parse method:

>>> import xml.parsers.expat
>>> p = xml.parsers.expat.ParserCreate()
>>> p.Parse('')

which runs fine. Note that argument to p.Parse is a string, not bytes.

This is the corresponding example of ParseFile:

>>> import xml.parsers.expat
>>> handle = open("test.xml")
>>> p = xml.parsers.expat.ParserCreate()
>>> p.ParseFile(handle)

where the file test.xml only contains 
This gives an error:

Traceback (most recent call last):
  File "", line 1, in 
TypeError: read() did not return a bytes object (type=str)

Opening the file test.xml in binary raises an Error:

>>> import xml.parsers.expat
>>> handle = open("test.xml", "rb")
>>> p = xml.parsers.expat.ParserCreate()
>>> p.ParseFile(handle)
Traceback (most recent call last):
  File "", line 1, in 
xml.parsers.expat.ExpatError: no element found: line 2, column 0

suggesting that in reality, the expat Parser needs a string, not bytes.
(the same error appears with a more meaningful XML file).

I would expect that both Parse and ParseFile accept strings, but not bytes.

--
messages: 177733
nosy: mdehoon
priority: normal
severity: normal
status: open
title: expat ParseFile expects bytes, not string
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue16725] Add 'ident' property to SysLogHandler like in Python 3.x

2012-12-19 Thread R. David Murray

R. David Murray added the comment:

No, that would be a feature addition, and we don't do those in bug fix releases.

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

___
Python tracker 

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



[issue15565] pdb displays runt Exception strings

2012-12-19 Thread Hamish Downer

Hamish Downer added the comment:

The bug affects me on python 2.7, as described by the original reporter.

I am using Ubuntu 12.04 which comes with python 2.7.3 - was this fixed for 2.7 
quite recently?

However the python 3.2 that is packaged for Ubuntu 12.04 does not suffer from 
this bug.

--
nosy: +Hamish.Downer

___
Python tracker 

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



[issue16727] Windows installers for 2.7.3 don't install python27.dll correctly

2012-12-19 Thread Keith Sabine

New submission from Keith Sabine:

The windows installers for Python 2.7.3 do not install the required 
python27.dll correctly.

The Windows x86 MSI Installer (2.7.3) does not install a 32 bit python27.dll in 
windows\system32 at all.

The Windows x86-64 MSI Installer (2.7.3) installs a 64 bit python27.dll in 
windows\system32, NOT in windows\SysWOW64 as it should.

The python27.dll should be kept in the python DLLs directory for both 32 and 64 
bit versions, so users can clean up the mess if they need to...

--
components: Windows
messages: 177736
nosy: keith969
priority: normal
severity: normal
status: open
title: Windows installers for 2.7.3 don't install python27.dll correctly
versions: Python 2.7

___
Python tracker 

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



[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread INADA Naoki

New submission from INADA Naoki:

http://docs.python.org/3.3/glossary.html#term-sequence

__getitem__ and __len__ are required for sequence type.
(__iter__ is not required because types having __getitem__ are already 
iterator.)

.__contains__(), .index() and .count() is not required for sequence.

For example, following class should be sequence.

class Foo:
def __getitem__(self, index):
if not isinstance(index, int):
raise TypeError
if index >= 3:
raise IndexError
return index

def __len__(self):
return 3

--
components: Library (Lib)
messages: 177737
nosy: naoki
priority: normal
severity: normal
status: open
title: collections.abc.Sequence shoud provide __subclasshook__
versions: Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread INADA Naoki

INADA Naoki added the comment:

In Python 3.3:

In [33]: issubclass(Foo, collections.abc.Sequence)
Out[33]: False

--

___
Python tracker 

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



[issue16719] Get rid of WindowsError. Use OSError instead

2012-12-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bb94f6222fef by Andrew Svetlov in branch 'default':
Issue #16719: Get rid of WindowsError. Use OSError instead
http://hg.python.org/cpython/rev/bb94f6222fef

--
nosy: +python-dev

___
Python tracker 

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



[issue16719] Get rid of WindowsError. Use OSError instead

2012-12-19 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Sorry, Brian. I missed that you assign issue to yourself.
Committed patch contributed by Serhiy.

Close the issue. Feel free to reopen if needed.

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

___
Python tracker 

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



[issue13615] setup.py register fails with -r argument

2012-12-19 Thread anatoly techtonik

anatoly techtonik added the comment:

Soo..

--

___
Python tracker 

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



[issue16726] expat ParseFile expects bytes, not string

2012-12-19 Thread Wibowo Arindrarto

Changes by Wibowo Arindrarto :


--
nosy: +bow

___
Python tracker 

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



[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2012-12-19 Thread Wibowo Arindrarto

Changes by Wibowo Arindrarto :


--
nosy: +bow

___
Python tracker 

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



[issue16729] Document how to provide defaults for setup.py commands options

2012-12-19 Thread anatoly techtonik

New submission from anatoly techtonik:

The way to override defaults for setup.py commands is not documented. For 
example, to change to name of build and dist dirs from setup.py, the following 
entry should be added to setup parameters:

options={
'build': {'build_base': '__build__'},
'sdist': {'dist_dir': '__build__/dist'},
}

An example would be extremely helpful at
http://docs.python.org/2/install/index.html#how-building-works

tag:easy
http://thread.gmane.org/gmane.comp.python.distutils.devel/16434
issue16299

--
assignee: eric.araujo
components: Distutils, Distutils2, Documentation
messages: 177742
nosy: alexis, eric.araujo, tarek, techtonik
priority: normal
severity: normal
status: open
title: Document how to provide defaults for setup.py commands options
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

___
Python tracker 

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



[issue8853] getaddrinfo should accept port of type long

2012-12-19 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
stage: test needed -> patch review

___
Python tracker 

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



[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2012-12-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed.

--

___
Python tracker 

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



[issue8853] getaddrinfo should accept port of type long

2012-12-19 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Attached a new patch with a test case and fixed error handling.

--
Added file: http://bugs.python.org/file28358/issue8853_v2.patch

___
Python tracker 

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



[issue16730] _fill_cache in _bootstrap.py crashes without directory execute permissions

2012-12-19 Thread David Pritchard

New submission from David Pritchard:

In importlib/_bootstrap.py, there is a function _fill_cache which crashes when 
you try to run Python in any environment that is so restricted that write 
permissions are not allowed. You get a trace like:

Traceback (most recent call last):
  In line:
[the import statement]
  File "", line 1558, in _find_and_load
  File "", line 1516, in _find_and_load_unlocked
  File "", line 1470, in _find_module
  File "", line 1305, in find_module
  File "", line 1284, in _get_loader
  File "", line 1356, in find_loader
  File "", line 1392, in _fill_cache
PermissionError: [Errno 13] Permission denied: '[the directory name]'

This was not an issue when I was using Python 3.2 and I suspect it has to do 
with the OS error refactoring. I believe it can be fixed with a two-line patch, 
attached. (Sorry if it is the wrong format, it's the first one I've submitted.) 
The patch simply treats the case of PermissionError the same was as it does 
when there is a FileNotFoundError. I've tested the patch and it fixes the 
problem.

--
components: Interpreter Core
files: _bootstrap.py.patch
keywords: patch
messages: 177745
nosy: David.Pritchard
priority: normal
severity: normal
status: open
title: _fill_cache in _bootstrap.py crashes without directory execute 
permissions
versions: Python 3.3
Added file: http://bugs.python.org/file28359/_bootstrap.py.patch

___
Python tracker 

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



[issue16730] _fill_cache in _bootstrap.py crashes without directory execute permissions

2012-12-19 Thread David Pritchard

David Pritchard added the comment:

Sorry, in the main text of my message, "write permissions" should say directory 
execute permissions (permission to list contents of a directory)

--

___
Python tracker 

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



[issue16730] _fill_cache in _bootstrap.py crashes without directory execute permissions

2012-12-19 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy: +pitrou

___
Python tracker 

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



[issue15533] subprocess.Popen(cwd) documentation

2012-12-19 Thread Jan Lachnitt

Jan Lachnitt added the comment:

Hi all,

I have solved the problem by using absolute path of the executable. The reason 
why the executable didn't work properly may be that the executable's relative 
path was inconsistent with current directory. See the following example (I have 
made an executable which shows its argv and cwd). If it is called normally, 
then:

argv[0] = phsh0.exe
cwd = D:\Jenda\AutoLEED\TESTING\default

But if it is called by Python's subprocess.call from 
"D:\Jenda\AutoLEED\TESTING" as I want, then:

argv[0] = default\phsh0.exe
cwd = D:\Jenda\AutoLEED\TESTING\default

The executable may be confused by this inconsistency. So it is not the 
documentation, but Python itself what should be changed. The executable should 
be searched in cwd on any platform to avoid the inconsistency.

I have not yet updated my Python installation, so my results apply to 3.2.3.

--

___
Python tracker 

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



[issue14266] pyunit script as shorthand for python -m unittest

2012-12-19 Thread Berker Peksag

Berker Peksag added the comment:

Antoine and Éric: Thank you for the reviews and suggestions.

> Why the "__unittest" variable?

I added the "__unittest" variable after read issue 7815 and the related
changeset: http://hg.python.org/cpython/rev/2858cae540e4/

See also:
- 
http://stackoverflow.com/questions/12583015/how-can-i-hide-my-stack-frames-in-a-testcase-subclass
- https://github.com/nose-devs/nose2/pull/28/files

However, without the variable tracebacks are still clear:

$ pyunit -v
test_acc (test_bar.TestAcc) ... ok
test_acc_negative (test_bar.TestAccNegative) ... ok
test_mul (test_foo.TestMul) ... ok
test_mul_negative (test_foo.TestMulNegative) ... ok
test_mul (test_baz.TestMul) ... FAIL

==
FAIL: test_mul (test_baz.TestMul)
--
Traceback (most recent call last):
  File "/home/berker/hacking/cpython/test_baz.py", line 12, in test_mul
self.assertEqual(3, mul(2, 2))
AssertionError: 3 != 4

--
Ran 5 tests in 0.002s

FAILED (failures=1)

> Also, it would be better to make unittest's API more flexible, rather
> than manually tweaking sys.argv to enable discovery.

You're right. Something like that? unittest.main(discover=True)

> About the script: can’t it be as simple as runpy.run_module?

I will try that, thanks.

--

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread anatoly techtonik

anatoly techtonik added the comment:

In Python 2 there was no 'binary data' type - everything was a string. Now we 
have string, str, bytearray, array, list of ints. If hexlify is not accepting 
anything except bytes, it is better be explicit.

When porting code from Python 2 the argument was passed as a string with 
escapes inside, so it took some time to figure out why it didn't work in Py3k 
(actually it took a lot of time, because the research path turned wrong way at 
this point).

--

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

> If hexlify is not accepting anything except bytes, it is better be explicit.

But it is very explicit in the link you provided: both a note at the top, and 
the words "binary data" in the description of every function.

--

___
Python tracker 

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



[issue13153] IDLE crashes when pasting non-BMP unicode char on UCS-16 build

2012-12-19 Thread Chris Angelico

Chris Angelico added the comment:

I'm experiencing a similar issue. Fresh install of 3.3 today from the .msi 
installer on the web site, identifies itself as:
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit 
(Intel)] on win32

To reproduce: Copy and paste this character into IDLE. 𝐇

C:\Python33>.\python -m idlelib.idle
Traceback (most recent call last):
  File "C:\Python33\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "C:\Python33\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
  File "C:\Python33\lib\idlelib\idle.py", line 11, in 
idlelib.PyShell.main()
  File "C:\Python33\lib\idlelib\PyShell.py", line 1477, in main
root.mainloop()
  File "C:\Python33\lib\tkinter\__init__.py", line 1038, in mainloop
self.tk.mainloop(n)
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 0-2: invalid 
continuation byte


(Incidentally, there appears to be a slight difference depending on whether I 
copy the character in Chrome or Firefox. IDLE terminates the same way, but a 
Latin-1 app sees the character from Firefox as a letter, but the same thing 
from Chrome is two question marks (presumably the surrogates).)

--
nosy: +Rosuav

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

> If hexlify is not accepting anything except bytes, it is better be explicit.

But it is very explicit in the link you provided: both a note at the top, and 
the words "binary data" in the description of every function.

--

___
Python tracker 

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



[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Careful, though: dict also provides these methods, but I would not consider it 
a Sequence.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue16727] Windows installers for 2.7.3 don't install python27.dll correctly

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Did you select an option like "install for all users"/"install just for me" at 
some point?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue16714] Raise exceptions, don't throw

2012-12-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I found one error. In Lib/email/header.py for 2.7 'raise' should be
reverted to 'throw'.

Also I miss a past form. Second patch replaces 'threw' with 'raised'.

--
Added file: http://bugs.python.org/file28360/throw_away.patch
Added file: http://bugs.python.org/file28361/throw2raised.patch
Added file: http://bugs.python.org/file28362/throw2raised-3.2.patch

___
Python tracker 

___diff -r 8c2635afbfe1 Lib/email/header.py
--- a/Lib/email/header.py   Tue Dec 18 21:27:37 2012 +0200
+++ b/Lib/email/header.py   Wed Dec 19 18:00:22 2012 +0200
@@ -103,7 +103,7 @@
 dec = email.base64mime.decode(encoded)
 except binascii.Error:
 # Turn this into a higher level exception.  BAW: Right
-# now we raise the lower level exception away but
+# now we throw the lower level exception away but
 # when/if we get exception chaining, we'll preserve it.
 raise HeaderParseError
 if dec is None:
diff -r bb94f6222fef Lib/pkgutil.py
--- a/Lib/pkgutil.pyWed Dec 19 14:33:35 2012 +0200
+++ b/Lib/pkgutil.pyWed Dec 19 18:11:03 2012 +0200
@@ -503,7 +503,7 @@
 except (ImportError, AttributeError, TypeError, ValueError) as ex:
 # This hack fixes an impedance mismatch between pkgutil and
 # importlib, where the latter raises other errors for cases where
-# pkgutil previously threw ImportError
+# pkgutil previously raised ImportError
 msg = "Error while finding loader for {!r} ({}: {})"
 raise ImportError(msg.format(fullname, type(ex), ex)) from ex
 
diff -r bb94f6222fef Lib/test/test_urllib2.py
--- a/Lib/test/test_urllib2.py  Wed Dec 19 14:33:35 2012 +0200
+++ b/Lib/test/test_urllib2.py  Wed Dec 19 18:11:03 2012 +0200
@@ -1302,7 +1302,7 @@
   )
 
 def test_basic_and_digest_auth_handlers(self):
-# HTTPDigestAuthHandler threw an exception if it couldn't handle a 40*
+# HTTPDigestAuthHandler raised an exception if it couldn't handle a 40*
 # response (http://python.org/sf/1479302), where it should instead
 # return None to allow another handler (especially
 # HTTPBasicAuthHandler) to handle the response.
diff -r bb94f6222fef Lib/test/test_winreg.py
--- a/Lib/test/test_winreg.py   Wed Dec 19 14:33:35 2012 +0200
+++ b/Lib/test/test_winreg.py   Wed Dec 19 18:11:03 2012 +0200
@@ -277,7 +277,7 @@
 
 def test_long_key(self):
 # Issue2810, in 2.6 and 3.1 when the key name was exactly 256
-# characters, EnumKey threw "WindowsError: More data is
+# characters, EnumKey raised "WindowsError: More data is
 # available"
 name = 'x'*256
 try:
diff -r cf62fbf2171a Lib/test/test_urllib2.py
--- a/Lib/test/test_urllib2.py  Fri Nov 02 07:34:37 2012 +0100
+++ b/Lib/test/test_urllib2.py  Wed Dec 19 18:15:49 2012 +0200
@@ -1252,7 +1252,7 @@
   )
 
 def test_basic_and_digest_auth_handlers(self):
-# HTTPDigestAuthHandler threw an exception if it couldn't handle a 40*
+# HTTPDigestAuthHandler raised an exception if it couldn't handle a 40*
 # response (http://python.org/sf/1479302), where it should instead
 # return None to allow another handler (especially
 # HTTPBasicAuthHandler) to handle the response.
diff -r cf62fbf2171a Lib/test/test_winreg.py
--- a/Lib/test/test_winreg.py   Fri Nov 02 07:34:37 2012 +0100
+++ b/Lib/test/test_winreg.py   Wed Dec 19 18:15:49 2012 +0200
@@ -277,7 +277,7 @@
 
 def test_long_key(self):
 # Issue2810, in 2.6 and 3.1 when the key name was exactly 256
-# characters, EnumKey threw "WindowsError: More data is
+# characters, EnumKey raised "WindowsError: More data is
 # available"
 name = 'x'*256
 try:
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I agree: the docs is good and don't needed to be modified.

--
nosy: +asvetlov

___
Python tracker 

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



[issue16727] Windows installers for 2.7.3 don't install python27.dll correctly

2012-12-19 Thread Keith Sabine

Keith Sabine added the comment:

I selected "install for all users", even though there is only one...

--

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread anatoly techtonik

anatoly techtonik added the comment:

Fact no.1: When people use docs as a reference, they don't read top notes.

Face no.2:
This is not explicit:
  binascii.hexlify(data)
This is:
  binascii.hexlify(bytes)

I understand that you like the wording in description, but can't understand why 
don't want to fix this stuff above.

--

___
Python tracker 

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



[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread Michele Orrù

Changes by Michele Orrù :


--
nosy: +maker

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

> When people use docs as a reference, they don't read top notes.
Maybe, but they can read some words beyond the function name, can't they?

--

___
Python tracker 

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



[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread INADA Naoki

INADA Naoki added the comment:

I think PySequence_Check() has same problem.

OTOH, mapping definition says:

> A container object that supports arbitrary key lookups and implements the 
> methods specified in the Mapping or MutableMapping abstract base classes.
- http://docs.python.org/3.3/glossary.html#term-mapping

So the mapping should implement all methods defined in collections.abc.Mapping.

If the sequence should implement all methods defined in 
collections.abc.Sequence, it's a documentation bug.

Is there a common view about what is the sequence?

--

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> If hexlify is not accepting anything except bytes, it is better be explicit.

However hexlify is accepting something except bytes. It is accepting any object 
which supports buffer protocol.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> If hexlify is not accepting anything except bytes, it is better be explicit.

However hexlify is accepting something except bytes. It is accepting any object 
which supports buffer protocol.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> If hexlify is not accepting anything except bytes, it is better be explicit.

However hexlify is accepting something except bytes. It is accepting any object 
which supports buffer protocol.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread R. David Murray

R. David Murray added the comment:

We do not use data type names as formal parameter names.  You will realize this 
is sensible if you consider that in most cases in Python the formal parameter 
name is something gets used in more than just the documentation, and that using 
a type name would shadow the type name, which is something we prefer to avoid.

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

___
Python tracker 

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



[issue16724] Define `binary data` representation in Python

2012-12-19 Thread anatoly techtonik

anatoly techtonik added the comment:

The fact that array.array, bytearray and memoryview are also accepted is a 
surprise for me. It will help if Python docs contained a definition of what can 
be considered 'binary data' and link this term from hexlify description to this 
definition.

--
resolution: invalid -> 
status: closed -> open
title: Rename `data` argument names to `bytes` -> Define `binary data` 
representation in Python

___
Python tracker 

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



[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-19 Thread Daniel Shahaf

Daniel Shahaf added the comment:

Re the problem from msg 177134 ('./python -mtest test___all__ test_xml_etree' 
failing), it is a a preexisting problem, in the sense that applying just the 
Lib/test/ part of this patch suffices to trigger it.  Adding 'xml.etree' to the 
blacklist in test___all__.py:50 suffices to address the problem.  At a guess 
that is because when test___all__ imports the 'xml.etree' module, it doesn't 
filter out the '_elementtree' symbol like test_xml_etree.py:test_main() does.

New patch attached; differences to previous version:

- Removed debug prints.
- Skip test_pickling when testing the Python xml.etree.
  (The skips could be removed in the future, if/when the test___all__
  interaction problem is resolved.)

--
Added file: http://bugs.python.org/file28363/i16076-v5.diff

___
Python tracker 

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



[issue16724] Define `binary data` representation in Python

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Isn't such a definition already present in the top-level paragraphs?

--

___
Python tracker 

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



[issue16718] Mysterious atexit fail

2012-12-19 Thread anatoly techtonik

anatoly techtonik added the comment:

This is not repeatable in Python 3. Is it possible to fix it for Python 2 as 
well?

Is it possible to postpone registration until the import is finished 
successfully? Or at least give atexit handler a chance to run before global 
variable stack is purged? Or destroy atexit handler if its namespace is purged?

--

___
Python tracker 

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



[issue16730] _fill_cache in _bootstrap.py crashes without directory execute permissions

2012-12-19 Thread Eric Snow

Eric Snow added the comment:

Patch looks good to me.  Are there any other exceptions that might be included 
here?

--
nosy: +brett.cannon, eric.snow

___
Python tracker 

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



[issue16721] configure incorrectly adds -OPT:Olimit=0 for clang

2012-12-19 Thread Stefan Krah

Stefan Krah added the comment:

If Irix support is the reason for the Olimit test, perhaps we can limit
the check to Irix?

http://www.gossamer-threads.com/lists/python/dev/689524?do=post_view_threaded#689524

--
nosy: +skrah

___
Python tracker 

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



[issue16690] Reference leak with custom tp_dealloc in PyType_FromSpec

2012-12-19 Thread Bradley Froehle

Changes by Bradley Froehle :


--
nosy: +pitrou

___
Python tracker 

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



[issue16686] audioop overflow issues

2012-12-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

6. reverse() and ratecv() lose 16 lowest bits for 4-bytes data.

7. rms() can returns negative value (-0x8000 instead 0x8000).

8. maxpp() and avgpp() overflow and return absolutely wrong result for large 
peaks.

9. ratecv() crashes Python on empty input.

--
type: behavior -> crash

___
Python tracker 

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



[issue16718] Mysterious atexit fail

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Infortunately, the behaviour is the same in 2.7 and 3.2, and only changes with 
3.3, which means that this is probably related to the new implementation of the 
import system.
This won't be backported.

[It would be interesting to understand why there is a difference, btw... is a 
reference to the module held somewhere?]

A possible workaround for such module-level calls atexit.register() is to 
ensure that used globals are captured in the function namespace, a bit like 
some __del__ methods:

def _clean(_Cleanup=_Cleanup):


--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue16731] xxlimited/xxmodule docstrings ambiguous

2012-12-19 Thread Daniel Shahaf

New submission from Daniel Shahaf:

Tweak the docstrings of xxmodule and xxlimited to clarify the difference 
between them (as derived from setup.py).  While at it also add a defensive 
coding guard to xxlimited to ensure it remains Py_LIMITED_API-safe.

--
assignee: docs@python
components: Documentation, Extension Modules
files: xxdocstrings.diff
keywords: patch
messages: 14
nosy: danielsh, docs@python
priority: normal
severity: normal
status: open
title: xxlimited/xxmodule docstrings ambiguous
versions: Python 3.4
Added file: http://bugs.python.org/file28367/xxdocstrings.diff

___
Python tracker 

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



[issue16732] setup.py support for xxmodule without tkinker

2012-12-19 Thread Daniel Shahaf

New submission from Daniel Shahaf:

In setup.py, the logic or enabling xxmodule/xxlimited is currently in 
detect_tkinker(), so it's not run when one of the 'return' statements in the 
latter is executed.  On a box without tk installed, xxmodule.o gets built with 
the attached patch but not without.

--
components: Build
files: setupxxmodule.diff
keywords: patch
messages: 15
nosy: danielsh
priority: normal
severity: normal
status: open
title: setup.py support for xxmodule without tkinker
versions: Python 3.4
Added file: http://bugs.python.org/file28368/setupxxmodule.diff

___
Python tracker 

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



[issue16730] _fill_cache in _bootstrap.py crashes without directory execute permissions

2012-12-19 Thread Brett Cannon

Brett Cannon added the comment:

If Antoine can't think of any then I think there aren't any more. This does 
need a test, though.

--

___
Python tracker 

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



[issue16730] _fill_cache in _bootstrap.py crashes without directory execute permissions

2012-12-19 Thread Brett Cannon

Changes by Brett Cannon :


--
stage:  -> test needed
type:  -> behavior

___
Python tracker 

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



[issue16718] Mysterious atexit fail

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

OK, found the difference between 3.2 and 3.3:
The ImportError exception is still alive when atexit handlers are called, with 
its __traceback__, and all local variables in Python frames.
And since 3.3 the import system is built with Python functions...

More exactly, I could find the incomplete 'wow' module in 
sys.last_value.__traceback__.tb_next.tb_frame.f_back.f_back.f_back.f_locals['module']

But all this is not really related to the current issue.
Things should be better in the future, when modules are cleared with true 
garbage collection.

--

___
Python tracker 

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



[issue13153] IDLE crashes when pasting non-BMP unicode char on Py3

2012-12-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Same on 64-bit 3.3. Changed title since 3.3 is no longer '16-bit build'.

--
title: IDLE crashes when pasting non-BMP unicode char on UCS-16 build -> IDLE 
crashes when pasting non-BMP unicode char on Py3
versions: +Python 3.4

___
Python tracker 

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



[issue16714] Raise exceptions, don't throw

2012-12-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0a5c5399f638 by Andrew Svetlov in branch '2.7':
revert comment wording (#16714)
http://hg.python.org/cpython/rev/0a5c5399f638

--

___
Python tracker 

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



[issue16714] Raise exceptions, don't throw

2012-12-19 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Committed. Thanks again, Serhiy!

--

___
Python tracker 

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



[issue16714] Raise exceptions, don't throw

2012-12-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b227f8f7242d by Andrew Svetlov in branch '2.7':
replace threw with raised (#16714)
http://hg.python.org/cpython/rev/b227f8f7242d

New changeset 74da2dbb5e50 by Andrew Svetlov in branch '3.2':
replace threw with raised (#16714)
http://hg.python.org/cpython/rev/74da2dbb5e50

New changeset 55d86476d048 by Andrew Svetlov in branch '3.3':
replace threw with raised (#16714)
http://hg.python.org/cpython/rev/55d86476d048

New changeset 3594175c6860 by Andrew Svetlov in branch 'default':
replace threw with raised (#16714)
http://hg.python.org/cpython/rev/3594175c6860

--

___
Python tracker 

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



[issue16722] __index__() overrides __bytes__() when bytes() is called

2012-12-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I'm afraid we can only fix this in 3.4 lest someone is relying on it.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue16718] Mysterious atexit fail

2012-12-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy:  -serhiy.storchaka
versions:  -Python 2.6

___
Python tracker 

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



[issue16724] Define `binary data` representation in Python

2012-12-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy:  -serhiy.storchaka
versions:  -Python 3.1, Python 3.5

___
Python tracker 

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



[issue16722] __index__() overrides __bytes__() when bytes() is called

2012-12-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c744b6f8a09a by Benjamin Peterson in branch '3.3':
try to call __bytes__ before __index__ (closes #16722)
http://hg.python.org/cpython/rev/c744b6f8a09a

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

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

___
Python tracker 

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



[issue16722] __index__() overrides __bytes__() when bytes() is called

2012-12-19 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution: fixed -> 
stage: committed/rejected -> 
status: closed -> open
versions: +Python 3.4

___
Python tracker 

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



[issue14373] C implementation of functools.lru_cache

2012-12-19 Thread Alexey Kachayev

Alexey Kachayev added the comment:

Updated patch with next points:

* fix typedefs
* python implementation works normally without C acceleration
* test cases cover both python/c implementations
* several style fixes in C module

--
nosy: +kachayev
Added file: http://bugs.python.org/file28369/14373.fixed.diff

___
Python tracker 

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



[issue16722] __index__() overrides __bytes__() when bytes() is called

2012-12-19 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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

___
Python tracker 

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



[issue14373] C implementation of functools.lru_cache

2012-12-19 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +amaury.forgeotdarc, pitrou

___
Python tracker 

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



[issue16718] Mysterious atexit fail

2012-12-19 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> Things should be better in the future, when modules are cleared with true 
> garbage collection.

When is this future of which you speak?

I am not sure whether it would affect performance, but a weakrefable subclass 
of dict could be used for module dicts.  Then the module destructor could just 
save the module's dict in a WeakValueDictionary keyed by the id (assuming we 
are not yet shutting down).  At shutdown the saved module dicts could be purged 
by replacing all values with None.

Or maybe something similar is possible without using a dict subclass.

--
versions: +Python 2.6

___
Python tracker 

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



[issue16722] __index__() overrides __bytes__() when bytes() is called

2012-12-19 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Is it coupled with #15559? 
If true we can relax ipaddress with adding __index__ again for 3.4

--
nosy: +asvetlov

___
Python tracker 

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



[issue15559] Bad interaction between ipaddress addresses and the bytes constructor

2012-12-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I changed the precedence now, so __bytes__ is tried before __index__.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue16722] __index__() overrides __bytes__() when bytes() is called

2012-12-19 Thread Andrew Svetlov

Andrew Svetlov added the comment:

BTW, Руслан, can you change your name to use latin alphabet?
I'm Андрей Светлов, but use Andrew Svetlov for tracker.
Latin transcription is much easier to remember for all python users who don't 
speak Russian. For that guys your name looks like Chinese one for me.
Thanks.

--

___
Python tracker 

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



[issue1075356] exceeding obscure weakproxy bug

2012-12-19 Thread Matthew Barnett

Matthew Barnett added the comment:

The patch "issue1075356.patch" is my attempt to fix this bug.

'PyArg_ParseTuple', etc, eventually call 'convertsimple'. What this patch does 
is to insert some code at the start of 'convertsimple' that checks whether the 
argument is a weakref proxy and, if it is, fetch the object to which the proxy 
refers. From then on it's working with the true argument, so it'll work just 
like would have done if it been given the proxied object itself originally.

--
keywords: +patch
nosy: +mrabarnett
versions: +Python 3.3
Added file: http://bugs.python.org/file28370/issue1075356.patch

___
Python tracker 

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



[issue16718] Mysterious atexit fail

2012-12-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

See issue812369 for the shutdown procedure and modules cleanup.

--

___
Python tracker 

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



[issue16718] Mysterious atexit fail

2012-12-19 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> See issue812369 for the shutdown procedure and modules cleanup.

I am aware of that issue, but the original patch is 9 years old.  Which is why 
I ask if/when it will actually happen.

--

___
Python tracker 

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



[issue16733] Solaris ctypes_test failures

2012-12-19 Thread yippi

New submission from yippi:

Note I am building Python 3.3 with the Sun Studio compiler on Solaris 11.  When 
I run the tests, I get these 2 ctypes errors:

==
FAIL: test_ints (ctypes.test.test_bitfields.C_Test)
--
Traceback (most recent call last):
  File 
"/builds/bacamero/ul/components/python/python33/Python-3.3.0/Lib/ctypes/test/test_bitfields.py",
 line 40, in test_ints
self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii')))
AssertionError: -1 != 1
==
FAIL: test_shorts (ctypes.test.test_bitfields.C_Test)
--
Traceback (most recent call last):
  File 
"/builds/bacamero/ul/components/python/python33/Python-3.3.0/Lib/ctypes/test/test_bitfields.py",
 line 47, in test_shorts
self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii')))
AssertionError: -32 != 32
--

I see almost identical errors in Python 2.6 and 2.7.  The same two tests fail, 
though the format of the error message is a bit different.  For example it 
looks like this in 2.7:
AssertionError: Tuples differ: ('A', 1, -1) != ('A', 1, 1)
AssertionError: Tuples differ: ('R', 32, -32) != ('R', 32, 32)

I made a simple standalone test program that prints out all the values
instead of stopping on first failure.  The script and output is attached
for reference. 

I think this might be related to issue #16275.  On Solaris 11 we are building 
Python with the configure --with -system-ffi argument.  On Solaris 11, libffi 
3.0.9 is used.  I tried updating libffi to the latest 3.0.11 version and 
rebuilding, but that did not help.

Any pointers about how to debug this would be helpful.  It is not clear to me 
if this is a libffi issue, a compiler issue, a problem in Python or something 
else.  Is there any additional information I could provide to help track this 
down?

--
components: Tests
files: ctypes.out
messages: 177792
nosy: yippi
priority: normal
severity: normal
status: open
title: Solaris ctypes_test failures
type: behavior
versions: Python 2.6, Python 2.7, Python 3.3
Added file: http://bugs.python.org/file28371/ctypes.out

___
Python tracker 

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



[issue16275] test_ctypes fails on Solaris 10 SPARC 2.7 (nitrogen/s10) (Sun C compiler)

2012-12-19 Thread STINNER Victor

STINNER Victor added the comment:

I guess that #16733 is a duplicate of this issue.

--

___
Python tracker 

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



[issue16733] Solaris ctypes_test failures

2012-12-19 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue16690] Reference leak with custom tp_dealloc in PyType_FromSpec

2012-12-19 Thread Bradley Froehle

Bradley Froehle added the comment:

The attached file `heaptype_refcnt_testcases.py` runs through several test 
cases (ssl.SSLError, a subclass of ssl.SSLError, and xxlimited.Xxo) seeing if 
references are leaked in each instance.

Unfortunately `xxlimited.Xxo` isn't set to be a base type and I don't know of 
any other types in the default install which use PyType_FromSpec with a custom 
tp_dealloc.

--
Added file: http://bugs.python.org/file28372/heaptype_refcnt_testcases.py

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-19 Thread Zachary Ware

Zachary Ware added the comment:

Sorry to have disappeared on this, other things took priority...

Thank you for the comments, Serhiy.  v2 of the patch renames Modules/operator.c 
to Modules/_operator.c, and changes that name every place I could find it.

I also tried to tidy up some of the error message mismatches.  I didn't bother 
with the ones regarding missing arguments, as that would mean checking args and 
throwing an exception in each and every function.

I do like the functional attrgetter better than the object version I wrote.  
The main reason I went with an object version in the first place was because 
that's what the C implementation used.  Is there any reason not to break with 
the C implementation and use a function instead?  The updated patch takes a 
rather ugly hack to try to use the functional version in an object.

length_hint() was horrible and has been rewritten.  It should be less horrible 
now :).  It should also follow the C implementation quite a bit better.

--
Added file: http://bugs.python.org/file28373/py_operator.v2.diff

___
Python tracker 

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



[issue16724] Define `binary data` representation in Python

2012-12-19 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> It will help if Python docs contained a definition of what can be considered 
> 'binary data' and link this term from hexlify description to this definition.

I believe this is part of the goal of issue 16518, where "bytes-like object" is 
being proposed as one of the terms for addition to the glossary.

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue16722] __index__() overrides __bytes__() when bytes() is called

2012-12-19 Thread Руслан Ижбулатов

Руслан Ижбулатов added the comment:

Yes, i saw #15559 ( well, actually, i saw the related discussion 
http://mail.python.org/pipermail/python-dev/2012-August/121241.html ) while 
looking for an answer. It's more narrow - i.e. manifestation of this issue in 
ipaddress case where some people actually _needed_ to have different values 
returned by __index__() and __bytes__(), and had to work around it.

As for my name, my username is used almost everywhere and, unlike my real name, 
it's easy to read and remember. The only place where usernames aren't mentioned 
are mails from the Python issue tracker. File a bug for it.

--

___
Python tracker 

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



[issue16724] Define `binary data` representation in Python

2012-12-19 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with Amaury and Andrew.  The docs are fine as-is.

--
nosy: +rhettinger
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-19 Thread Zachary Ware

Zachary Ware added the comment:

Considering what a huge headache it was to get my own patch to apply at home on 
Linux rather than at work on Windows, here's a new version of the patch that 
straightens out the line ending nightmare present in v2. No other changes made.

--
Added file: http://bugs.python.org/file28374/py_operator.v3.diff

___
Python tracker 

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



[issue16694] Add pure Python operator module

2012-12-19 Thread Zachary Ware

Changes by Zachary Ware :


Removed file: http://bugs.python.org/file28373/py_operator.v2.diff

___
Python tracker 

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



[issue16734] Delay interpreter startup phase until script is read

2012-12-19 Thread anatoly techtonik

New submission from anatoly techtonik:

Currently, when interpreter is launched it returns immediately to parent 
process without waiting to read the entrypoint script. This causes problem when 
you need to remove this script after executing.

Is it possible to delay return to child process until the entrypoint script is 
read?

See test case in attach.

--
components: Interpreter Core
files: sub_race_removal.py
messages: 177800
nosy: techtonik
priority: normal
severity: normal
status: open
title: Delay interpreter startup phase until script is read
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5
Added file: http://bugs.python.org/file28375/sub_race_removal.py

___
Python tracker 

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



[issue16518] add "buffer protocol" to glossary

2012-12-19 Thread Chris Jerdonek

Chris Jerdonek added the comment:

After this issue is resolved, the binascii docs can be updated as suggested in 
issue 16724.

--

___
Python tracker 

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