[issue18168] plistlib output self-sorted dictionary

2013-06-10 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I'm reworking the patch in #14455 and one of the things I intend to do is to 
add a keyword argument that controls whether or not the keys in dictionaries 
will be sorted by plistlib.

--

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



[issue17941] namedtuple should support fully qualified name for more portable pickling

2013-06-10 Thread Stefan Drees

Changes by Stefan Drees ste...@drees.name:


--
nosy: +dilettant

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



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

2013-06-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perl's MIME::QuotedPrint produces same result as pure Python quopri. konwert 
qp-8bit produces same result as binascii (except '==41' it decodes as '=A').

RFC 2045 says:

A
  reasonable approach by a robust implementation might be
  to include the = character and the following
  character in the decoded data without any
  transformation and, if possible, indicate to the user
  that proper decoding was not possible at this point in
  the data.


--

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



[issue18110] Nested set comprehensions in class scope fail

2013-06-10 Thread Mark Dickinson

Mark Dickinson added the comment:

While I agree that this isn't an exact duplicate of #3692, the underlying cause 
is the same, and Python is working as designed and documented in this case.

In Python 2, list comprehensions don't have their own scope, so the `x` in your 
initial example lives at class scope.  However, the set comprehension *does* 
have its own scope.  By design, a variable defined at class scope is not 
visible to inner scopes inside that class.

In Python 3, this works because the list comprehension has its own scope.

See the documentation here:

http://docs.python.org/2/reference/executionmodel.html#naming-and-binding

and the `class A` example in particular.

Reclosing: there's no way this behaviour going to change in Python 2, and this 
particular case is no longer an issue in Python 3.

--
nosy: +mark.dickinson
resolution:  - invalid
status: open - closed

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



[issue18110] Nested set comprehensions in class scope fail

2013-06-10 Thread Mark Dickinson

Mark Dickinson added the comment:

won't fix is probably a better resolution.  But in the absence of that 
apostrophe-rich option, I'll use wont fix instead.

--
resolution: invalid - wont fix

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



[issue18178] Redefinition of malloc(3) family of functions at build time

2013-06-10 Thread rm

New submission from rm:

Hello.

Marcel Moolenaar (mar...@freebsd.org) pointed this out after committing FreeBSD 
revision 250991 [1], that makes the malloc(3) family of functions weak symbols. 
I'm citing him, because (silly me) I don't understand all of this completely:


After my commit to head that makes the malloc(3) family of functions weak 
symbols, a bug in what appears to be the Python build was exposed. The net 
effect of the bug is that _ctypes.so contains (strong) definitions of the 
malloc(3) family of functions and resulting in unintended symbol resolution.

_ctypes.so incorporates the libffi functionality for what I presume is
the basis for Python bindings. libffi includes dlmalloc.c, an open source 
allocator. dlmalloc.c is incuded by closures.c and closures.c defines 
USE_DL_PREFIX. On top of that closures.c makes all allocator functions static. 
This, therefore adds a memory allocator to libffi without exposure of standard 
symbols In short: dlmalloc.c never gets compiler separately or independently 
for this reason.

The python build however compiles dlmalloc.c separately/independently. As such, 
dlmalloc.c now defines and exports the malloc(3) family of functions and it 
also get linked into _ctypes.so. Thus when libffi is built as part of the 
Python build, the set of symbols exported is different from when libffi is 
compiled as a port.


The simplest test case is this (on a -current machines):

1.  Build  install lang/python27 (unmodified; if needed)
2.  try and build databases/py-sqlite3

The build of databases/py-sqlite3 fails because this:
running config
*** Signal 11

On amd64 I observed an assertion failure of FreeBSD's malloc, with
the same effect.


Manually triggering this:

fbsdvm% pwd
/usr/ports/databases/py-sqlite3/work/Python-2.7.5/Modules

fbsdvm% /usr/local/bin/python2.7 setup.py config
running config
Segmentation fault

But if symbols are resolved non-lazily, things change:

fbsdvm% setenv LD_BIND_NOW yes
fbsdvm% /usr/local/bin/python2.7 setup.py config
running config

This demonstrates how, after loading _ctypes.so, malloc(3) and friends
get resolved differently and thus inconsistently from before.

The publicly visible symbols in _ctypes.so, also show the problem:

fbsdvm% nm /usr/local/lib/python2.7/lib-dynload/_ctypes.so | grep ' T ' | egrep 
'(alloc)|(free)'
c3f0 T _ctypes_alloc_callback
5250 T _ctypes_alloc_format_string
00016d10 T calloc
000121e0 T ffi_closure_alloc
00013760 T ffi_closure_free
00016050 T free
000170c0 T independent_calloc
000172d0 T independent_comalloc
000148e0 T malloc
00017460 T malloc_footprint
00017480 T malloc_max_footprint
000175c0 T malloc_stats
00017440 T malloc_trim
000176e0 T malloc_usable_size
000173a0 T pvalloc
00016d90 T realloc
00017310 T valloc

There are definitions of malloc(3) and friends that shouldn't be there.


We have similar reports in our bug-tracker [2] and [3]. And the patch attached 
fixes this for post-r250991 versions of FreeBSD, and noop for earlier versions. 
The same patch applied to python2.7, python3.2, python3.3 and patched in 
FreeBSD ports tree locally.

[1] http://svnweb.freebsd.org/changeset/base/250991
[2] http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179102
[3] http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179413

--
components: ctypes
files: patch-Modules-_ctypes-libffi_fficonfig.py.in
messages: 190892
nosy: cvs-src
priority: normal
severity: normal
status: open
title: Redefinition of malloc(3) family of functions at build time
type: crash
versions: Python 2.7
Added file: 
http://bugs.python.org/file30522/patch-Modules-_ctypes-libffi_fficonfig.py.in

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



[issue17269] getaddrinfo segfaults on OS X when provided with invalid arguments combinations

2013-06-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4d1e4bc6c5b5 by Ronald Oussoren in branch '2.7':
Ensure that the fix for #17269 also works on OSX 10.4
http://hg.python.org/cpython/rev/4d1e4bc6c5b5

New changeset ef103e7e7af2 by Ronald Oussoren in branch '3.3':
Ensure that the fix for #17269 also works on OSX 10.4
http://hg.python.org/cpython/rev/ef103e7e7af2

New changeset 062f1985a5b7 by Ronald Oussoren in branch 'default':
(3.3-default) Ensure that the fix for #17269 also works on OSX 10.4
http://hg.python.org/cpython/rev/062f1985a5b7

--

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



[issue17134] Use Windows' certificate store for CA certs

2013-06-10 Thread Christian Heimes

Christian Heimes added the comment:

Ezio already reviewed my code. But sure I can wait a couple of days. The second 
part of the patch depends on #18138 anyway.

--

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



[issue18178] Redefinition of malloc(3) family of functions at build time

2013-06-10 Thread Serhiy Storchaka

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


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

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



[issue14455] plistlib unable to read json and binary plist files

2013-06-10 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I've attached issue14455-v2.txt with an updated patch. The patch is still very 
much a work in progress, I haven't had as much time to work on this as I'd like.

This version:
* Should apply cleanly to the tip of the default branch

* Move around some code.

* Doesn't pass unit tests (most likely because I've botched the manual
  merge). The unittests also don't cover the functionality I've added.

* Adds documentation

* Adds 'skipkeys' and 'sort_keys' to the write functions (with the 
  same semantics as these keywords have with json.dump)

* Adds 'data_as_bytes' to the read functions. Then this option is true
  binary data is returned as an instance of bytes instead of plistlib.Data
  The latter is still the default.

--
Added file: http://bugs.python.org/file30523/issue14455-v2.txt

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



[issue18110] Nested set comprehensions in class scope fail

2013-06-10 Thread Eric Wieser

Eric Wieser added the comment:

Thanks for the clarification - this behavior now makes perfect sense to me. As 
expected, swapping the list comprehension for a generator comprehension, or 
vice versa, prevents the error.

--

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



[issue18178] Redefinition of malloc(3) family of functions at build time

2013-06-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Said simpler: dlmalloc.c code is indeed compiled twice:
- once as part of closures.c, which #include dlmalloc.c; this is done 
carefully (with 'static' and 'USE_DL_PREFIX') to not clash with standard malloc 
functions.
- once as a separate target; without USE_DL_PREFIX it will define functions 
named malloc() and free()...

The second one is not necessary, of course. The patch looks good to me.

--

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



[issue18179] SMTP.local_hostname is undocumented

2013-06-10 Thread Jonas H.

New submission from Jonas H.:

The Sphinx docs don't contain any explanation for `local_hostname`.

--
assignee: docs@python
components: Documentation
messages: 190898
nosy: docs@python, jonash
priority: normal
severity: normal
status: open
title: SMTP.local_hostname is undocumented
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

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



[issue2771] Test issue

2013-06-10 Thread Berker Peksag

Berker Peksag added the comment:

Lib/smtplib.py#l226
Lib/smtplib.py:l226
Lib/smtplib.py#226
Lib/smtplib.py:226

--
nosy: +berker.peksag

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



[issue18179] SMTP.local_hostname is undocumented

2013-06-10 Thread Berker Peksag

Berker Peksag added the comment:

The docstring of the SMTP class says:

If specified, `local_hostname` is used as the FQDN of the local host.  By 
default, the local hostname is found using socket.getfqdn().

See Lib/smtplib.py:226.

--
nosy: +berker.peksag
versions:  -Python 2.6, Python 3.1, Python 3.2, Python 3.5

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



[issue18180] Refleak in test_imp on Windows

2013-06-10 Thread Richard Oudkerk

New submission from Richard Oudkerk:

Seems to be in error path of _PyImport_GetDynLoadWindows().

--
files: load_dynamic.patch
keywords: patch
messages: 190901
nosy: sbt
priority: normal
severity: normal
status: open
title: Refleak in test_imp on Windows
Added file: http://bugs.python.org/file30524/load_dynamic.patch

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



[issue14455] plistlib unable to read json and binary plist files

2013-06-10 Thread Ronald Oussoren

Changes by Ronald Oussoren ronaldousso...@mac.com:


Added file: http://bugs.python.org/file30525/issue14455-v3.txt

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



[issue14455] plistlib unable to read json and binary plist files

2013-06-10 Thread Ronald Oussoren

Ronald Oussoren added the comment:

v3 is still a work in progress, and still fails some tests

* Replaced test data by data generated by a helper script (to make it
  easier to update)

* Use 'subtest' feature of unittest library in 3.4

* Small tweaks to plist library (the dump/load/dumps/loads function at
  the end probably won't survive)

* Updated link to the CFBinaryPlist.c source code (this should be a 
  newer version of the file)

* Added option to readPlist to pass in the dictionary type (defaults
  to plistlib._InternalDict). This is primarily useful for testing
  and debugging, but also mirrors the 'sortkeys' keyword argument for
  the writer (when the order can be important for writing the user should
  have some way to detect the order when reading).

The data generated by the binary plist generator does't match the data 
generated by Cocoa in OSX 10.8 (and generated by the helper script), I haven't 
fully debugged that problem yet.  The generated binary plist
and the Cocoa version can both be parsed by plistlib, and result in the same 
data structure

--
Added file: http://bugs.python.org/file30526/plistlib_generate_testdata.py

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



[issue14455] plistlib unable to read json and binary plist files

2013-06-10 Thread Ronald Oussoren

Ronald Oussoren added the comment:

See also:

#18168: request for the sort_keys option
#11101: request for an option to ignore 'None' values when writing
#9256: datetime.datetime objects created by plistlib don't include timezone 
information
(and looking at the code I'd say that timezones are ignored when *writing* 
plist files as well)
#10733: Apple's plist can create malformed XML (control characters) than cannot 
be read by plistlib

--

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



[issue18179] SMTP.local_hostname is undocumented

2013-06-10 Thread R. David Murray

R. David Murray added the comment:

SMTP.local_hostname is probably a private attribute of the SMTP class, dating 
from before we started getting strict about having private attributes start 
with '_'.  However, I see no reason to keep it private; we might as well just 
document it, since I'm sure people are using it and there is no reason to 
expect to want to change its behavior.

--
components: +email
nosy: +barry, r.david.murray
stage:  - needs patch
type:  - enhancement

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



[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Ronald Oussoren

New submission from Ronald Oussoren:

Super() walks the MRO and looks for the looked-up attribute in the __dict__ of 
types on the MRO. This can cause problems when classes implement 
__getattribute__: a class on the MRO can implement a method that super() won't 
find because it isn't in the class __dict__ (yet).

I'm running into this with PyObjC: the __dict__ for the Python proxies for 
Objective-C classes are filled lazily (*) by tp_getattro (__getattribute__ in 
Python) to speed up the bridge and because ObjC is almost as dynamic as Python 
and methods might appear during runtime (without there being a hook for 
detecting such changes).

A possible solution to this:

* Add a tp_getattro_super (**) slot to PyTypeObject, with the 
  same signature as tp_getattro, but that only looks at this particular
  class (as opposed to tp_getattro that walks the entire MRO and looks
  in the object's __dict__)  (***)

* The tp_gettro of super calls tp_getattro_super of types of along the
  MRO when that slot is not NULL, and uses the current implementation
  (look in tp_dict) when the slot is NULL.

Would such a change be acceptable?

Open issues:

* Does the new slot get exposed to Python code 
  (and if so, under which name)?

* Should PyObject_GenericGetAttr use the new slot as well?


Footnotes:

(*) The current release of PyObjC (2.5) eagerly tries to keep the proxy class 
__dict__ up to date, an upcoming major release will be as lazy as possible to 
speed up the bridge. The problem can with some effert be triggered with PyObjC 
2.5, and triggering it is easy in the upcoming major release

(**) Or some better name

(***) I'm being very sloppy in my use of terminology here, hopefully my 
proposal is clear enough anyway.

--
components: Interpreter Core
messages: 190905
nosy: ronaldoussoren
priority: normal
severity: normal
stage: needs patch
status: open
title: super vs. someclass.__getattribute__
type: behavior
versions: Python 3.4

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



[issue18182] xml.dom.createElement() does not take implicit namespaces into account

2013-06-10 Thread Alexander Tobias Heinrich

New submission from Alexander Tobias Heinrich:

First of all, I am not sure, if this is a bug in python itself - it could as 
well be a bug in the py-dom-xpath module 
(http://code.google.com/p/py-dom-xpath) or not a bug at all (but I find the 
latter to be highly unlikely).

Consider an XML document such as:
?xml version=1.0 encoding=utf-8?
Zoo xmlns='http://foo.bar/zoo'
  CompoundChimp//Compound
/Zoo

If one creates a new Chimp-element using the xml.dom.createElement() function 
and then appends it to the Compound element, then the xpath module will not 
find the element unless the whole document is saved and then re-parsed.

Creating the element with xml.dom.createElementNS() and thus explicitly 
specifying its namespace works around the problem.

I consider this to be a bug, because in both cases, xml.dom will create the 
same valid XML, so I believe xpath should produce the same results in both 
cases, too. My believe, that the bug is in xml.dom is just a feeling and I 
could be wrong. I imagine, that xml.dom.createElement() forgets about adding 
the new element to its inherited namespace and adds it to the null namespace 
instead. In consequence xpath doesn't find the new element.

I originally posted a more verbose explanation of this issue to StackOverflow 
(see 
http://stackoverflow.com/questions/16980521/python-xpath-find-wont-find-new-elements-if-they-were-added-without-namespac
), because I was unsure about whether this is a bug or not - and if it was, 
then in which module. Because I did not receive any feedback on that post, I 
have now decided to file it here as a bug report.

I attached a sample script that demonstrates the problem if (xpath dependency 
is installed). I tested it under Windows with Python 2.7.5 and 2.7.4.

--
components: XML
files: pydomprob.py
messages: 190906
nosy: Alexander.Tobias.Heinrich
priority: normal
severity: normal
status: open
title: xml.dom.createElement() does not take implicit namespaces into account
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file30527/pydomprob.py

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Dave Challis

New submission from Dave Challis:

This occurred when attempting to decode invalid UTF-8 bytes using 
errors='replace', then attempting to lowercase the produced unicode string.

This was also tested in python 2.7, but it doesn't occur there.

Code to reproduce:

x = 
b'\xe2\xb3\x99\xb3\xd1\x9f\xe0vjGd|\x12\xf2\x84\xac\xae$\xa4\xae+\xa4sbtf$fG\xfb\xe6?.\xe2sbv\x14\xcb\x89\x98\xda\xd9\x99\xda\xb9d9\x1bY\x99\xb7\xb3\x1b9\xa2y*B\xa3\xba\xefjg\xe2\x92Et\x85~\xbf\x8a\xe3\x919\x8bvc\xfb#$$.\xber6Db.#4\xa4.\x13RtI\x10\xed\x9c\xd0\x98\xb8\x18\x91\x99\\\nC\x13\x8dV\xccL\xf4\x89\x9c\x90'

x = x.decode('utf-8', errors='replace')

x.lower()


Output:
Traceback (most recent call last):
  File stdin, line 1, in module
SystemError: invalid maximum character passed to PyUnicode_New

--
components: Unicode
messages: 190907
nosy: davechallis, ezio.melotti
priority: normal
severity: normal
status: open
title: Calling .lower() on certain unicode string raises SystemError
type: behavior
versions: Python 3.3

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



[issue18177] Typo in Documents

2013-06-10 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Confirmed.  I think this is a general typographic issue in the PDF 
documentation.  If I cut-and-paste the datetime.isoformat(sep='T') line from 
the PDF, the single quotes are pasted as U+2019 RIGHT SINGLE QUOTE.  

Looking at the library.tex file built by make pdflatex, it contains the ASCII 
single quotes, so LaTeX is responsible for turning the quotes into smart quotes.

I don't know if this is worth fixing and can see arguments both ways.  The 
smart quotes are readable and I doubt a reader will be confused and try to 
actually type them in their source code.  OTOH it's annoying that 
cut-and-pasting code from the PDFs won't work.

--
nosy: +akuchling

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



[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Do you have an example in pure Python code?

--
nosy: +amaury.forgeotdarc

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



[issue18177] Typo in Documents

2013-06-10 Thread R. David Murray

R. David Murray added the comment:

I presume that tex doesn't do quote-transformation on code blocks (it is not 
really smart quotes, since IIRC in tex you actually have to specify ` and ' in 
the correct places yourself).  So perhaps the problem is that the function 
headers c aren't being properly marked up as code in the latex output engine 
of Sphinx?

--
nosy: +r.david.murray

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



[issue18177] Incorect quote marks in code section-headers in PDF version of docs

2013-06-10 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
title: Typo in Documents - Incorect quote marks in code section-headers in PDF 
version of docs

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



[issue18180] Refleak in test_imp on Windows

2013-06-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ec854f76d6b9 by Richard Oudkerk in branch '3.3':
Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
http://hg.python.org/cpython/rev/ec854f76d6b9

--
nosy: +python-dev

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Serhiy Storchaka

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


--
components: +Interpreter Core
nosy: +serhiy.storchaka
stage:  - needs patch
versions: +Python 3.4

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



[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I didn't, but the attached script should do the trick. The code suffers badly 
from copypaste editing, but more or less has the same behavior as PyObjC.

It defines a subclass of list (MyList) with an append method, and more 
importantly also defines 3 proxy classes: ProxyObject, ProxyList and 
ProxyMyList that are proxy types for object, list and MyList.

At the end I try to access methods on instances of a proxy objects for MyList, 
and finally try to access super(MyList, v).append. That only works when 
append is in the __dict__ for ProxyList (for example by uncommenting the 3 
lines just above the use of super()).

--
Added file: http://bugs.python.org/file30528/supers.py

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



[issue14455] plistlib unable to read json and binary plist files

2013-06-10 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The test failure I'm getting is caused by a difference in the order in which 
items are written to the archive. I'm working on a fix.

--

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



[issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines

2013-06-10 Thread Chris AtLee

Chris AtLee added the comment:

To demonstrate how to hit this in a real use case, run the attached script 
which implements a simple http server that saves POSTed files to a local file 
got_data. It returns the sha1sum of the POSTed file as the http response.

Then, create a test file consisting of 65,535 null bytes, and submit with curl.

- % dd if=/dev/zero of=data bs=1 count=65535   

65535+0 records in
65535+0 records out
65535 bytes (66 kB) copied, 0.0890487 s, 736 kB/s

- % sha1sum data
391edab7225a1de662ebc3a1a670a20d8e6a226b  data

- % curl -Fdata=@data http://localhost:8080/
8dd623ef130a8cd3e97086101a6e1255a91fb916%

--
Added file: http://bugs.python.org/file30529/test_cgi_server.py

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



[issue18174] Make regrtest with --huntrleaks check for fd leaks

2013-06-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a7381fe515e8 by Richard Oudkerk in branch '2.7':
Issue #18174: Fix fd leaks in tests.
http://hg.python.org/cpython/rev/a7381fe515e8

New changeset 46fe1bb0723c by Richard Oudkerk in branch '3.3':
Issue #18174: Fix fd leaks in tests.
http://hg.python.org/cpython/rev/46fe1bb0723c

--
nosy: +python-dev

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Minimal example:

 '\U0001\U0010'.lower()
Traceback (most recent call last):
  File stdin, line 1, in module
SystemError: invalid maximum character passed to PyUnicode_New

--

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Serhiy Storchaka

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


--
assignee:  - serhiy.storchaka

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



[issue18180] Refleak in test_imp on Windows

2013-06-10 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - resource usage
versions: +Python 3.3, Python 3.4

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It happens due to use fast MAX_MAXCHAR() which can produce maxchar out of range 
(0x1 | 0x10  MAX_UNICODE).

--

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



[issue18174] Make regrtest with --huntrleaks check for fd leaks

2013-06-10 Thread Richard Oudkerk

Richard Oudkerk added the comment:

The test_shutil leak is caused by #17899.  The others are fixed by  
a7381fe515e8 and 46fe1bb0723c.

--

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

 a = chr(0x84b2e)+chr(0x109710)
 a.lower()
SystemError: invalid maximum character passed to PyUnicode_New

The MAX_MAXCHAR() macro only works for 'maxchar' values, like 0xff, 0x...  
in do_upper_or_lower() it's used with arbitrary UCS4 values.

--
nosy: +amaury.forgeotdarc, haypo

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



[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

issue783528 was a bit similar.

--

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



[issue18181] super vs. someclass.__getattribute__

2013-06-10 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Looks like it. That issue was closed without a good reason though.

--

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



[issue14455] plistlib unable to read json and binary plist files

2013-06-10 Thread Ronald Oussoren

Ronald Oussoren added the comment:

v4 passes the included tests. 

The testsuite isn't finished yet.

--
Added file: http://bugs.python.org/file30530/issue14455-v4.txt

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 89b106d298a9 by Benjamin Peterson in branch '3.3':
remove MAX_MAXCHAR because it's unsafe for computing maximum codepoitn value 
(see #18183)
http://hg.python.org/cpython/rev/89b106d298a9

New changeset 668aba845fb2 by Benjamin Peterson in branch 'default':
merge 3.3 (#18183)
http://hg.python.org/cpython/rev/668aba845fb2

--
nosy: +python-dev

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I simply removed the MAX_MAXCHAR micro-optimization, since it seems fairly 
unsafe. Interested parties can restore it safely if they wish.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread STINNER Victor

STINNER Victor added the comment:

Oops, my MAX_MAXCHAR macro was too optimized :-) (the result is incorrect)

It shows us that the test suite does not have enough test on non-BMP characters.

--

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



[issue18178] Redefinition of malloc(3) family of functions at build time

2013-06-10 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I don't have a system affected by the change, but the explanation and the patch 
look right to me.

FWIW, the patch applies cleanly to 3.4 head and passes 'make test'.

--
stage:  - commit review
versions: +Python 3.3, Python 3.4

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



[issue18182] xml.dom.createElement() does not take implicit namespaces into account

2013-06-10 Thread Jeremy Kloth

Jeremy Kloth added the comment:

This really is not a bug, but more of a (common) misunderstanding of how the 
mixing of namespace-aware (createElementNS) and namespace-ignorant 
(createElement) methods work.

From DOM3 Core 
[http://www.w3.org/TR/DOM-Level-3-Core/core.html#Namespaces-Considerations]:

  Elements and attributes created by the DOM Level 1 methods do not
  have a namespace prefix, namespace URI or local name.

DOM4 updates this to say that the namespace URI and prefix are null if not 
explicitly given at creation.

To use your example, adding a Chimp-element to the existing document is really:

?xml version=1.0 encoding=utf-8?
Zoo xmlns='http://foo.bar/zoo'
  CompoundChimp/Chimp xmlns=//Compound
/Zoo

The fact that serializing and re-parsing it works is really a bug in the 
serializing code not honoring the null-namespace.

So in short, always use create*NS() methods when dealing with namespace-aware 
XML (like XPath).

--
nosy: +jkloth

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



[issue13248] deprecated in 3.2/3.3, should be removed in 3.4

2013-06-10 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +berker.peksag

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



[issue18176] Builtins documentation refers to old version of UCD.

2013-06-10 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


--
hgrepos: +197

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



[issue18176] Builtins documentation refers to old version of UCD.

2013-06-10 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file30531/686836ad3042.diff

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



[issue18176] Builtins documentation refers to old version of UCD.

2013-06-10 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

This is a trivial change, but I would like someone to review this in case there 
is a better solution to keep this in sync with unicodedata.unidata_version.

--
assignee:  - docs@python
keywords: +needs review
nosy: +docs@python
stage:  - commit review

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



[issue9263] Try to print repr() when an C-level assert fails (in the garbage collector, beyond?)

2013-06-10 Thread Bohuslav Slavek Kabrda

Bohuslav Slavek Kabrda added the comment:

I'm currently patching Python 3.3.2 with this, so I thought it might be nice to 
attach an up-to-date patch. The only notable difference is that I added 
self.preclean() at the beginning of test_refcount_errors - without it, running 
test suite produced a huge number of these lines:

Exception AttributeError: 'GCCallbackTests' object has no attribute 'visit' 
in bound method GCCallbackTests.cb1 of __main__.GCCallbackTests 
testMethod=test_refcount_errors ignored

--
nosy: +bkabrda
Added file: http://bugs.python.org/file30532/00170-gc-assertions.patch

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are additional tests for this issue.

--
keywords: +patch
stage: needs patch - patch review
status: closed - open
Added file: http://bugs.python.org/file30533/test_issue18183.patch

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



[issue10382] Command line error marker misplaced on unicode entry

2013-06-10 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

The latest patch at #2382 is simpler than mine, so I am closing this as 
duplicate.

--
resolution:  - duplicate
status: open - closed
superseder:  - [Py3k] SyntaxError cursor shifted if multibyte character is in 
line.

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread STINNER Victor

STINNER Victor added the comment:

+'\U0001\U0010'.lower()

Why not checking the result of these calls?

--

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



[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.

2013-06-10 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

haypo The purpose of this issue is to handle CJK characters taking 2 haypo 
columns instead of 1 in a terminal, or did I misunderstand it?

That's the other half of the problem, but the more common issue is misplaced 
caret when non-ascii characters are present:

 ¡™£¢∞§¶•ªº
  File stdin, line 1
¡™£¢∞§¶•ªº
  ^
SyntaxError: invalid character in identifier

With Serhiy's patch:

 ¡™£¢∞§¶•ªº
  File stdin, line 1
¡™£¢∞§¶•ªº
 ^
SyntaxError: invalid character in identifier

--
nosy: +belopolsky

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



[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.

2013-06-10 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Serhiy's patch is lacking tests, but it passes the test I proposed at #10382 at 
attaching here.

--
Added file: http://bugs.python.org/file30534/test.py

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



[issue18183] Calling .lower() on certain unicode string raises SystemError

2013-06-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The result is trivial. Is not checking the result distract an attention from 
the main issue?

--

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



[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Currently PyUnicode_FromFormat doesn't check an argument for %c and can raise 
SystemError only due maxchar check in PyUnicode_New. On 2.7 an error doesn't 
raised, but %c argument can be silently wrapped (on narrow build) or illegal 
Unicode string can be created (on wide build). The proposed patch adds explicit 
range check for %c argument.

--
components: Interpreter Core, Unicode
files: format_c.diff
keywords: patch
messages: 190935
nosy: ezio.melotti, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add range check  for %c in PyUnicode_FromFormat
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30535/format_c.diff

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



[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-10 Thread Serhiy Storchaka

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


Added file: http://bugs.python.org/file30536/format_c-2.7.diff

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



[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-10 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

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



[issue18176] Builtins documentation refers to old version of UCD.

2013-06-10 Thread Serhiy Storchaka

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


--
components: +Documentation, Unicode
nosy: +ezio.melotti

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



[issue3329] API for setting the memory allocator used by Python

2013-06-10 Thread STINNER Victor

STINNER Victor added the comment:

py_setallocators-filename.patch: Here is a try to define an API providing the 
filename and line number of the C code. The Py_SetAllocators() API is unchanged:

PyAPI_FUNC(int) Py_SetAllocators(
char api,
void* (*malloc) (size_t size, void *user_data),
void* (*realloc) (void *ptr, size_t size, void *user_data),
void (*free) (void *ptr, void *user_data),
void *user_data
);

If Python is compiled with -DPYMEM_TRACE_MALLOC, user_data is not the last 
parameter passed to Py_SetAllocators() but a pointer to a _PyMem_Trace 
structure:

typedef struct {
void *data;
/* NULL and -1 when unknown */
const char *filename;
int lineno;
} _PyMem_Trace;


The problem is that the module using Py_SetAllocators() must be compiled 
differently depending on PYMEM_TRACE_MALLOC. Example from pytracemalloc, 
modified for this patch:
---
_PyMem_Trace *ctrace;
trace_api_t *api;
void *call_data;
void *ptr;
#ifdef PYMEM_TRACE_MALLOC
ctrace = (_PyMem_Trace *)data;
api = (trace_api_t *)ctrace-data;
ctrace-data = api-data;
call_data = data;
#else
ctrace = NULL;
api = (trace_api_t *)data;
call_data = api-data;
#endif
ptr = api-malloc(size, call_data);
...
---
I didn't like the ctrace-data = api-data; instruction: pytracemalloc 
modifies the input _PyMem_Trace structure.


pytracemalloc code is a little bit more complex, but it works. pytracemalloc 
can reuse the filename and line number of the C module, or of the Python 
module. It can be configured at runtime. Example of output for the C module:
---
2013-06-11 00:36:30: Top 15 allocations per file and line (compared to 
2013-06-11 00:36:25)
#1: Objects/dictobject.c:352: size=6 MiB (+4324 KiB), count=9818 (+7773), 
average=663 B
#2: Objects/unicodeobject.c:1085: size=6 MiB (+2987 KiB), count=61788 (+26197), 
average=111 B
#3: Objects/tupleobject.c:104: size=4054 KiB (+2176 KiB), count=44569 (+24316), 
average=93 B
#4: Objects/typeobject.c:770: size=2440 KiB (+1626 KiB), count=13906 (+10360), 
average=179 B
#5: Objects/bytesobject.c:107: size=2395 KiB (+1114 KiB), count=24846 (+11462), 
average=98 B
#6: Objects/funcobject.c:12: size=1709 KiB (+1103 KiB), count=11516 (+7431), 
average=152 B
#7: Objects/codeobject.c:117: size=1760 KiB (+871 KiB), count=11267 (+5578), 
average=160 B
#8: Objects/dictobject.c:399: size=784 KiB (+627 KiB), count=10040 (+8028), 
average=80 B
#9: Objects/listobject.c:159: size=420 KiB (+382 KiB), count=5386 (+4891), 
average=80 B
#10: Objects/frameobject.c:649: size=1705 KiB (+257 KiB), count=3374 (+505), 
average=517 B
#11: ???:?: size=388 KiB (+161 KiB), count=588 (+240), average=676 B
#12: Objects/weakrefobject.c:36: size=241 KiB (+138 KiB), count=2579 (+1482), 
average=96 B
#13: Objects/dictobject.c:420: size=135 KiB (+112 KiB), count=2031 (+1736), 
average=68 B
#14: Objects/classobject.c:59: size=109 KiB (+105 KiB), count=1400 (+1345), 
average=80 B
#15: Objects/unicodeobject.c:727: size=188 KiB (+86 KiB), count=1237 (+687), 
average=156 B
37 more: size=828 KiB (+315 KiB), count=8421 (+5281), average=100 B
Total Python memory: size=29 MiB (+16 MiB), count=212766 (+117312), average=145 
B
Total process memory: size=68 MiB (+22 MiB) (ignore tracemalloc: 0 B)
---


I also had to modify the following GC functions to get more accurate 
information:

- _PyObject_GC_Malloc(size)
- _PyObject_GC_New(tp)
- _PyObject_GC_NewVar(tp, nitems)
- PyObject_GC_Del(op)

For example, PyTuple_New() calls PyObject_GC_NewVar() to allocate its memory. 
With my patch, you get Objects/tupleobject.c:104 instead of a generic 
Modules/gcmodule.c:1717.

--
Added file: http://bugs.python.org/file30537/py_setallocators-filename.patch

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



[issue18114] Update PyImport_ImportFrozenModuleObject() to set __package__

2013-06-10 Thread Brett Cannon

Brett Cannon added the comment:

Forgot that PyImport_ImportFrozenModule() uses 
PyImport_ImportFrozenModuleObject() and the former is used to load 
_frozen_importlib, so can't drop the function. The code could still be updated, 
though, to set __package__ before the code object is executed. That probably 
wouldn't be too hard to do by factoring out the code in 
PyImport_ImportModuleLevelObject which calculates the parent there.

--
assignee: brett.cannon - 
priority: normal - low
title: Update PyImport_ImportFrozenModuleObject() to use importlib - Update 
PyImport_ImportFrozenModuleObject() to set __package__

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



[issue18114] Update PyImport_ImportFrozenModuleObject() to set __package__

2013-06-10 Thread Brett Cannon

Brett Cannon added the comment:

Marking as easy for any C coders.

--
keywords: +easy

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



[issue3329] API for setting the memory allocator used by Python

2013-06-10 Thread STINNER Victor

STINNER Victor added the comment:

New version of the patch, py_setallocators-3.patch:
 - _PyMem_DebugMalloc(), _PyMem_DebugFree() and _PyMem_DebugRealloc() are now 
setup as hooks to the system allocator and are hook on PyMem API *and* on 
PyObject API
 - move if (size  PY_SSIZE_T_MAX) check into PyObject_Malloc() and 
PyObject_Realloc()

This patch does not propose a simple API to reuse internal debug hooks when 
replacing system (PyMem) allocators.

--
Added file: http://bugs.python.org/file30538/py_setallocators-3.patch

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



[issue18185] Error in test_set.TestVariousIteratorArgs.test_inline_methods

2013-06-10 Thread Sye van der Veen

New submission from Sye van der Veen:

I'm working with Python's test suite and noticed this error:
http://hg.python.org/cpython/file/668aba845fb2/Lib/test/test_set.py#l1669
  # etc...
  for g in (G, I, Ig, L, R):
expected = meth(data)
actual = meth(G(data))
  # etc...
I believe the assignment to actual should be using a lower-case 'g'.

--
components: Tests
messages: 190941
nosy: syeberman
priority: normal
severity: normal
status: open
title: Error in test_set.TestVariousIteratorArgs.test_inline_methods
type: behavior

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



[issue18168] plistlib output self-sorted dictionary

2013-06-10 Thread halfjuice

halfjuice added the comment:

Awesome. Thanks Ronald!

--

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



[issue18048] Merging test_pep263.py and test_coding.py

2013-06-10 Thread Matthew Bentley

Matthew Bentley added the comment:

OK, I think I fixed this.  I merged the two tests into one, called 
test_source_encoding.py.  It doesn't fail, and I'm not sure what else I need to 
do.  

Patch is attached.

This is also my first patch, so please tell me if I'm doing anything wrong.

--
keywords: +patch
nosy: +Matthew.Bentley
Added file: http://bugs.python.org/file30539/fix_issue_18048.patch

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



[issue17963] Deprecate the frame hack for implicitly getting module details

2013-06-10 Thread Eric Snow

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


--
nosy: +eric.snow

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



[issue17511] Idle find function closes after each find operation

2013-06-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 73de0794ae71 by Roger Serwy in branch '2.7':
#17511: Keep IDLE find dialog open after clicking Find Next.
http://hg.python.org/cpython/rev/73de0794ae71

New changeset dac11f143581 by Roger Serwy in branch '3.3':
#17511: Keep IDLE find dialog open after clicking Find Next.
http://hg.python.org/cpython/rev/dac11f143581

New changeset 67714c4d9725 by Roger Serwy in branch 'default':
#17511: merge with 3.3.
http://hg.python.org/cpython/rev/67714c4d9725

--
nosy: +python-dev

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



[issue17511] Idle find function closes after each find operation

2013-06-10 Thread Roger Serwy

Roger Serwy added the comment:

I'm closing this issue as fixed. Thank you for the patch, Sarah.

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

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



[issue18185] Error in test_set.TestVariousIteratorArgs.test_inline_methods

2013-06-10 Thread Berker Peksag

Berker Peksag added the comment:

Related changeset: http://hg.python.org/cpython/rev/54ff68e973ee#l12.1110

--
keywords: +patch
nosy: +berker.peksag
stage:  - patch review
versions: +Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30540/issue18185.diff

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



[issue10581] Review and document string format accepted in numeric data type constructors

2013-06-10 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

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



[issue16715] Get rid of IOError. Use OSError instead

2013-06-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I would wait and see if it happens gain or on other buildbots. As I am sure you 
know, intermittent failures, not reproducible on demand, are nasty.

--

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