[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Stefan Krah

Stefan Krah added the comment:

> I can easily provide a specification that makes the current implementation 
> "correct"

Yes, the current specification is: memoryview only attempts to
compare arrays with known (single character native) formats and
returns "not equal" otherwise.

The problem is that for backwards compatibility memoryview accepts
arrays with arbitrary format strings. In operations like tolist()
it's possible to raise NotImplemented, but for equality comparisons
that's not possible.


Note that in 3.2 memoryview would return "equal" for arrays that
simply aren't equal, if those arrays happen to have the same bit
pattern.


One way to deal with this is to demand a strict canonical form
of format strings for PEP-3118, see msg167687.

--

___
Python tracker 

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



[issue15612] Rewrite StringIO to use the _PyUnicodeWriter API

2012-08-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> It provides better performance when writing non-ASCII strings.

I would like to know why that is the case. If PyUnicode_Join is not optimal, 
then perhaps we should better optimize it.

Also, you should post benchmarks with tiny strings as well.

--

___
Python tracker 

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



[issue15612] Rewrite StringIO to use the _PyUnicodeWriter API

2012-08-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Also, you should post benchmarks with tiny strings as well.

Oops, sorry, they are already there. Thanks for the numbers.

--

___
Python tracker 

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



[issue15614] print statement not showing valid result

2012-08-10 Thread laki

New submission from laki:

Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on 
win32
>>> a = [1,2]
>>> b = [2,3]
>>> a.extend(b)
>>> a
[1, 2, 2, 3]
>>> print [1,2].extend([2,3])
None

I did not test this in linux.

--
components: Windows
messages: 167859
nosy: laki
priority: normal
severity: normal
status: open
title: print statement not showing valid result
type: behavior
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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

> Note that in 3.2 memoryview would return "equal" for arrays that
> simply aren't equal, if those arrays happen to have the same bit
> pattern.

This is exactly my point. If a "memoryview" has the same "memory"
as another, why are they then not rightfully considered equal?
IOW, the 3.2 behavior looks fine to me.

You apparently have a vision that equality should mean something
different for memoryviews - please explicitly state what that
view is. A mathematical definition ("two memoryviews A and B
are equal iff ...") would be appreciated.

> One way to deal with this is to demand a strict canonical form
> of format strings for PEP-3118, see msg167687.

You are talking about the solution already - I still don't know
what the problem is exactly (not that I *need* to understand
the problem, but at a minimum, the documentation should state
what the intended behavior is - better if people would also
agree that the proposed behavior is "reasonable").

For 3.3, I see two approaches: either move backwards to the
3.2 behavior and defer this change to 3.4 - this would make
it release-critical indeed. Or move forward to a yet-to-be
specified equality operation which as of now may not be
implemented correctly, treating any improvement to it
as a bug fix.

--

___
Python tracker 

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



[issue15614] print statement not showing valid result

2012-08-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

This is not a bug. extend is a procedure with a side effect: the "self" object 
(i.e. "a" in your example) is modified.

By convention, procedures return None in Python, as opposed to functions, which 
have no side effect but return a result. This is to avoid code like

def combine(a, b):
  return a.extend(b)

a = ...
b = ...
c = combine(a,b)

If extend would return the "self" list, then people may think that they get a 
fresh, new list, and then wonder why a is modified.

IOW: your bug report is actually invalid; the result that print shows is 
exactly the right result that extend returns.

--
nosy: +loewis
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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Stefan Krah

Stefan Krah added the comment:

PEP-3118 specifies strongly typed multi-dimensional arrays. The existing
code in the 3.2 memoryview as well as numerous comments by Travis Oliphant
make it clear that these capabilities were intended from the start for
memoryview as well.

Perhaps the name "memoryview" is a misnomer, since the boundaries between
memoryview and NumPy's ndarray become blurry. In fact, the small
implementation of an ndarray in Modules/_testbuffer.c is *also* a memoryview
in some sense, since it can grab a buffer from an exporter and expose it in
the same manner as memoryview.

So what I implemented is certainly not only *my* vision. The PEP essentially
describes NumPy arrays with an interchange format to convert between NumPy
and PIL arrays.

It is perhaps unfortunate that the protocol was named "buffer" protocol,
since it is actually an advanced "array" protocol.

NumPy arrays don't care about the raw memory. It is always the logical array
that matters. For example, Fortran and C arrays have different bit patterns
in memory but compare equal, a fact that the 3.2 implementation completely
misses.

Arrays v and w are equal iff format and shape are equal and for all valid
indices allowed by shape

  memcmp((char *)PyBuffer_GetPointer(v, indices),
 (char *)PyBuffer_GetPointer(w, indices),
 itemsize) == 0.

Equal formats of course imply equal itemsize.

--

___
Python tracker 

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



[issue15615] More tests for JSON decoder to test Exceptions

2012-08-10 Thread Kushal Das

New submission from Kushal Das:

Added two more tests in json module to test exception cases. 

test_extra_data: this test checks the error condition when we have extra data 
in the stream.

test_invalid_escape: this test checks for the invalid escape sequence in the 
stream

--
components: Tests
files: json_tests.patch
keywords: patch
messages: 167863
nosy: kushaldas
priority: normal
severity: normal
status: open
title: More tests for JSON decoder to test Exceptions
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file26755/json_tests.patch

___
Python tracker 

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



[issue15616] logging.FileHandler not correctly created with PyYaml (unpickling problems?)

2012-08-10 Thread Jordi Puigsegur

New submission from Jordi Puigsegur:

logging.FileHandler and logging.RotatingFileHandler (haven't tried other 
handlers) do not get correctly initialized in python 2.7 when loaded using  
PyYaml. Therefore I suspect that there is some problem with the implementation 
of the pickle protocol of these clases in python 2.7.

Attached you can find a small test to reproduce the problem. It works in python 
2.5 and 2.6 but fails in python 2.7. In all cases I've used PyYaml 3.10.

--
components: Extension Modules
messages: 167864
nosy: jordipf
priority: normal
severity: normal
status: open
title: logging.FileHandler not correctly created with PyYaml (unpickling 
problems?)
type: crash
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



[issue15616] logging.FileHandler not correctly created with PyYaml (unpickling problems?)

2012-08-10 Thread Jordi Puigsegur

Jordi Puigsegur added the comment:

import logging
import logging.handlers
import yaml

logger = logging.getLogger() # root logger

# Option 1 - OK
##handler = logging.handlers.RotatingFileHandler(filename = "test.log", 
maxBytes = 262144, backupCount = 3)

# Option 2 - RotatingFileHandler fails when created through yaml
handler = yaml.load("""
!!python/object/new:logging.handlers.RotatingFileHandler
kwds:
filename: test.log
maxBytes: 262144
backupCount: 3
""")

# Option 3 - FileHandler also fails when created through yaml
##handler = yaml.load("""
##!!python/object/new:logging.FileHandler
##kwds:
##filename: test.log
##""")

logger.addHandler(handler)

logger.warning("test handler")

--

___
Python tracker 

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



[issue15616] logging.FileHandler not correctly created with PyYaml (unpickling problems?)

2012-08-10 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-10 Thread Ludwig Hähne

Changes by Ludwig Hähne :


Added file: http://bugs.python.org/file26756/array_sizeof_2.7.patch

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-10 Thread Ludwig Hähne

Changes by Ludwig Hähne :


Added file: http://bugs.python.org/file26757/array_sizeof_3.2.patch

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-10 Thread Ludwig Hähne

Changes by Ludwig Hähne :


Removed file: http://bugs.python.org/file26713/array_sizeof_v4.patch

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-10 Thread Ludwig Hähne

Changes by Ludwig Hähne :


Removed file: http://bugs.python.org/file26480/array_sizeof_v2.patch

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-10 Thread Ludwig Hähne

Ludwig Hähne added the comment:

Meador, Serhiy, I've add patches for Python 2.7 and Python 3.2 following Serhiy 
suggestions.

--

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-10 Thread Ludwig Hähne

Changes by Ludwig Hähne :


Removed file: http://bugs.python.org/file26510/array_sizeof_v3.patch

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-10 Thread Ludwig Hähne

Changes by Ludwig Hähne :


Removed file: http://bugs.python.org/file26479/array_sizeof.patch

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread Floris Bruynooghe

New submission from Floris Bruynooghe:

The SPARC Solaris 10 OpenCSW 3.x builder fails with

==
FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)
--
Traceback (most recent call last):
  File 
"/export/home/buildbot/buildarea/3.x.bruynooghe-solaris-csw/build/Lib/test/test_socket.py",
 line 4101, in test_create_connection
self.assertEqual(cm.exception.errno, errno.ECONNREFUSED)
AssertionError: 128 != 146

Here 128 is ENETUNREACH

I think the issue here is that socket.create_connection iterates over the 
result of socket.getaddrinfo('localhost', port, 0, SOCK_STREAM) which returns 
[(2, 2, 0, '', ('127.0.0.1', 0)), (26, 2, 0, '', ('::1', 0, 0, 0))] on this 
host.

The first result is tried and returns ECONNREFUSED but then the second address 
is tried and this returns ENETUNREACH because this host has not IPv6 network 
configured.  And create_connection() raises the last exception it received.

If getaddrinfo() is called with the AI_ADDRCONFIG flag then it will only return 
the IPv4 version of localhost.

--
components: Tests
messages: 167867
nosy: flub
priority: normal
severity: normal
status: open
title: FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)
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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread R. David Murray

R. David Murray added the comment:

But if getaddrinfo returns an IPv6 address, shouldn't a localhost connection on 
that address work?  It seems to me that a localhost connection failing when an 
IPv6 localhost address is returned is an OS configuration bug.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread Floris Bruynooghe

Floris Bruynooghe added the comment:

It was my understanding that this is what the AI_ADDRCONFIG flag is
for, if you don't use it you have no such guarantee.

--

___
Python tracker 

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

2012-08-10 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread R. David Murray

R. David Murray added the comment:

That sounds reasonable.  However, on my box that has an IPv6 address configured 
on lo, I get the same result with or without that flag:

loLink encap:Local Loopback  
  inet addr:127.0.0.1  Mask:255.0.0.0
  inet6 addr: ::1/128 Scope:Host
  UP LOOPBACK RUNNING  MTU:16436  Metric:1
  RX packets:48000 errors:0 dropped:0 overruns:0 frame:0
  TX packets:48000 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0 
  RX bytes:3991442 (3.8 MiB)  TX bytes:3991442 (3.8 MiB)
 
Python 2.7.3 (default, Jun 19 2012, 16:12:47) 
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.getaddrinfo('localhost', 80, 0, socket.SOCK_STREAM, 0)
[(2, 1, 6, '', ('127.0.0.1', 80))]
>>> socket.getaddrinfo('localhost', 80, 0, socket.SOCK_STREAM, 0, 
>>> socket.AI_ADDRCONFIG)
[(2, 1, 6, '', ('127.0.0.1', 80))]

--

___
Python tracker 

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



[issue15365] Traceback reporting can fail if IO cannot be imported

2012-08-10 Thread Kristján Valur Jónsson

Changes by Kristján Valur Jónsson :


--
status: open -> closed

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread Floris Bruynooghe

Floris Bruynooghe added the comment:

I think this is influenced by what  you have in /etc/hosts.  On my
laptop I also have IPv6 loopback as well as an IPv6 link-local on
eth0.  But I have both 127.0.0.1 and ::1 in /etc/hosts as locahost.
With that configuration I get the same getaddrinfo results as on the
solaris host (which btw, has the same /etc/hosts configuration for
localhost, i.e. both IPv4 & IPv6).  Basically I don't think loopback
and link-local addresses count as "configured address" for
getaddrinfo.

Btw, removing the "::1 localhost" line from /etc/hosts on the solaris
host does fix the issue and gives the same results you show.  But I
don't think this is correct.  My linux laptop behaves exactly the same
as the solaris host here.

--

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I was about to say that I agree that AI_ADDRCONFIG should be used in 
create_connection. However, RFC 3493 deviates from RFC 2553 by stating

"""If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be
   returned only if an IPv4 address is configured on the local system,
   and IPv6 addresses shall be returned only if an IPv6 address is
   configured on the local system.  The loopback address is not
   considered for this case as valid as a configured address.
"""

If this is taken literally, then it would not be possible to connect anymore to 
localhost if you have no IP address configured except for the loopback 
addresses - which in turn would make the test fail also (and would clearly be 
undesirable).

OSX clearly ignores that RFC - even with no IPv4 address configured, I get a 
result that includes 127.0.0.1. I wonder how other systems respond to 

socket.getaddrinfo('localhost', 80, 0, socket.SOCK_STREAM, 0, 
socket.AI_ADDRCONFIG)

if all interfaces except for lo are down (remember to reactivate the interfaces 
before posting a response to the bug tracker :-)

Any patch needs to be careful to use the flag only if available. Microsoft 
points out that the flag works only on Vista+. Not sure whether it just has no 
effect on XP, or makes the call fail.

--
nosy: +loewis

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread R. David Murray

R. David Murray added the comment:

Hmm.  I wonder what is different on my (linux) box.  I have ::1 in /etc/hosts 
for localhost.

Regardless, it certainly wouldn't hurt to add the flag to the test.

--

___
Python tracker 

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



[issue15610] PyImport_ImportModuleEx always fails in 3.3 with "ValueError: level must be >= 0"

2012-08-10 Thread Brett Cannon

Brett Cannon added the comment:

OK, the macro expansion should get fixed, a versionchanged should probably be 
added to the C API docs (for PyImport_ImportModuleLevel()), and a line in 
What's New for porting C code should be added.

We can't go back to -1, as Eric said, because it makes no sense anymore since 
you can't syntactically do an import that has -1 level semantics in Python 3. 
The fact that __import__ accepted a negative level was a bug that went 
unnoticed up until this point since so few people import modules  
programmatically and want implicit relative imports.

--

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Brett Cannon

Brett Cannon added the comment:

I still need a core committer to double-check me on Eric's patch to make sure 
the ABC changes are acceptable. I can handle the commit if someone will just 
sign off.

--

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Nick Coghlan

Nick Coghlan added the comment:

Done. Only substantive comment was that Finder should be registered with both 
of the more specific metaclasses, but there were a couple of docs comments as 
well.

--

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Nick Coghlan

Nick Coghlan added the comment:

Oh, and +1 for Eric's "path-based finder". States clearly that it is a finder 
that *uses* import paths, rather than finding them.

--

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the review, Nick! I will get this patch committed sometime today 
with your comments integrated.

--

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

David: I get the same on Linux as you, however, in the standard Debian 
installation, ::1 is *not* an address for "localhost", only for "ip6-localhost" 
and "ip6-loopback". Likewise, on Redhat, it seems that only "localhost6" gives 
you ::1. What Linux distribution are you using?

--

___
Python tracker 

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



[issue15616] logging.FileHandler not correctly created with PyYaml (unpickling problems?)

2012-08-10 Thread Vinay Sajip

Vinay Sajip added the comment:

The problem appears to be in PyYAML, not logging. Note the content of the 
attribute dictionaries in the following script:

import logging
import logging.handlers
from pprint import pprint
import yaml

# Option 1 - OK
h1 = logging.handlers.RotatingFileHandler(filename = "test.log", maxBytes = 
262144, backupCount = 3)
h2 = yaml.load("""
!!python/object/new:logging.handlers.RotatingFileHandler
kwds:
filename: test.log
maxBytes: 262144
backupCount: 3
""")
h3 = logging.FileHandler('test.log')
h4 = yaml.load("""
!!python/object/new:logging.FileHandler
kwds:
filename: test.log
""")

print('RotatingFileHandler using code: %s' % type(h1))
pprint(h1.__dict__)
print('RotatingFileHandler using YAML: %s' % type(h2))
pprint(h2.__dict__)
print('FileHandler using code: %s' % type(h3))
pprint(h3.__dict__)
print('FileHandler using YAML: %s' % type(h4))
pprint(h4.__dict__)

which prints

RotatingFileHandler using code: 
{'_name': None,
 'backupCount': 3,
 'baseFilename': '/home/vinay/projects/scratch/test.log',
 'encoding': None,
 'filters': [],
 'formatter': None,
 'level': 0,
 'lock': <_RLock owner=None count=0>,
 'maxBytes': 262144,
 'mode': 'a',
 'stream': }
RotatingFileHandler using YAML: 
{}
FileHandler using code: 
{'_name': None,
 'baseFilename': '/home/vinay/projects/scratch/test.log',
 'encoding': None,
 'filters': [],
 'formatter': None,
 'level': 0,
 'lock': <_RLock owner=None count=0>,
 'mode': 'a',
 'stream': }
FileHandler using YAML: 
{}

I suggest that you:

(a) Consider logging an issue with PyYAML.
(b) Consider using dictConfig(), which is available in Python 2.7 amd also 
available for older Pythons through

http://code.google.com/p/logutils/

--
assignee:  -> vinay.sajip
resolution:  -> invalid
status: open -> pending

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Brett Cannon

Brett Cannon added the comment:

Actually there is one issue with PathEntryFinder inheriting from Finder; it 
doesn't need to implement find_module() if it doesn't want to in Python 3.3. So 
I will need to stick in a dummy find_module() on the class that calls 
find_loader() and then returns any found loader and tosses the namespace paths.

--

___
Python tracker 

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



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-10 Thread R. David Murray

R. David Murray added the comment:

I see our previous messages crossed, I'm glad you investigated this more 
throughly than I did, since clearly just adding the flag could break things.

I'm using gentoo linux (gentoo stable on that particular machine).  I don't 
guarantee my /etc/hosts file is stock gentoo, but I think it is other than 
adding my host name to the localhost lines.

--

___
Python tracker 

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



[issue15618] turtle.pencolor() chokes on unicode

2012-08-10 Thread Juancarlo Añez

New submission from Juancarlo Añez:

>>> t.pencolor(u'red')
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in pencolor
  File "/usr/lib/python2.7/lib-tk/turtle.py", line 2166, in pencolor
color = self._colorstr(args)
  File "/usr/lib/python2.7/lib-tk/turtle.py", line 2600, in _colorstr
return self.screen._colorstr(args)
  File "/usr/lib/python2.7/lib-tk/turtle.py", line , in _colorstr
r, g, b = [round(255.0*x) for x in (r, g, b)]
TypeError: can't multiply sequence by non-int of type 'float'

--
components: Library (Lib)
messages: 167883
nosy: apalala
priority: normal
severity: normal
status: open
title: turtle.pencolor() chokes on unicode
type: behavior
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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Can you please elaborate on the specification:

1. what does it mean that the formats of v and w are equal?

2. Victor's clarification about this issue isn't about comparing two arrays, 
but an array with a string object. So: when is an array equal to some other 
(non-array) object?

--

___
Python tracker 

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



[issue15616] logging.FileHandler not correctly created with PyYaml (unpickling problems?)

2012-08-10 Thread Jordi Puigsegur

Jordi Puigsegur added the comment:

Thanks for your answer.

I am not sure it is a PyYaml bug. Did you notice that the same code works 
perfectly (with the same version of PyYaml) using python 2.6 and python 2.5? 

Could it be that the issue lies in some change in the way the pickle protocol 
is implemented in logging classes?

--
status: pending -> open

___
Python tracker 

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



[issue15616] logging.FileHandler not correctly created with PyYaml (unpickling problems?)

2012-08-10 Thread Jordi Puigsegur

Jordi Puigsegur added the comment:

This is the output of your script when run in python 2.6 and the exact same 
PyYaml version:

C:\>test.py
RotatingFileHandler using code: 
{'backupCount': 3,
 'baseFilename': 'C:\\test.log',
 'encoding': None,
 'filters': [],
 'formatter': None,
 'level': 0,
 'lock': <_RLock(None, 0)>,
 'maxBytes': 262144,
 'mode': 'a',
 'stream': }
RotatingFileHandler using YAML: 
{'backupCount': 3,
 'baseFilename': 'C:\\test.log',
 'encoding': None,
 'filters': [],
 'formatter': None,
 'level': 0,
 'lock': <_RLock(None, 0)>,
 'maxBytes': 262144,
 'mode': 'a',
 'stream': }
FileHandler using code: 
{'baseFilename': 'C:\\test.log',
 'encoding': None,
 'filters': [],
 'formatter': None,
 'level': 0,
 'lock': <_RLock(None, 0)>,
 'mode': 'a',
 'stream': }
FileHandler using YAML: 
{'baseFilename': 'C:\\test.log',
 'encoding': None,
 'filters': [],
 'formatter': None,
 'level': 0,
 'lock': <_RLock(None, 0)>,
 'mode': 'a',
 'stream': }

--

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Nick Coghlan

Nick Coghlan added the comment:

Sounds good. Perhaps steal the impl from FileFinder.find_module (i.e. the one 
with the ImportWarning).

--

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0a75ce232f56 by Brett Cannon in branch 'default':
Issue #15502: Finish bringing importlib.abc in line with the current
http://hg.python.org/cpython/rev/0a75ce232f56

--

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patches look good to me.

--

___
Python tracker 

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



[issue15606] re.VERBOSE doesn't ignore certain whitespace

2012-08-10 Thread Matthew Barnett

Matthew Barnett added the comment:

Ideally, yes, that whitespace should be ignored.

The question is whether it's worth fixing the code for the small case of when 
there's whitespace within "tokens", such as within "(?:". Usually those who use 
verbose mode use whitespace as in the first example rather than the second or 
third examples.

--

___
Python tracker 

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



[issue15576] importlib: ExtensionFileLoader not used to load packages from __init__.so files

2012-08-10 Thread Brett Cannon

Brett Cannon added the comment:

To add a nice wrinkle to all of this, Windows debug builds use _d.pyd as the 
extension suffix. Notice how that doesn't start with a nice '.' to make finding 
the suffix easy? Yeah, that complicates ExtensionLoader.is_package() as I will 
have to now directly reference imp.extension_suffixes() which sucks as it hard 
codes what extensions are used instead of being more flexible and just ignoring 
that bit of detail.

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Stefan Krah

Stefan Krah added the comment:

> 1. what does it mean that the formats of v and w are equal?

I'm using array and Py_buffer interchangeably since a Py_buffer struct
actually describes a multi-dimensional array. v and w are Py_buffer
structs.

So v.format must equal w.format, where format is a format string in
struct module syntax. The topic of this issue is to determine under
what circumstances two strings in struct module syntax are considered
equal.

> 2. Victor's clarification about this issue isn't about comparing
>two arrays, but an array with a string object. So: when is an
>array equal to some other (non-array) object?

>>> a=array.array('u', 'abc')
>>> v=memoryview(a)
>>> a == v
False

memoryview can compare against any object with a getbufferproc, in this
case array.array. memoryview_richcompare() calls PyObject_GetBuffer(other)
and proceeds to compare its own internal Py_buffer v against the obtained
Py_buffer w.

In the case of v.format == w.format the fix for unknown formats is trivial:
Just allow the comparison using v.itemsize == w.itemsize.

However, the struct module format string syntax has multiple representations
for the exact same formats, which makes a general fmtcmp() function tricky
to write.

Hence my proposal to demand a strict canonical form for PEP-3118 format
strings, which would be a proper subset of struct module format strings.

Example: "1Q 1h 1h 0c" must be written as "Q2h"

The attached patch should largely implement this proposal. A canonical form
is perhaps not such a severe restriction, since format strings should usually
come from the exporting object. E.g. NumPy must translate its own internal
format to struct module syntax anyway.

Another option is to commit the patch that misses "1Q 1h 1h 0c" == "Q2h"
now and aim for a completely general fmtcmp() function later.

IMO any general fmtcmp() function should also be reasonably fast.

--

___
Python tracker 

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



[issue15618] turtle.pencolor() chokes on unicode

2012-08-10 Thread Juancarlo Añez

Juancarlo Añez added the comment:

This patch solves the problem by making turtle check for string against 
basestring insted of str.

--
keywords: +patch
Added file: http://bugs.python.org/file26758/turtle_unicode.patch

___
Python tracker 

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



[issue15618] turtle.pencolor() chokes on unicode

2012-08-10 Thread Juancarlo Añez

Juancarlo Añez added the comment:

The bug showed up in a script that used:

from __future__ import unicode_literals

--

___
Python tracker 

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



[issue15619] set.pop() documentation is confusing

2012-08-10 Thread Anton Barkovsky

New submission from Anton Barkovsky:

I've seen people being confused by the documentation for set.pop() method. It 
makes it look like the element is selected randomly while it's
just unspecified.

I'm attaching a patch that clarifies the doc, tested on 3.3, 3.2 and 2.7

--
assignee: docs@python
components: Documentation
files: set_pop_doc.patch
keywords: patch
messages: 167895
nosy: anton.barkovsky, docs@python
priority: normal
severity: normal
status: open
title: set.pop() documentation is confusing
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file26759/set_pop_doc.patch

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Stefan Krah

Changes by Stefan Krah :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue15619] set.pop() documentation is confusing

2012-08-10 Thread Georg Brandl

Georg Brandl added the comment:

Sorry, I don't see how "arbitrary" implies "random".  So I'm -1 on making the 
docs more verbose for no apparent gain.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Brett Cannon

Brett Cannon added the comment:

I will go back and steal the FileFinder.find_module implementation after I 
finish the current patch I'm working on.

--

___
Python tracker 

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



[issue15577] Real argc and argv in embedded interpreter

2012-08-10 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +belopolsky

___
Python tracker 

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



[issue15619] set.pop() documentation is confusing

2012-08-10 Thread Eli Bendersky

Eli Bendersky added the comment:

I agree with Georg. As far as I understand the word "arbitrary" - it  describes 
the situation exactly.

--
nosy: +eli.bendersky

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

> So v.format must equal w.format, where format is a format string in
> struct module syntax. The topic of this issue is to determine under
> what circumstances two strings in struct module syntax are considered
> equal.

And that is exactly my question: We don't need a patch implementing
it (yet), but a specification of what is to be implemented first.

I know when two strings are equal (regardless of their syntax):
if they have the same length, and contain the same characters in
the same order. Apparently, you have a different notion of "equal"
for strings in mind, please be explicitly what that notion is.

> memoryview can compare against any object with a getbufferproc, in this
> case array.array. memoryview_richcompare() calls PyObject_GetBuffer(other)
> and proceeds to compare its own internal Py_buffer v against the obtained
> Py_buffer w.

Can this be expressed on Python level as well? I.e. is it correct
to say: an array/buffer/memoryview A is equal to an object O iff
A is equal to memoryview(O)? Or could it be that these two equivalences
might reasonably differ?

> Hence my proposal to demand a strict canonical form for PEP-3118 format
> strings, which would be a proper subset of struct module format strings.

Can you kindly phrase this as a specification? Who is demanding what
from whom?

Proposal: two format strings are equal if their canonical forms
are equal strings. The canonical form C of a string S is created by ???

However, it appears that you may have something different in mind
where things are rejected/fail to work if the canonical form isn't
originally provided by somebody (whom?)

So another Proposal: two format strings are equal iff they are
in both in canonical form and are equal strings.

This would imply that a format string which is not in canonical
form is not equal to any other strings, not even to itself, so
this may still not be what you want. But I can't guess what it
is that you want.

--

___
Python tracker 

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



[issue15576] importlib: ExtensionFileLoader not used to load packages from __init__.so files

2012-08-10 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15576] importlib: ExtensionFileLoader not used to load packages from __init__.so files

2012-08-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1db6553f3f8c by Brett Cannon in branch 'default':
Issue #15576: Allow extension modules to be a package's __init__
http://hg.python.org/cpython/rev/1db6553f3f8c

--
nosy: +python-dev

___
Python tracker 

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



[issue15444] Incorrectly written contributor's names

2012-08-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about patch review?

--
keywords: +needs review

___
Python tracker 

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



[issue15444] Incorrectly written contributor's names

2012-08-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file26504/doc-nonascii-names.patch

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread STINNER Victor

STINNER Victor added the comment:

Can't we start with something simple (for ptyhon 3.3?), and elaborate
later? In my specific example, both object have the same format string and
the same content. So i expect that they are equal.
Le 10 août 2012 19:47, "Martin v. Löwis"  a écrit :

>
> Martin v. Löwis added the comment:
>
> > So v.format must equal w.format, where format is a format string in
> > struct module syntax. The topic of this issue is to determine under
> > what circumstances two strings in struct module syntax are considered
> > equal.
>
> And that is exactly my question: We don't need a patch implementing
> it (yet), but a specification of what is to be implemented first.
>
> I know when two strings are equal (regardless of their syntax):
> if they have the same length, and contain the same characters in
> the same order. Apparently, you have a different notion of "equal"
> for strings in mind, please be explicitly what that notion is.
>
> > memoryview can compare against any object with a getbufferproc, in this
> > case array.array. memoryview_richcompare() calls
> PyObject_GetBuffer(other)
> > and proceeds to compare its own internal Py_buffer v against the obtained
> > Py_buffer w.
>
> Can this be expressed on Python level as well? I.e. is it correct
> to say: an array/buffer/memoryview A is equal to an object O iff
> A is equal to memoryview(O)? Or could it be that these two equivalences
> might reasonably differ?
>
> > Hence my proposal to demand a strict canonical form for PEP-3118 format
> > strings, which would be a proper subset of struct module format strings.
>
> Can you kindly phrase this as a specification? Who is demanding what
> from whom?
>
> Proposal: two format strings are equal if their canonical forms
> are equal strings. The canonical form C of a string S is created by ???
>
> However, it appears that you may have something different in mind
> where things are rejected/fail to work if the canonical form isn't
> originally provided by somebody (whom?)
>
> So another Proposal: two format strings are equal iff they are
> in both in canonical form and are equal strings.
>
> This would imply that a format string which is not in canonical
> form is not equal to any other strings, not even to itself, so
> this may still not be what you want. But I can't guess what it
> is that you want.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue15618] turtle.pencolor() chokes on unicode

2012-08-10 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue15527] Double parens in functions references

2012-08-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry, I don't know anything about the Sphinx, therefore, I do not know what is 
the problem and what the solution should be.

1) If this is the improper use of markup (the arguments are not supported and 
must not), we need to remove markup from other doc files (Doc/library/os.rst, 
Doc/library/platform.rst, Doc/library/unittest.rst, Doc/whatsnew/2.0.rst, 
Doc/whatsnew/2.1.rst, Doc/whatsnew/2.2.rst, Doc/whatsnew/2.3.rst, 
Doc/whatsnew/2.4.rst, Doc/whatsnew/2.5.rst, Doc/whatsnew/3.0.rst).

2) If the behaviour of the markup is controlled by configuration files, which 
are under the management of the CPython team, then these configuration files 
should be fixed.

3) If the behaviour of the markup is hardcoded inside the Sphinx, then it is 
the Sphinx bug and it should be reported to Sphinx team. I don't know what 
CPython team can/should do with it.

Which of these variants is actual?

Note, :c:macro: works for names with arguments, and :c:func:, :func:, :meth: 
did not.

--

___
Python tracker 

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



[issue15527] Double parens in functions references

2012-08-10 Thread Georg Brandl

Georg Brandl added the comment:

1) is correct.

(And cmacro works because it's only for non-function macros anyway.)

--

___
Python tracker 

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



[issue15607] New print's argument "flush" is not mentioned in docstring

2012-08-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue15607] New print's argument "flush" is not mentioned in docstring

2012-08-10 Thread Georg Brandl

Georg Brandl added the comment:

LGTM.

--

___
Python tracker 

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



[issue15619] set.pop() documentation is confusing

2012-08-10 Thread Georg Brandl

Changes by Georg Brandl :


--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue15604] PyObject_IsTrue failure checks

2012-08-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I shall try to do this, but it will take a lot of time. Besides, now in the 
code there are a lot of *correct* checked usage of PyObject_IsTrue without test 
cases. So I'm not sure that the tests are needed here, and that they are worth 
the effort.

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

> Can't we start with something simple (for ptyhon 3.3?), and elaborate
> later?

Sure: someone would have to make a proposal what exactly that is.
IMO, the 3.2 definition *was* simple, but apparently it was considered
too simple. So either Stefan gets to define his view of equality, or
somebody else needs to make a (specific) counter-proposal.

--

___
Python tracker 

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



[issue15594] test_copyfile_named_pipe() fails on Mac OS X Snow Leopard: OSError: [Errno 22] Invalid argument

2012-08-10 Thread Łukasz Langa

Łukasz Langa added the comment:

I will be able to look at this on Monday (currently on vacation). The only 
unusual thing that comes to mind is that this is a virtual machine. Oh, and 
it's Snow Leopard *Server* (unfortunately I don't have any desktop licenses 
handy, and I'm not sure if I could use them on a VM anyway).

Expect more info on Monday.

--
assignee:  -> lukasz.langa

___
Python tracker 

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



[issue15365] Traceback reporting can fail if IO cannot be imported

2012-08-10 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue15582] Enhance inspect.getdoc to follow inheritance chains

2012-08-10 Thread Eric Snow

Eric Snow added the comment:

I have just the thing for this, but haven't had a chance to put a patch 
together.  I might be able to get to it in the next week if Dave "bitey" 
Beazley isn't too much of a distraction.  :)

--

___
Python tracker 

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



[issue15527] Double parens in functions references

2012-08-10 Thread Chris Jerdonek

Chris Jerdonek added the comment:

-   a distinct non-*NULL* pointer if possible, as if :c:func:`PyMem_Malloc(1)` 
had
+   a distinct non-*NULL* pointer if possible, as if ``PyMem_Malloc(1)`` had

> From my perspective sphinx doesn't allow notations like 
> :c:func:`PyMem_Malloc(1)`

I believe that it does.  Sphinx allows you to specify link text distinct from 
the target for various roles:

http://docs.python.org/devguide/documenting.html#id3

So for the above, it would be--

:c:func:`PyMem_Malloc(1) `

I confirmed that this works.  I think this is preferable to displaying the 
preferred text without any hyperlink.

--
nosy: +cjerdonek

___
Python tracker 

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



[issue15564] cgi.FieldStorage should not call read_multi on files

2012-08-10 Thread Glenn Linderman

Changes by Glenn Linderman :


--
nosy: +v+python

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Stefan Krah

Stefan Krah added the comment:

The ideal specification is:

1) Arrays v and w are equal iff format and shape are equal and for all valid
   indices allowed by shape

 memcmp((char *)PyBuffer_GetPointer(v, indices),
(char *)PyBuffer_GetPointer(w, indices),
itemsize) == 0.

2) Two format strings s and t are equal if canonical(s) == canonical(t).

End ideal specification.

Purely to *facilitate* the implementation of a format comparison function,
I suggested:

3) An exporter must initialize the format field of a Py_buffer structure
   with canonical(s).

If *all* exporters obey 3), a format comparison function can simply
call strcmp(s, t) (after sorting out the byte order specifier).

Specifically, if x and y are equal, then:

  a) x == memoryview(x) == memoryview(y) == y

If x and y are equal and exporter x does *not* obey 3), but exporter y does,
then:

  b) x == memoryview(x) != memoryview(y) == y

Under rule 3) this would be the fault of exporter x.

For Python 3.3 it is also possible to state only 1) and 2), with a caveat in
the documentation that case b) might occur until the format comparison function
in memoryview implements the reductions to canonical forms.

The problem is that reductions to canonical forms might get very complicated
if #3132 is implemented.

--

___
Python tracker 

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



[issue15564] cgi.FieldStorage should not call read_multi on files

2012-08-10 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
nosy: +orsenthil

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-10 Thread Stefan Krah

Stefan Krah added the comment:

Martin v. Loewis  wrote:
> Sure: someone would have to make a proposal what exactly that is.
> IMO, the 3.2 definition *was* simple, but apparently it was considered
> too simple.

It was simply broken in multiple ways. Example:

>>> from numpy import *
>>> x = array([1,2,3,4,5], dtype='B')
>>> y = array([5,4,3,2,1], dtype='B')
>>> z = y[::-1]
>>> 
>>> x == z
array([ True,  True,  True,  True,  True], dtype=bool)
>>> memoryview(x) == memoryview(z)
False
Segmentation fault


I'm not even talking about the segfault here. Note that x == z, but
memoryview(x) != memoryview(z), because the logical structure is
not taken into account.

Likewise, one could construct cases where one array contains a float
NaN and the other an integer that happens to have the same bit pattern.

The arrays would not be equal, but their memoryviews would be equal.



> So either Stefan gets to define his view of equality, or
> somebody else needs to make a (specific) counter-proposal.

The view is defined by the PEP that clearly models NumPy. I'm curious what
counter-proposal will work with NumPy and PIL.

--

___
Python tracker 

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



[issue13405] Add DTrace probes

2012-08-10 Thread Francois Dion

Changes by Francois Dion :


--
nosy: +Francois.Dion

___
Python tracker 

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



[issue15607] New print's argument "flush" is not mentioned in docstring

2012-08-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e4877d59613d by Senthil Kumaran in branch 'default':
Fix issue #15607: Update the print builtin function docstring with the new 
flush keyword.
http://hg.python.org/cpython/rev/e4877d59613d

--
nosy: +python-dev

___
Python tracker 

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



[issue15607] New print's argument "flush" is not mentioned in docstring

2012-08-10 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for raising this issue, Serhiy and thanks for the patch, Daniel. It is 
committed now.

--
nosy: +orsenthil
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



[issue15527] Double parens in functions references

2012-08-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Chris. Here's the patch.

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue15527] Double parens in functions references

2012-08-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +patch

___
Python tracker 

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



[issue15527] Double parens in functions references

2012-08-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file26760/doc_dbl_parens.patch

___
Python tracker 

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



[issue15239] Abandoned Tools/unicode/mkstringprep.py

2012-08-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

To protect themselves from the surprises we need working mkstringprep.py. 
Martin, what do you say about a patch?

--

___
Python tracker 

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



[issue15616] logging.FileHandler not correctly created with PyYaml (unpickling problems?)

2012-08-10 Thread Vinay Sajip

Vinay Sajip added the comment:

You've only shown that the YAML loading produces the correct results on 2.6.

Logging changed from old-style classes in 2.6 to new-style classes in 2.7. This 
may be what is causing PyYAML a problem, but AFAICT PyYAML should work with 
new-style classes. Perhaps you need to invoke it differently for new-style 
classes?

Logging doesn't do anything special related to pickling, except that it takes 
care not to send objects which can't be pickled across the network (which is 
not relevant here).

--

___
Python tracker 

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



[issue15502] Meta path finders and path entry finders are different, but share an ABC

2012-08-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e7a67f1bf604 by Brett Cannon in branch 'default':
Issue #15502: Refactor some code.
http://hg.python.org/cpython/rev/e7a67f1bf604

--

___
Python tracker 

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



[issue15620] readline.clear_history() missing in test_readline.py

2012-08-10 Thread Juancarlo Añez

New submission from Juancarlo Añez:

$ lsb_release -a
LSB Version:
core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: Ubuntu
Description:Ubuntu 12.04.1 LTS
Release:12.04
Codename:   precise

$ hg branch
2.7

$ ./python Lib/test/test_readline.py
testHistoryUpdates (__main__.TestHistoryManipulation) ... ERROR

==
ERROR: testHistoryUpdates (__main__.TestHistoryManipulation)
--
Traceback (most recent call last):
  File "Lib/test/test_readline.py", line 16, in testHistoryUpdates
readline.clear_history()
AttributeError: 'module' object has no attribute 'clear_history'

--
Ran 1 test in 0.003s

FAILED (errors=1)
Traceback (most recent call last):
  File "Lib/test/test_readline.py", line 43, in 
test_main()
  File "Lib/test/test_readline.py", line 40, in test_main
run_unittest(TestHistoryManipulation)
  File "/art/python/cpython/Lib/test/test_support.py", line 1125, in 
run_unittest
_run_suite(suite)
  File "/art/python/cpython/Lib/test/test_support.py", line 1108, in _run_suite
raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_readline.py", line 16, in testHistoryUpdates
readline.clear_history()
AttributeError: 'module' object has no attribute 'clear_history'

--
components: Tests
messages: 167919
nosy: apalala
priority: normal
severity: normal
status: open
title: readline.clear_history() missing in test_readline.py
type: behavior
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



[issue15620] readline.clear_history() missing in test_readline.py

2012-08-10 Thread Juancarlo Añez

Juancarlo Añez added the comment:

$ dpkg -l | grep readline
ii  libreadline-dev 6.2-8   
GNU readline and history libraries, development files
ii  libreadline55.2-11  
GNU readline and history libraries, run-time libraries
ii  libreadline66.2-8   
GNU readline and history libraries, run-time libraries
ii  libreadline6-dev6.2-8   
GNU readline and history libraries, development files
ii  readline-common 6.2-8   
GNU readline and history libraries, common files

--

___
Python tracker 

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



[issue15564] cgi.FieldStorage should not call read_multi on files

2012-08-10 Thread Glenn Linderman

Glenn Linderman added the comment:

So the issue you perceive is that a correctly MIME-typed .mht file has a MIME 
type of multipart/related -- but that for the purposes of uploading the file, 
you don't want to treat it as that MIME type, but rather as an opaque data file.

Just give it a different MIME type at the time of upload, like 
application/octet-stream. That is appropriate, if your application wants to 
treat the data as an opaque data stream.

But, you say, none of the browsers support user-specified or user-selectable 
MIME types, but rather they infer the MIME type from the file extension.  So 
that sounds like a bug in the browsers... but also gives an out... change the 
name of the file before uploading it.

The only bug I see here is your comment that the parsing fails.

--

___
Python tracker 

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



[issue15620] readline.clear_history() missing in test_readline.py

2012-08-10 Thread Juancarlo Añez

Juancarlo Añez added the comment:

Check if clear_history() is available before calling it.

--
keywords: +patch
Added file: 
http://bugs.python.org/file26761/readline_clear_history_available.patch

___
Python tracker 

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



[issue15620] readline.clear_history() missing in test_readline.py

2012-08-10 Thread Juancarlo Añez

Changes by Juancarlo Añez :


Removed file: 
http://bugs.python.org/file26761/readline_clear_history_available.patch

___
Python tracker 

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



[issue15620] readline.clear_history() missing in test_readline.py

2012-08-10 Thread Juancarlo Añez

Juancarlo Añez added the comment:

Check if clear_history() is available before calling it.

--
Added file: 
http://bugs.python.org/file26762/readline_clear_history_available.patch

___
Python tracker 

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



[issue15610] PyImport_ImportModuleEx always fails in 3.3 with "ValueError: level must be >= 0"

2012-08-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9804aec74d4a by Brett Cannon in branch 'default':
Issue #15610: The PyImport_ImportModuleEx macro now calls
http://hg.python.org/cpython/rev/9804aec74d4a

--
nosy: +python-dev

___
Python tracker 

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



[issue15610] PyImport_ImportModuleEx always fails in 3.3 with "ValueError: level must be >= 0"

2012-08-10 Thread Brett Cannon

Brett Cannon added the comment:

Hopefully the 3rd-party code using PyImport_ImportModuleEx will work as 
expected with a 'level' of 0.

--
assignee:  -> brett.cannon
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



[issue15612] Rewrite StringIO to use the _PyUnicodeWriter API

2012-08-10 Thread STINNER Victor

STINNER Victor added the comment:

> I would like to know why that is the case.
> If PyUnicode_Join is not optimal, then perhaps we should
> better optimize it.

I don't know. _PyUnicodeWriter overallocates its buffer (+25%). It may reduce 
the number of realloc(), and so the number of times that the buffer is copied.

--

___
Python tracker 

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



[issue15612] Rewrite StringIO to use the _PyUnicodeWriter API

2012-08-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> > I would like to know why that is the case.
> > If PyUnicode_Join is not optimal, then perhaps we should
> > better optimize it.
> 
> I don't know. _PyUnicodeWriter overallocates its buffer (+25%). It may
> reduce the number of realloc(), and so the number of times that the
> buffer is copied.

But PyUnicode_Join doesn't realloc() anything, since it creates a buffer
of exactly the right size. So this can't be the answer.

--

___
Python tracker 

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



[issue15621] UnboundLocalError on simple in-place assignment of an inner scope

2012-08-10 Thread zipher

New submission from zipher:

>>> num = 1
>>> def t1():
  print num
>>> t1()
1
>>> def t2():
...   num+=1
...   print num
>>> t2()
UnboundLocalError: local variable 'num' referenced before assignment

It seems num is bound in t1, but not t2, even though they are the same scope.  
Am I missing something?

--
components: Interpreter Core
messages: 167928
nosy: Mark.Janssen
priority: normal
severity: normal
status: open
title: UnboundLocalError on simple in-place assignment of an inner scope
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



[issue15621] UnboundLocalError on simple in-place assignment of an inner scope

2012-08-10 Thread R. David Murray

R. David Murray added the comment:

In t2, you assign to num.  That makes it local.  In t1, you don't, so num is 
picked up from the global scope.

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



[issue15596] pickle: Faster serialization of Unicode strings

2012-08-10 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



  1   2   >