[issue7456] rfc822.Message.getheaders undocumented

2009-12-07 Thread Tarek Ziadé

New submission from Tarek Ziadé :

rfc822 misses a doc about getheaders. 

Also, I am wondering why getheaders can't take a default value like
getheader.

--
assignee: georg.brandl
components: Documentation
messages: 96112
nosy: georg.brandl, tarek
severity: normal
status: open
title: rfc822.Message.getheaders undocumented
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-07 Thread nirinA raseliarison

nirinA raseliarison  added the comment:

may be some error when i send this the first time,
i cannot see the file, so i resend mathmodule.c.diff
sorry if you get it twice

--
Added file: http://bugs.python.org/file15491/mathmodule.c.diff

___
Python tracker 

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



[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-07 Thread nirinA raseliarison

nirinA raseliarison  added the comment:

finally, for the error function, with the same kind of idea as with expm1,
here is a pure python definition

these patches are against r27a1:76674

if all these make sense, i'll check for NAN, infinity, test suite...

--
Added file: http://bugs.python.org/file15490/erf.py

___
Python tracker 

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



[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-07 Thread nirinA raseliarison

nirinA raseliarison  added the comment:

for expm1, we use the Taylor development near zero, but
we have to precise what means small value for x. here this means
abs(x) < math.log(2.0).
one can also use abs(x) < C

--
Added file: http://bugs.python.org/file15489/mathmodule.c.diff

___
Python tracker 

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



[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-07 Thread nirinA raseliarison

nirinA raseliarison  added the comment:

having the gamma function, one certainly needs the other Euler constant:
C = 0.5772

the C constant is taken from GSL

--
Added file: http://bugs.python.org/file15488/pymath.h.diff

___
Python tracker 

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



[issue7455] cPickle: stack underflow in load_pop()

2009-12-07 Thread Eric Smith

Eric Smith  added the comment:

Can you add a test for this?

--
nosy: +eric.smith
stage:  -> test needed

___
Python tracker 

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



[issue7455] cPickle: stack underflow in load_pop()

2009-12-07 Thread STINNER Victor

New submission from STINNER Victor :

load_pop() pops a value if the stack length is >= 0. The test is wrong:
if the length is zero, the stack is empty and stackUnderflow() have to
be called.

Example:

  $ ../../python -c "import cPickle; cPickle.loads('0')"
  Erreur de segmentation

--
components: Extension Modules
files: cpickle_load_pop.patch
keywords: patch
messages: 96106
nosy: haypo
severity: normal
status: open
title: cPickle: stack underflow in load_pop()
versions: Python 2.7
Added file: http://bugs.python.org/file15487/cpickle_load_pop.patch

___
Python tracker 

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



[issue6071] no longer possible to hash arrays

2009-12-07 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

Will this be fixed for Python 2.7 final?

--

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-12-07 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



[issue5596] memory leaks in py3k

2009-12-07 Thread R. David Murray

Changes by R. David Murray :


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



[issue1537721] csv module: add header row to DictWriter

2009-12-07 Thread Skip Montanaro

Skip Montanaro  added the comment:

>> Isn't the alpha period (2.7 and 3.2 in this case) precisely when an
>> API can change?

Antoine> Well, it can, but only if there are compelling reasons to do
Antoine> so. It should be the exception rather than the rule.  The
Antoine> reasons here seem far from compelling, and moreover we can't
Antoine> detect whether the user is expecting the new or the old
Antoine> behaviour.

Fine.  Dirkjan, assuming there are the necessary test cases and
documentation changes, feel free to check in your patch and close the
ticket.

Skip

--

___
Python tracker 

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



[issue1537721] csv module: add header row to DictWriter

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Isn't the alpha period (2.7 and 3.2 in this case) precisely when an API can
> change?

Well, it can, but only if there are compelling reasons to do so. It
should be the exception rather than the rule.
The reasons here seem far from compelling, and moreover we can't detect
whether the user is expecting the new or the old behaviour.

--

___
Python tracker 

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



[issue1537721] csv module: add header row to DictWriter

2009-12-07 Thread Skip Montanaro

Skip Montanaro  added the comment:

Antoine> We can't change default behaviour because it will break
Antoine> compatibility, so an additional method looks ok to me.

>> Why can't default behavior be changed?

Antoine> Well, because it will break assumptions about the generated 
documents?

Isn't the alpha period (2.7 and 3.2 in this case) precisely when an API can
change?

Skip

--

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-12-07 Thread flox

Changes by flox :


Added file: 
http://bugs.python.org/file15486/issue5596_zipimport_support_py3k.diff

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-12-07 Thread flox

flox  added the comment:

Another false-positive in test_zipimport_support.
Both on 2.7 and 3.2.

Patch attached.

--
Added file: http://bugs.python.org/file15485/issue5596_zipimport_support.diff

___
Python tracker 

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



[issue7453] HPUX 11.00: socketmodule.c -- error 1588: "AI_PASSIVE" undefined.

2009-12-07 Thread Sridhar Ratnakumar

Changes by Sridhar Ratnakumar :


--
title: HPUX: socketmodule.c -- error 1588: "AI_PASSIVE" undefined. -> HPUX 
11.00: socketmodule.c -- error 1588: "AI_PASSIVE" undefined.

___
Python tracker 

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



[issue7453] HPUX: socketmodule.c -- error 1588: "AI_PASSIVE" undefined.

2009-12-07 Thread Sridhar Ratnakumar

Sridhar Ratnakumar  added the comment:

Yes, I even tried grep'ing the system header files. BTW, the build works 
fine on a newer HP-UX machine (11.22), whereas it fails only on a 
particular older version:

$ uname -a
HP-UX bertha B.11.00 U 9000/800 136901587 unlimited-user license

The documentation link you gave is applicable to 11i (which is >= 
11.11).

So I presume that AI_PASSIVE was made available only in later versions 
of HP-UX.

--

___
Python tracker 

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



[issue7451] improve json decoding performance

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is the patch.

--
Added file: http://bugs.python.org/file15484/json-opts3.patch

___
Python tracker 

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



[issue7451] improve json decoding performance

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've just noticed that there is a persistent decoder instance in
`json._default_decoder`. To avoid keeping references to past keys
forever, this updated patch clears the memo dict when a string has
finished decoding.

--

___
Python tracker 

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



[issue7451] improve json decoding performance

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Unless Bob applies it to simplejson as well, that is.

--

___
Python tracker 

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



[issue7454] Solaris SPARC: _multiprocessing.so: symbol sem_timedwait: referenced symbol not found

2009-12-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> jnoller
nosy: +jnoller
priority:  -> normal
versions: +Python 2.6, Python 3.1, Python 3.2

___
Python tracker 

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



[issue7453] HPUX: socketmodule.c -- error 1588: "AI_PASSIVE" undefined.

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Are you sure it isn't defined somewhere? HP claims it exists:
http://www.docs.hp.com/en/B3921-90010/getaddrinfo.3N.html

On the other hand, it seems commenting out this line doesn't harm any
existing test, so we could enable it conditionally.

--
nosy: +loewis, pitrou
priority:  -> normal
stage:  -> needs patch
versions: +Python 2.6, Python 3.1, Python 3.2

___
Python tracker 

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



[issue1495089] sys.getfilesystemencoding

2009-12-07 Thread naktinis

naktinis  added the comment:

I guess this is still not answered.
Documentation (http://docs.python.org/library/sys.html) clearly states:
"On Unix, the encoding is the user’s preference according to the result
of nl_langinfo(CODESET), or None if the nl_langinfo(CODESET) failed."

So in case setlocale is not yet called the actual output should look
like this (according to documentation):
>>> import sys
>>> print sys.getfilesystemencoding()
None

According to the documentation if nl_langinfo(CODESET) returns
something, then sys.getfilesystemencoding() should return the very same
thing. Apparently this is not the case in the provided code. I also get
different output on my machine.

Or am I missing something?

--
nosy: +naktinis

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-12-07 Thread flox

Changes by flox :


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



[issue7454] Solaris SPARC: _multiprocessing.so: symbol sem_timedwait: referenced symbol not found

2009-12-07 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar :

[...]
cc -xcode=pic32 -DNDEBUG -O -DHAVE_SEM_TIMEDWAIT=0 -
IModules/_multiprocessing -I. -I./Include -IInclude -
I/export/home/apy/rrun/build/activepython-DEV/build/py2_7a1-solaris8-
sparc-apy27-rrun/python -c /export/home/apy/rrun/build/activepython-
DEV/build/py2_7a1-solaris8-sparc-apy27-
rrun/python/Modules/_multiprocessing/semaphore.c -o build/temp.solaris-
2.8-sun4u-2.7/export/home/apy/rrun/build/activepython-DEV/build/py2_7a1-
solaris8-sparc-apy27-rrun/python/Modules/_multiprocessing/semaphore.o
"/export/home/apy/rrun/build/activepython-DEV/build/py2_7a1-solaris8-
sparc-apy27-rrun/python/Modules/_multiprocessing/semaphore.c", line 318: 
warning: implicit function declaration: sem_timedwait
cc -G build/temp.solaris-2.8-sun4u-
2.7/export/home/apy/rrun/build/activepython-DEV/build/py2_7a1-solaris8-
sparc-apy27-rrun/python/Modules/_multiprocessing/multiprocessing.o 
build/temp.solaris-2.8-sun4u-
2.7/export/home/apy/rrun/build/activepython-DEV/build/py2_7a1-solaris8-
sparc-apy27-rrun/python/Modules/_multiprocessing/socket_connection.o 
build/temp.solaris-2.8-sun4u-
2.7/export/home/apy/rrun/build/activepython-DEV/build/py2_7a1-solaris8-
sparc-apy27-rrun/python/Modules/_multiprocessing/semaphore.o -o 
build/lib.solaris-2.8-sun4u-2.7/_multiprocessing.so
*** WARNING: renaming "_multiprocessing" since importing it failed: 
ld.so.1: python: fatal: relocation error: file build/lib.solaris-2.8-
sun4u-2.7/_multiprocessing.so: symbol sem_timedwait: referenced symbol 
not found

$ uname -a
SunOS nail 5.8 Generic_117350-55 sun4u sparc SUNW,Sun-Fire-280R

--
components: Build, Library (Lib)
files: config.log
messages: 96094
nosy: srid
severity: normal
status: open
title: Solaris SPARC: _multiprocessing.so: symbol sem_timedwait: referenced 
symbol not found
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file15483/config.log

___
Python tracker 

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



[issue7451] improve json decoding performance

2009-12-07 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

The problem with this is that it makes json in Python diverge even more
from the simplejson trunk.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue7453] HPUX: socketmodule.c -- error 1588: "AI_PASSIVE" undefined.

2009-12-07 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar :

At line 790, the constant AI_PASSIVE is used without doing a ifdef check 
(like done at around 5235). 

building '_socket' extension
cc +DAportable -Ae -D_REENTRANT +Z +z -DNDEBUG -O -I. -I./Include -
IInclude -I/home/apy/rrun/build/activepython-DEV/build/py2_7a1-
hpux11_00-parisc-apy27-rrun/python -c /home/apy/rrun/build/activepython-
DEV/build/py2_7a1-hpux11_00-parisc-apy27-
rrun/python/Modules/socketmodule.c -o build/temp.hp-ux-B.11.00-9000-800-
2.7/home/apy/rrun/build/activepython-DEV/build/py2_7a1-hpux11_00-parisc-
apy27-rrun/python/Modules/socketmodule.o
cc: "/home/apy/rrun/build/activepython-DEV/build/py2_7a1-hpux11_00-
parisc-apy27-rrun/python/Modules/socketmodule.c", line 790: error 1588: 
"AI_PASSIVE" undefined.

--
components: Build, Library (Lib)
messages: 96092
nosy: srid
severity: normal
status: open
title: HPUX: socketmodule.c -- error 1588: "AI_PASSIVE" undefined.
type: compile error
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



[issue4380] Deepcopy of functools.partial gives wierd exception

2009-12-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue7432] Py3k doc: "from __future__ import division" not necessary

2009-12-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
priority:  -> normal

___
Python tracker 

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



[issue1537721] csv module: add header row to DictWriter

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le lundi 07 décembre 2009 à 23:42 +, Skip Montanaro a écrit :
> Skip Montanaro  added the comment:
> 
> Antoine> We can't change default behaviour because it will break
> Antoine> compatibility, so an additional method looks ok to me.
> 
> Why can't default behavior be changed?

Well, because it will break assumptions about the generated documents?

--

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-12-07 Thread flox

flox  added the comment:

And the test_urllib may leak on 2.7, too.

Patch attached.

--
Added file: http://bugs.python.org/file15482/issue5596_urllib.diff

___
Python tracker 

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



[issue1537721] csv module: add header row to DictWriter

2009-12-07 Thread Skip Montanaro

Skip Montanaro  added the comment:

Antoine> We can't change default behaviour because it will break
Antoine> compatibility, so an additional method looks ok to me.

Why can't default behavior be changed?

S

--

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Your example takes 0.5s to dump here.

--

___
Python tracker 

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



[issue7447] Sum() doc and behavior mismatch

2009-12-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

There are also a couple more things that could be improved in the
documentation of sum():
1) add a note about the "performance trap" mentioned by Alex [1]
2) remove the reduce() example because, even if it's true for that
particular example, it's not always true for the general case (in the
py3 doc it has been removed already).

See also [2] and the other messages in that thread.

[1]: http://mail.python.org/pipermail/python-dev/2003-October/039529.html
[2]: http://mail.python.org/pipermail/python-dev/2003-October/039586.html

--
nosy: +ezio.melotti
priority:  -> normal
stage:  -> needs patch

___
Python tracker 

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



[issue7452] Invalid mnemonic 'fnstcw'

2009-12-07 Thread Sridhar Ratnakumar

Sridhar Ratnakumar  added the comment:

This error only occurs when I specify --enable-framework and --enable-
universalsdk to ./configure.

--

___
Python tracker 

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



[issue7452] Invalid mnemonic 'fnstcw'

2009-12-07 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar :

When trying to build 2.7a1 I ran into the following problem on MacOSX 
10.4 (Tiger):

$ ./configure --enable-framework --enable-universalsdk
[...]
$ make
[...]
gcc -c -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -
fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -
I. -IInclude -I./Include   -DPy_BUILD_CORE -o Python/pymath.o 
Python/pymath.c
/var/tmp//ccGDYNCp.s:36:Invalid mnemonic 'fnstcw'
/var/tmp//ccGDYNCp.s:56:Invalid mnemonic 'fldcw'
lipo: can't open input file: /var/tmp//cc4UBrqs.out (No such file or 
directory)
make: *** [Python/pymath.o] Error 1

--
assignee: ronaldoussoren
components: Build, Macintosh
files: config.log
messages: 96085
nosy: ronaldoussoren, srid
severity: normal
status: open
title: Invalid mnemonic 'fnstcw'
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file15481/config.log

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-12-07 Thread flox

flox  added the comment:

Patch for the test refleaks:
 * test_pipes
 * test_urllib

--

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-12-07 Thread flox

Changes by flox :


Added file: http://bugs.python.org/file15480/issue5596_pipes_py3k.diff

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-12-07 Thread flox

Changes by flox :


Added file: http://bugs.python.org/file15479/issue5596_urllib_py3k.diff

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file15450/json-opts2.patch

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> However, this bug is about the serializer (encoder).  So perhaps the
> decode performance patch should be a separate bug?

You're right, I've filed a separate bug for it: issue7451.

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue7451] improve json decoding performance

2009-12-07 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This patch does two things:
- it speeds up decoding of JSON objects by doing fewer temporary allocations
- it reduces memory use of decoded JSON objects by reusing key strings
when they appear several times in a JSON string

--
components: Library (Lib)
files: json-opts2.patch
keywords: patch
messages: 96082
nosy: bob.ippolito, pitrou, rhettinger, vkuznet
priority: normal
severity: normal
stage: patch review
status: open
title: improve json decoding performance
type: performance
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file15478/json-opts2.patch

___
Python tracker 

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



[issue7450] document that os.chmod accepts an octal digit mode

2009-12-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

If using octal digits instead of the stat.S_I constants is acceptable,
I'd be +1 to add a note to the documentation (something like "mode could
be a number (possibly expressed in octal form, such as 0755), one of the
following values (as defined in the stat module), or a bitwise ORed
combinations of them:").

--
nosy: +ezio.melotti
priority:  -> normal
stage:  -> needs patch
type:  -> feature request
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue6058] Add cp65001 to encodings/aliases.py

2009-12-07 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Here's a script for IronPython 2.6 that checks a few encoders.

Since IronPython doesn't appear to come with the full set of Python
codecs and it's also not clear whether the implemented codecs actually
match the default Python ones, I'm not sure how reliable this output is.

It's probably better to dump the encoded data to a file and compare
against a CPython run.

Anyway, here's the output:

Code Page 65000 vs. encoding 'utf-7'

0 errors

Code Page 65001 vs. encoding 'utf-8'

0 errors

Code Page 1200 vs. encoding 'utf-16-le'

0 errors

Code Page 1201 vs. encoding 'utf-16-be'

0 errors

Code Page 28591 vs. encoding 'iso-8859-1'

0 errors

--
Added file: http://bugs.python.org/file15477/testnetcodecs.py

___
Python tracker 

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



[issue7342] str(datetime_obj) doesn't include microseconds if their value is 0

2009-12-07 Thread Ezio Melotti

Ezio Melotti  added the comment:

Simple patch that fixes the test using a datetime object with a specific
number of microseconds instead of using datetime.now().

The test only checks that _strptime._strptime returns the correct value
for the microseconds, in test_datetime there are already other tests
(e.g. TestTime.test_str) that check that the microseconds are present
only if the value is different from 0.

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

___
Python tracker 

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



[issue1537721] csv module: add header row to DictWriter

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

We can't change default behaviour because it will break compatibility,
so an additional method looks ok to me.

--
nosy: +pitrou
stage: test needed -> patch review
versions: +Python 3.2 -Python 3.1

___
Python tracker 

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



[issue6058] Add cp65001 to encodings/aliases.py

2009-12-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +michael.foord

___
Python tracker 

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



[issue6058] Add cp65001 to encodings/aliases.py

2009-12-07 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Martin v. Löwis wrote:
> 
> Martin v. Löwis  added the comment:
> 
>> http://msdn.microsoft.com/en-us/library/system.text.encoding(VS.80).aspx
>>
>> Looks like we could add a few more aliases for other encodings as well.
> 
> I wouldn't trust this table. Microsoft is on record of implementing the
> code pages with slight variations compared to other references for some
> encodings (in particular the Asian ones). So unless there is an actual
> documented need for a certain alias (and preferably a demonstration that
> Microsoft's interpretation of the code page is the same as Python's),
> I would advise against adding such aliases.

Fair enough.

Could someone with some IronPython/.NET foo check whether the
code pages are the same as the Python codecs ?

The above page has some sample code to get started and IronPython
provides easy access to both the .NET codecs and the Python ones.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com



::: Try our new mxODBC.Connect Python Database Interface for free ! 

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/

--

___
Python tracker 

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



[issue6058] Add cp65001 to encodings/aliases.py

2009-12-07 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> http://msdn.microsoft.com/en-us/library/system.text.encoding(VS.80).aspx
> 
> Looks like we could add a few more aliases for other encodings as well.

I wouldn't trust this table. Microsoft is on record of implementing the
code pages with slight variations compared to other references for some
encodings (in particular the Asian ones). So unless there is an actual
documented need for a certain alias (and preferably a demonstration that
Microsoft's interpretation of the code page is the same as Python's),
I would advise against adding such aliases.

--

___
Python tracker 

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



[issue7450] document that os.chmod accepts an octal digit mode

2009-12-07 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I think you misunderstand what's happening. It's not that os.chmod
accepts octal digits, but Python:

py> 04732
2522

So the support for octal numbers isn't something that chmod deserves
credit for.

--
nosy: +loewis

___
Python tracker 

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



[issue5672] Implement a way to change the python process name

2009-12-07 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue1537721] csv module: add header row to DictWriter

2009-12-07 Thread djc

djc  added the comment:

Skip, I agree that it's hard to decide if we should have the class write
the header on __init__(). I figured starting off with a method to make
doing it "manually" is a good start; people can start using that, and if
it's deemed useful we can always add the auto-write later.

--

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Shawn

Shawn  added the comment:

I've attached a sample JSON file that is much slower to write out on
some systems as described in the initial comment.

If you were to restructure the contents of this file into more of a tree
structure instead of the flat array structure it uses now, you will
notice that as the depth increases, serializer performance decreases
significantly.

--
Added file: http://bugs.python.org/file15475/catalog.dependency.C.gz

___
Python tracker 

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



[issue6247] should we include argparse

2009-12-07 Thread Steven Bethard

Steven Bethard  added the comment:

@techtonik: If you have a specific feature request for argparse, I
recommend that you file an issue on the argparse tracker[1]. I assure
you that despite the fact that you only have need for a couple of the
constructor parameters, the rest exist because people have asked for
them. Fortunately, since they're keyword parameters, you only have to
specify the ones that you care about.

[1]http://code.google.com/p/argparse/issues/list

--

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Shawn

Shawn  added the comment:

You are right, an environment anomaly let me to falsely believe that
this had somehow affected encoding performance.

I had repeated the test many times with and without the patch using
simplejson trunk and wrongly concluded that the patch was to blame.

After correcting the environment, write performance returned to normal.

This patch seems to perform roughly the same for my decode cases, but
uses about 10-20MB less memory.  My needs are far less than that of the
other poster.

However, this bug is about the serializer (encoder).  So perhaps the
decode performance patch should be a separate bug?

--

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The attached patch doubles write times for my particular case when
> applied to simplejson trunk using python 2.6.2.  Not good.

What do you mean by "write times"? The patch only affects decoding.

--

___
Python tracker 

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



[issue1537721] csv module: add header row to DictWriter

2009-12-07 Thread Skip Montanaro

Skip Montanaro  added the comment:

I'm sorry, but I don't have time to look at this right now.  On the one
hand, one person asks for more symmetry.  Someone else wants to add a
writeheader method.  If you want symmetry shouldn't the DictWriter
simply write the header without being asked?  I'm confused by the
various options and feel that someone is going to be disappointed by any
solution.  For the time being at least I would prefer that the status
quo remain in place.

S

--

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Shawn

Shawn  added the comment:

The attached patch doubles write times for my particular case when
applied to simplejson trunk using python 2.6.2.  Not good.

--

___
Python tracker 

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



[issue6247] should we include argparse

2009-12-07 Thread anatoly techtonik

anatoly techtonik  added the comment:

Argparse seems to be overloaded with rarely used features. Instead of providing 
API to add these features and allow users copy examples it tends to be an 
all-in-
one solution that is hard to use due to abundance of specific parameters.

Look at constructor, for example - 
http://argparse.googlecode.com/svn/tags/r101/doc/ArgumentParser.html#usage
{{{
description - Text to display before the argument help.
epilog - Text to display after the argument help.
version - A version number used to add a -v/–version option to the parser.
add_help - Add a -h/–help option to the parser. (default: True)
argument_default - Set the global default value for arguments. (default: None)
parents - A list of :class:ArgumentParser objects whose arguments should also 
be 
included.
prefix_chars - The set of characters that prefix optional arguments. (default: 
‘-
‘)
fromfile_prefix_chars - The set of characters that prefix files from which 
additional arguments should be read. (default: None)
formatter_class - A class for customizing the help output.
conflict_handler - Usually unnecessary, defines strategy for resolving 
conflicting 
optionals.
prog - Usually unnecessary, the name of the program (default: sys.argv[0])
usage - Usually unnecessary, the string describing the program usage (default: 
generated)
}}}

the only useful arguments by default is 'description' and 'add_help' (which is 
better to see as 'no_help' to turn off default behaviour). 'version' is not 
useful, because it adds '-v' shorthand that is often used for verbosity. 
'prefix_chars' is not useful, because the only sense one may need it is to 
provide 
windows conventions like '/longarg' for '--longarg' and not '//longarg', but it 
doesn't allow to do so.

Everything else is constructor bloat, and even with such abundance of options 
it 
still unable to generate usage help prefixed by program name and version - the 
sole feature I miss from optparse.

-1 for now

--
nosy: +techtonik

___
Python tracker 

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



[issue7437] OS X 2.6.4 installer fails on 10.3 with two corrupted file names, ignored on 10.4

2009-12-07 Thread GD

Changes by GD :


--
nosy: +GD

___
Python tracker 

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



[issue6058] Add cp65001 to encodings/aliases.py

2009-12-07 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Nevermind, I found this reference:

http://msdn.microsoft.com/en-us/library/system.text.encoding(VS.80).aspx

Looks like we could add a few more aliases for other encodings as well.

--

___
Python tracker 

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



[issue6058] Add cp65001 to encodings/aliases.py

2009-12-07 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Could you provide some official reference defining the alias ?

Thanks.

--

___
Python tracker 

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



[issue1859] textwrap doesn't linebreak on "\n"

2009-12-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks for the feedback, Greg!

I'm afraid I'm unassigning this;  I don't have time for it right now, and 
I'm not sure I'm the right person to do this anyway.

One problem that I was having when I looked at this:  I don't think I 
understand what the intended use of replace_whitespace=False is in the 
first place.  Given that a typical piece of (English) text only contains 
the ' ', '\t' ad '\n' whitespace characters, if expand_tabs is True (the 
default), then it seems that newline characters are the only ones affected 
by replace_whitespace=False.

How is replace_whitespace=False expected to be used currently?

--
assignee: mark.dickinson -> 

___
Python tracker 

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



[issue1537721] csv module: add header row to DictWriter

2009-12-07 Thread djc

djc  added the comment:

I'd like to commit this, but it would be nice to get a review first:

Index: Lib/csv.py
===
--- Lib/csv.py  (revision 76697)
+++ Lib/csv.py  (working copy)
@@ -132,6 +132,10 @@
 self.extrasaction = extrasaction
 self.writer = writer(f, dialect, *args, **kwds)
 
+def writeheader(self):
+header = dict(zip(self.fieldnames, self.fieldnames))
+self.writerow(header)
+
 def _dict_to_list(self, rowdict):
 if self.extrasaction == "raise":
 wrong_fields = [k for k in rowdict if k not in self.fieldnames]
Index: Lib/test/test_csv.py
===
--- Lib/test/test_csv.py(revision 76697)
+++ Lib/test/test_csv.py(working copy)
@@ -598,8 +598,10 @@
 fileobj = os.fdopen(fd, "w+b")
 try:
 writer = csv.DictWriter(fileobj, fieldnames = ["f1", "f2",
"f3"])
+writer.writeheader()
 writer.writerow({"f1": 10, "f3": "abc"})
 fileobj.seek(0)
+self.assertEqual(fileobj.readline(), "f1,f2,f3\r\n")
 self.assertEqual(fileobj.read(), "10,,abc\r\n")
 finally:
 fileobj.close()

(I think I have commit privileges already.)

--

___
Python tracker 

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



[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2009-12-07 Thread Guido van Rossum

Guido van Rossum  added the comment:

Python's sort implementation is carefully written to only use the "<" 
comparison, ever.  So a cmp really isn't the most natural way to specify 
a comparison.  (This should really be documented somewhere -- I know know 
it because Tim Peters & I shared an office while he did most of the work 
on Python's sort.)

--

___
Python tracker 

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



[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2009-12-07 Thread Guido van Rossum

Changes by Guido van Rossum :


Removed file: http://bugs.python.org/file15473/unnamed

___
Python tracker 

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



[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2009-12-07 Thread Guido van Rossum

Changes by Guido van Rossum :


Removed file: http://bugs.python.org/file15463/unnamed

___
Python tracker 

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



[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-12-07 Thread Scott Dial

Changes by Scott Dial :


Removed file: http://bugs.python.org/file15457/imaplib-eof-test.py

___
Python tracker 

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



[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-12-07 Thread Scott Dial

Changes by Scott Dial :


Removed file: http://bugs.python.org/file15472/test_imaplib_issue5949-2.patch

___
Python tracker 

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



[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-12-07 Thread Scott Dial

Changes by Scott Dial :


Removed file: http://bugs.python.org/file15466/test_imaplib-r76683-2.patch

___
Python tracker 

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



[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-12-07 Thread Scott Dial

Changes by Scott Dial :


Removed file: http://bugs.python.org/file15460/test_imaplib-r76683.patch

___
Python tracker 

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



[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-12-07 Thread R. David Murray

Changes by R. David Murray :


Removed file: http://bugs.python.org/file15467/test_imaplib_issue5949.patch

___
Python tracker 

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



[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-12-07 Thread Scott Dial

Scott Dial  added the comment:

I actually thought I was complying with PEP8.. yikes. I guess my
personal rules are slightly different. I think the latest attached patch
is PEP8 compliant now. And, I moved the import_module() to the top as
you suggested.

--
Added file: http://bugs.python.org/file15474/test_imaplib_issue5949-3.patch

___
Python tracker 

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



[issue7450] document that os.chmod accepts an octal digit mode

2009-12-07 Thread clutchski

New submission from clutchski :

It would be helpful to explicitly document that os.chmod accepts octal
digit modes e.g. os.chmod(path, 0755). This is much more user friendly
than saying you must OR bit constants kept in a completely different module.

It could be argued that this change would be make the abstraction leaky,
since the values of the stat.S_I* constants could change, but in
practice, this seems unlikely.

--
assignee: georg.brandl
components: Documentation
messages: 96060
nosy: clutchski, georg.brandl
severity: normal
status: open
title: document that os.chmod accepts an octal digit mode

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Valentin Kuznetsov

Valentin Kuznetsov  added the comment:

I made data local, but adding del shows the same behavior.
This is the test

def test():
source = open('mangled.json', 'r')
data = json.load(source)
source.close()
del data
test()
time.sleep(20)

--

___
Python tracker 

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



[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2009-12-07 Thread Tom Switzer

Tom Switzer  added the comment:

If the equal min y-coords are handled, I think it'd be quicker too. As Guido
noted, O(n) function calls is better then O(n log n) =] Though the general
case is still unhandled. And, though it doesn't help my case, the Graham
Scan can also be performed on points sorted lexicographically too, by
constructing the upper & lower hull separately, hehe.

Now, I understand cmp on the whole was removed from the language. Using
__lt__, __eq__, etc. really is more natural. However, having an explicit cmp
function for sorting makes sense to me. At the very least, it is more
obvious and natural for some problems - though I respect that using a key
func. is often faster. In some rare (though "rare" is very subjective) cases
it is required; packing a cmp function into __cmp__ in a wrapper object is
really just a hard-to-read cmp function and highlights the need for cmp. I
would actually love to see it added for min/max too actually, since I find I
often use a simple reduce function in place of a min(lst, cmp=...).
Enforcing proper comparisons (<, >, ==, etc) makes sense, but would having
the cmp function live, so to speak, in sorting really be that bad? Just
inform the user in the docs that key is preferred and often faster.

--
Added file: http://bugs.python.org/file15473/unnamed

___
Python tracker 

___If the equal min y-coords are handled, I think it'd be quicker too. As 
Guido noted, O(n) function calls is better then O(n log n) =] Though the 
general case is still unhandled. And, though it doesn't help my case, the 
Graham Scan can also be performed on points sorted lexicographically too, by 
constructing the upper & lower hull separately, hehe.
Now, I understand cmp on the whole was removed from the language. Using 
__lt__, __eq__, etc. really is more natural. However, having an explicit cmp 
function for sorting makes sense to me. At the very least, it is more obvious 
and natural for some problems - though I respect that using a key func. is 
often faster. In some rare (though "rare" is very subjective) cases 
it is required; packing a cmp function into __cmp__ in a wrapper object is 
really just a hard-to-read cmp function and highlights the need for cmp. I 
would actually love to see it added for min/max too actually, since I find I 
often use a simple reduce function in place of a min(lst, cmp=...). Enforcing 
proper comparisons (<, >, ==, etc) makes sense, but would having the cmp 
function live, so to speak, in sorting really be that bad? Just inform the user 
in the docs that key is preferred and often faster.

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Nope, all three json's implementation do not release the memory. I used 
> your patched one, the one shipped with 2.6 and cjson. The one which comes 
> with 2.6, reach 2GB, then release 200MB and stays with 1.8GB during 
> sleep. The cjson reaches 1.5GB mark and stays there. But all three 
> release another 100-200MB just before the exit (one top cycle before 
> process disappear). I used sleep of 20 seconds, so I'm pretty sure memory 
> was not released during that time, since I watched the process with idle 
> CPU.

Do you destroy the decoded data, though? If you keep it in memory
there's no chance that a lot of memory will be released.

--

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Valentin Kuznetsov

Valentin Kuznetsov  added the comment:

Nope, all three json's implementation do not release the memory. I used 
your patched one, the one shipped with 2.6 and cjson. The one which comes 
with 2.6, reach 2GB, then release 200MB and stays with 1.8GB during 
sleep. The cjson reaches 1.5GB mark and stays there. But all three 
release another 100-200MB just before the exit (one top cycle before 
process disappear). I used sleep of 20 seconds, so I'm pretty sure memory 
was not released during that time, since I watched the process with idle 
CPU.

--

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Antoine,
> indeed, both patches improved time and memory foot print. The latest 
> patch shows only 1.1GB RAM usage and is very fast. What's worry me 
> though, that memory is not released back to the system. Is this is the 
> case? I just added time.sleep after json.load and saw that once decoding 
> is done, the resident size still remain the same.

Interesting. Does it release memory without the patch?

--

___
Python tracker 

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



[issue5672] Implement a way to change the python process name

2009-12-07 Thread Marcelo Fernández

Marcelo Fernández  added the comment:

2009/12/7 Daniele Varrazzo :
>
> Daniele Varrazzo  added the comment:
>
>>> I've just tested it and it works fine here... Any possibility this
>>> module can be included in the regular python standard library, in the
>>> future?
>
>>Only in the far future. I don't think the Python standard library
>> should include a module whose version number is 0.2.
>
> I agree: I started the project 4-5 days ago and, albeit very limited in
> its scope, for portability reasons is way more complex than a simple
> syscall and needs to be tested on many other platforms.
>

Of course, when I said "future" I meant "when this project is stable
and tested enough"... :-)

Thanks

--

___
Python tracker 

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



[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-07 Thread Valentin Kuznetsov

Valentin Kuznetsov  added the comment:

Antoine,
indeed, both patches improved time and memory foot print. The latest 
patch shows only 1.1GB RAM usage and is very fast. What's worry me 
though, that memory is not released back to the system. Is this is the 
case? I just added time.sleep after json.load and saw that once decoding 
is done, the resident size still remain the same.

--

___
Python tracker 

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



[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-12-07 Thread R. David Murray

R. David Murray  added the comment:

IMO the context manager approach is much better than what I had.  I'm
still not used to using those :)

One request: I imported test_support as support because that's what it
is named in py3k, and doing it that way will make porting the patch to
py3k simpler.  It would also be nice to pep8ify the spacing by putting
two blank lines between classes (yeah, I know, a lot of the test source
is not PEP 8 compliant...but we try to keep any new code compliant, and
fix old code as we touch it).

Oh, and the reason I moved SocketServer below the import_module for
threading is that SocketServer will die on import if threading is not
available, so it seemed better to me to make the explicit check for
threading first.  Probably instead that import_module should be moved to
the top of the import list, since if it fails the module is skipped.

--

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-12-07 Thread flox

flox  added the comment:

test_textwrap seems OK with r76697

I still have leaks on test_pipes and test_urllib:

~ $ ./python Lib/test/regrtest.py -R : test_textwrap \
 test_pipes test_urllib
test_pipes leaked [0, -26, 0, 26] references, sum=0
test_pipes leaked [0, -26, 26, -26] references, sum=-26
test_pipes leaked [-26, 26, 0, 0] references, sum=0
test_pipes leaked [26, -26, 26, 0] references, sum=26
test_urllib leaked [0, 2, 0, 0] references, sum=2
test_urllib leaked [4, 6, 0, 2] references, sum=12
test_urllib leaked [2, 4, 2, 0] references, sum=8
test_urllib leaked [6, 6, 2, 0] references, sum=14

--
nosy: +flox

___
Python tracker 

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



[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-12-07 Thread Scott Dial

Scott Dial  added the comment:

The design of your patch makes a lot of sense. I found that your patch
uncovered a problem with using the ThreadingMixin (which is ultimately
not necessary as long as the whole SocketServer is in its own thread). I
rewrote the SimpleIMAPHandler to timeout in a timely manner and for the
reap_server() to actually ensure that all threads have been shutdown.

I ended up rewriting my patch in steps towards yours before I uncovered
why I was getting threads alive at shutdown. In that vein, the patch I
am attaching uses the "with reaped_server(hdlr) as server:" technique,
but it could be converted to use an attribute instead. I find using
"with" easier to read and less error prone (failing shutdown the server
and thread because human error or an uncaught exception).

--
Added file: http://bugs.python.org/file15472/test_imaplib_issue5949-2.patch

___
Python tracker 

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



[issue6472] Inconsistent use of "iterator" in ElementTree doc & diff between Py and C modules

2009-12-07 Thread flox

Changes by flox :


Removed file: http://bugs.python.org/file15469/issue6472_upstream_py3k.diff

___
Python tracker 

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



[issue6472] Inconsistent use of "iterator" in ElementTree doc & diff between Py and C modules

2009-12-07 Thread flox

flox  added the comment:

I see some new features in the changelog.
I will try to update the documentation during the week.

(patch "py3k" fixed: support assignment of arbitrary sequences)

--
Added file: http://bugs.python.org/file15471/issue6472_upstream_py3k.diff

___
Python tracker 

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



[issue1143] Update to latest ElementTree in Python 2.7

2009-12-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Inconsistent use of "iterator" in ElementTree doc & diff 
between Py and C modules

___
Python tracker 

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



[issue6472] Inconsistent use of "iterator" in ElementTree doc & diff between Py and C modules

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The patch should have doc updates for new functionality, if any.

--
nosy: +pitrou
priority:  -> normal
stage:  -> patch review

___
Python tracker 

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



[issue2054] add ftp-tls support to ftplib - RFC 4217

2009-12-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

It's already in 2.7.

--

___
Python tracker 

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



[issue2054] add ftp-tls support to ftplib - RFC 4217

2009-12-07 Thread Domen

Domen  added the comment:

Nice! Any chance of merging with 2.7? Python3.2 is waaay too far in
future for such useful change to be actually useful.

--

___
Python tracker 

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



[issue5672] Implement a way to change the python process name

2009-12-07 Thread Daniele Varrazzo

Daniele Varrazzo  added the comment:

>> I've just tested it and it works fine here... Any possibility this
>> module can be included in the regular python standard library, in the
>> future?

>Only in the far future. I don't think the Python standard library 
> should include a module whose version number is 0.2.

I agree: I started the project 4-5 days ago and, albeit very limited in
its scope, for portability reasons is way more complex than a simple
syscall and needs to be tested on many other platforms.

--

___
Python tracker 

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



[issue1143] Update to latest ElementTree in Python 2.7

2009-12-07 Thread flox

Changes by flox :


Removed file: http://bugs.python.org/file15470/issue1143_ET13_cET106.diff

___
Python tracker 

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



[issue1143] Update to latest ElementTree in Python 2.7

2009-12-07 Thread flox

flox  added the comment:

Patch proposed with latest versions:
 * ElementTree 1.3a3-20070912
 * cElementTree 1.0.6-20090110

Attached to issue6472.

--
keywords: +patch
nosy: +flox
Added file: http://bugs.python.org/file15470/issue1143_ET13_cET106.diff

___
Python tracker 

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



[issue6472] Inconsistent use of "iterator" in ElementTree doc & diff between Py and C modules

2009-12-07 Thread flox

Changes by flox :


Removed file: http://bugs.python.org/file15461/issue6472.diff

___
Python tracker 

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



[issue6472] Inconsistent use of "iterator" in ElementTree doc & diff between Py and C modules

2009-12-07 Thread flox

Changes by flox :


Removed file: http://bugs.python.org/file15462/issue6472_py3k.diff

___
Python tracker 

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



[issue6472] Inconsistent use of "iterator" in ElementTree doc & diff between Py and C modules

2009-12-07 Thread flox

Changes by flox :


--
versions:  -Python 3.0
Added file: http://bugs.python.org/file15469/issue6472_upstream_py3k.diff

___
Python tracker 

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