[issue5390] Item 'Python x.x.x' in Add/Remove Programs list still lacks an icon

2009-03-01 Thread Retro

Retro  added the comment:

Strange thing. I presume you are running Windows XP. There the Python
icons are shown in the Add/Remove Programs list for the Python interpreters.

I must inform you, though, that the Python icons are not shown in the
Add/Remove Programs list under Widnows Vista. I don't know why but it is
an issue we ought to look at and solve. If anyone has knowledge how to
fix this, please provide information on how to fix this bug. Thank you
in advance.

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Raymond Hettinger

New submission from Raymond Hettinger :

Here is a working patch implementing PEP372 ordered dictionaries.

--
components: Library (Lib)
files: od.diff
keywords: patch
messages: 82955
nosy: rhettinger
severity: normal
stage: patch review
status: open
title: PEP 372:  OrderedDict
versions: Python 3.1
Added file: http://bugs.python.org/file13217/od.diff

___
Python tracker 

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



[issue4459] bdist_rpm assumes python

2009-03-01 Thread John5342

John5342  added the comment:

Thanks.

i had noticed those options since i filed this report but considering
the spec file is generated and then built immediately wouldn't it make
more sense to effectively enable --fix-python by default (perhaps with a
--no-fix-python option if people do in fact want to do something odd).
The rpm would then automatically be built using the same version of
python used for development which is in my experience almost always what
is intended.

I do at least have a workable workaround.

Thanks again.

___
Python tracker 

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



[issue5398] strftime("%B") returns a String unusable with unicode

2009-03-01 Thread t.steinruecken

New submission from t.steinruecken :

import locale
import datetime

locale.setlocale(locale.LC_ALL, ('de_DE', 'UTF8'))
print u""+datetime.datetime( 2009, 3, 1 ).strftime("%B")
--
Traceback (most recent call last):
print u""+datetime.datetime( 2009, 3, 1 ).strftime("%B")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1:
ordinal not in range(128)

--
messages: 82958
nosy: t.steinruecken
severity: normal
status: open
title: strftime("%B") returns a String unusable with unicode
type: behavior
versions: Python 2.5

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Georg Brandl

Georg Brandl  added the comment:

Doc nits:

* "items are returned in the order they were first added": it should be
made clear that it matters when the *key* was first added
* "An *OrderedDict* remembers order that entries were inserted": misses
a word somewhere?
* "OrderDict" should be "OrderedDict"
* "compare their ordered :attr:`items` list": ... lists?

Implementation nits:

* "raise TypeError('expected at 1 argument, got %d', len(args))"
  should read "at most" and use "%" instead of ","
* "raise KeyError" in popitem(): should it get a message?
* eval()ing the repr() will not construct the dict in the same order

--
nosy: +aronacher, georg.brandl

___
Python tracker 

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



[issue5398] strftime("%B") returns a String unusable with unicode

2009-03-01 Thread Ezio Melotti

Ezio Melotti  added the comment:

I don't have the de_DE locale to reproduce that, but the cause is most
likely this:
1) datetime( 2009, 3, 1 ).strftime("%B") should return märz as a UTF-8
encoded string, i.e. 'm\xc3\xa4rz'
2) when you mix Unicode and encoded strings, the encoded strings are
automagically decoded to Unicode using the default codec, i.e. ASCII (on
Py2)
3) The ASCII codec is not able to decode '\xc3' (its value is 195, and
195 > 127) and a UnicodeDecodeError is raised.

The solution is to decode the string explicitly using UTF-8:
>>> month = 'm\xc3\xa4rz'
>>> u'' + month
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1:
ordinal not in range(128)
>>> u'' + month.decode('utf-8')
u'm\xe4rz'
>>>

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue4474] PyUnicode_FromWideChar incorrect for characters outside the BMP (unix only)

2009-03-01 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: 
http://bugs.python.org/file13167/unicode_fromwidechar_surrogate-6.patch

___
Python tracker 

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



[issue5398] strftime("%B") returns a String unusable with unicode

2009-03-01 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Ezio is correct: in general a string cannot be added to a unicode.
Except for the simplest case (only 7bit ascii characters), you have to 
decode the string:

u"" + datetime.datetime( 2009, 3, 1 ).strftime("%B").decode('utf-8')

--
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

In SubclassMappingTests, MyOrderedDict should subclass OrderedDict
rather than dict, shouldn't it?

--
nosy: +pitrou

___
Python tracker 

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



[issue1533164] Installed but not listed *.pyo break bdist_rpm

2009-03-01 Thread Mads Kiilerich

Mads Kiilerich  added the comment:

> IIUC, setting
>
> %define __os_install_post %{___build_post}
>
> should prevent invocation of brp-python-bytecompile.

Ok. But preventing invocation of brp-python-bytecompile is IMHO not a
solution. brp-python-bytecompile is needed for the reasons mentioned in
http://fedoraproject.org/wiki/Packaging/Python#Including_pyos .

___
Python tracker 

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



[issue5370] unpickling vs. __getattr__

2009-03-01 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

Perhaps this should be made more clear in the 
documentation for the pickle module. Probably here:

http://docs.python.org/library/pickle.html#the-pickle-
protocol

Could you come with some enhancements?

(Note that it already states that __init__ is not 
called when unpickling)

___
Python tracker 

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



[issue5399] wer

2009-03-01 Thread Daniel Diniz

New submission from Daniel Diniz :

234

--
messages: 82965
nosy: ajaksu2
severity: normal
status: open
title: wer

___
Python tracker 

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



[issue5399] wer

2009-03-01 Thread Daniel Diniz

Daniel Diniz  added the comment:

Gah, script running amok, sorry!

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue5392] stack overflow after hitting recursion limit twice

2009-03-01 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

It is an artificial value, I don't require a recursion 
limit so low in any application. I found it when 
looking into #5370.
If there is a lower limit to sys.setrecursionlimit, 
maybe it should be enforced. But since it fails only 
the second time, it looks like a bug somewhere.

___
Python tracker 

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



[issue5392] stack overflow after hitting recursion limit twice

2009-03-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The fact it fails only the second time is by design, although I'm not
sure the design is useful, and it's probably not documented anywhere.
The error message says it : "Cannot *recover* from stack overflow",
which means there was a first stack overflow, and Python thinks it has
failed recovering from it since a second stack overflow occurred
afterwards.

We could probably make the recovery detection smarter.

___
Python tracker 

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



[issue5392] stack overflow after hitting recursion limit twice

2009-03-01 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> pitrou
priority:  -> normal

___
Python tracker 

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



[issue5392] stack overflow after hitting recursion limit twice

2009-03-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch. I've put the tests in test_sys.py, I haven't found a
better place for them.

--
keywords: +patch
Added file: http://bugs.python.org/file13218/issue5392.patch

___
Python tracker 

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



[issue5067] Error msg from using wrong quotes in JSON is unhelpful

2009-03-01 Thread Bob Ippolito

Bob Ippolito  added the comment:

I don't really want to see looser input requirements, making a JSON 
parser that is compatible with a subset of Python repr output isn't a 
design goal of mine.

This is absolutely false:
"Because single quotes are the only way (AFAIK) in which
Python's repr() produces invalid JSON (from JSONable combinations of 
types)."

>>> repr(object)
""

If you don't know JSON, I'm not sure throwing random input at the JSON 
parser is going to help you. Is that how you learned XML? There's plenty 
of info in the JSON documentation and a link to json.org if you need 
help.

___
Python tracker 

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



[issue5067] Error msg from using wrong quotes in JSON is unhelpful

2009-03-01 Thread Bob Ippolito

Bob Ippolito  added the comment:

Er, sorry, missed "(from JSONable combinations of types)". It's early.

Anyway, I can change the error message, but I will not make it special-
case single quotes for its own error message. I will have to think about 
what the message could say instead. Note that the same sort of person who 
throws random input at parsers might even expect {test: 'test'} to work 
since that is valid JavaScript but not valid JSON.

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Armin Ronacher

Armin Ronacher  added the comment:

@Georg

> * eval()ing the repr() will not construct the dict in the same order
The alternative would be a list of dicts inside the constructor call,
but that feels ugly.  defaultdict from the same module is not evaluable
at all, so I guess it wouldn't be that much of a problem.

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks for the review comments guys.  An updated patch is attached.

Added file: http://bugs.python.org/file13219/od2.diff

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Georg Brandl

Georg Brandl  added the comment:

I still see an "OrderDict" in the docs, and the TypeError in __init__
still needs to use "%" instead of ",".

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Fixed.

Added file: http://bugs.python.org/file13220/od3.diff

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Removed file: http://bugs.python.org/file13219/od2.diff

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Removed file: http://bugs.python.org/file13217/od.diff

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Added a few more tests.

Added file: http://bugs.python.org/file13221/od4.diff

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Removed file: http://bugs.python.org/file13220/od3.diff

___
Python tracker 

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



[issue1533164] Installed but not listed *.pyo break bdist_rpm

2009-03-01 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> Ok. But preventing invocation of brp-python-bytecompile is IMHO not a
> solution. brp-python-bytecompile is needed for the reasons mentioned in
> http://fedoraproject.org/wiki/Packaging/Python#Including_pyos .

What reason specifically are you referring to? That it creates and
packages .pyo files? bdist_rpm already does that (now), so that reason
won't apply to bdist_rpm.

___
Python tracker 

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



[issue5392] stack overflow after hitting recursion limit twice

2009-03-01 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> The fact it fails only the second time is by design, although I'm not
> sure the design is useful, and it's probably not documented anywhere.

It helped me debug a number of interpreter crashes in 3.0. When a stack
overflow occurred, in certain cases, the interpreter would catch the
exception, and consider it as failure in the callback it tried to invoke
(e.g. when invoking __eq__ during dictionary lookups). Rather than
letting the stack unwind, it would continue to let the stack overflow,
and eventually managed to crash the entire process. The recovery check
is there to detect that, after a stack overflow, it really unwound a
sufficient number of stack frames, rather than overflowing again and
again.

___
Python tracker 

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



[issue5238] ssl makefile never closes socket

2009-03-01 Thread Bill Janssen

Bill Janssen  added the comment:

I'd recommend running the whole suite of tests here.  The issue is
mainly with httplib, as I recall it, which "closes" the socket before it
finishes reading from it.

___
Python tracker 

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



[issue2437] Distutils runtime_library_dirs broken on Windows

2009-03-01 Thread Bill Janssen

Bill Janssen  added the comment:

No, Tarek, I don't have a MinGW machine right now.  But it should be
easy to reproduce; just invoke that call I originally reported.  The
distutils code is just making assumptions that it shouldn't be making.

___
Python tracker 

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



[issue2437] Distutils runtime_library_dirs broken on Windows

2009-03-01 Thread Bill Janssen

Bill Janssen  added the comment:

Tarek writes:

> Laurent, right. but we need to figure out how to get the CC name in
> MinGW/Cygwin environment.

> I am not familiar with them.

Since this bug is specifically about that environment, shouldn't it be
handled by someone who is familiar with them?  Not objecting, here, but
it seems unlikely to result in a rapid fix.  And MinGW and Cygwin are
pretty different, IMHO; don't mix them together here.

___
Python tracker 

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



[issue1533164] Installed but not listed *.pyo break bdist_rpm

2009-03-01 Thread Mads Kiilerich

Mads Kiilerich  added the comment:

Ok, if you will keep bdist_rpm's new .pyo creation then you are right.
FWIW I think it is a bit of an ugly hack and would prefer another solution.

BTW: The "brp-python-bytecompile creates usr/bin/*.pyo" issue has been
resolved, https://bugzilla.redhat.com/show_bug.cgi?id=182498#c8

___
Python tracker 

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



[issue4471] IMAP4 missing support for starttls

2009-03-01 Thread Bill Janssen

Bill Janssen  added the comment:

Why can't we use python.org for tests?  Do we need IMAP/POP servers
running?  Let's send some mail to pydotorg to get that set up.

___
Python tracker 

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



[issue1533164] Installed but not listed *.pyo break bdist_rpm

2009-03-01 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> BTW: The "brp-python-bytecompile creates usr/bin/*.pyo" issue has been
> resolved, https://bugzilla.redhat.com/show_bug.cgi?id=182498#c8

Ok. Perhaps it isn't needed to exclude it, then.

___
Python tracker 

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



[issue1533164] Installed but not listed *.pyo break bdist_rpm

2009-03-01 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

> I agree. I had another complaint about that patch, though, which 
> is the addition of an option for not including .pyo files. 
> I still like to see addition of this option reverted.

I'll remove this option then, and make -O1 hardcoded

--
status: closed -> open

___
Python tracker 

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



[issue4715] optimize bytecode for conditional branches

2009-03-01 Thread Jeffrey Yasskin

Jeffrey Yasskin  added the comment:

Backported as r70071. I also fixed a couple things I missed in the py3k
branch in r70076. Thanks all!

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

___
Python tracker 

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



[issue5390] Item 'Python x.x.x' in Add/Remove Programs list still lacks an icon

2009-03-01 Thread Retro

Retro  added the comment:

Please see the attached screenshot where there are no icons in the
Add/Remove Programs list of the Python intepreters on my Windows Vista
machine.

Added file: http://bugs.python.org/file13223/my_arpvista.jpg

___
Python tracker 

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



[issue5390] Item 'Python x.x.x' in Add/Remove Programs list still lacks an icon

2009-03-01 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

Using regedit, find out which of the keys

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9cc89170-000b-457d-91f1-53691f85b224}
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{de2f2d9c-53e2-40ee-8209-74da63cb060f}
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{9cc89170-000b-457d-91f1-53691f85b223}
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{de2f2d9c-53e2-40ee-8209-74da63cb060e}

are present on your system. For each key, report the values of the
properties

DisplayName
DisplayIcon

___
Python tracker 

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



[issue5135] Expose simplegeneric function in functools module

2009-03-01 Thread Nick Coghlan

Nick Coghlan  added the comment:

Unassigning - the lack of support for ABC registration still bothers me,
but a) I don't have a good answer for it, and b) I'm going to be busy
for a while working on some proposed changes to the with statement.

--
assignee: ncoghlan -> 

___
Python tracker 

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



[issue5400] patches for multiprocessing module on NetBSD

2009-03-01 Thread Piotr Meyer

New submission from Piotr Meyer :

Multiprocessing module needs some patches to succesfully builing
and running on NetBSD. I made this patch and test on NetBSD 5rc2
(upcoming release).

1. we need working socket module (Modules/socketmodule.c)

2. mremap under NetBSD has different semantics:
   (Modules/mmapmodule.c)

3. finally, we need settings for netbsd in setup.py:
   (setup.py)  

After patching and building:

netbsd5#  ./python -bb -E Lib/test/regrtest.py test_multiprocessing
test_multiprocessing
1 test OK.

--
components: Build
files: py-netbsd-multiprocessing.diff
keywords: patch
messages: 82991
nosy: aniou
severity: normal
status: open
title: patches for multiprocessing module on NetBSD
type: compile error
versions: Python 3.0
Added file: http://bugs.python.org/file13224/py-netbsd-multiprocessing.diff

___
Python tracker 

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



[issue4480] bdist_msi and bdist_wininst are missing an uninstaller icon

2009-03-01 Thread Akira Kitada

Changes by Akira Kitada :


--
assignee:  -> tarek
components: +Windows
nosy: +tarek

___
Python tracker 

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



[issue4918] Windows installer created with Python 2.5 does not work with Python 2.6.1

2009-03-01 Thread Akira Kitada

Changes by Akira Kitada :


--
assignee:  -> tarek
components: +Windows
nosy: +tarek
type:  -> crash

___
Python tracker 

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



[issue5235] distutils seems to only work with VC++ 2008 (9.0)

2009-03-01 Thread Akira Kitada

Changes by Akira Kitada :


--
components: +Windows

___
Python tracker 

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



[issue5401] mimetypes.MAGIC_FUNCTION implementation clusterfuck

2009-03-01 Thread Armin Ronacher

New submission from Armin Ronacher :

Sorry for the harsh words, but when I found that code I nearly freaked
out.  For all those years I was using "from mimetypes import guess_type"
until today I found out that this has horrendous performance problems
due to the fact that the mimetype database is re-parsed on each call.

The reason for this is that mimetypes.guess_type is implemented like this:

def guess_type(...):
global guess_type
init()
guess_type = new_guess_type
return guess_type(...)

Obviously if the function was imported from the module and not looked up
via standard attribute lookup before each call (by calling it like
mimetypes.guess_type(...)) init() would be called over and over again.

What's the performance impact?  In a small WSGI middleware that serves
static files the *total* performance impact (including HTTP header
parsing, file serving etc.) was 1000%.  Just for guess_type() versus
mimetypes.guess_type() which was called just once per request.

I attached a workaround for that problem that tries to avoid init()
calls after the thing was initialized.

If this is intended behaviour it should be documented but I doubt that
this is a good idea as people don't read documentation it stuff seems to
work.

And google tells me I'm not the first one who invoked guess_type that
way: http://google.com/codesearch?q="from+mimetypes+import+guess_type";

--
components: Library (Lib)
files: mimetypes-speedup.diff
keywords: easy, needs review, patch, patch
messages: 82992
nosy: aronacher
priority: critical
severity: normal
stage: patch review
status: open
title: mimetypes.MAGIC_FUNCTION implementation clusterfuck
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file13225/mimetypes-speedup.diff

___
Python tracker 

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



[issue5401] mimetypes.MAGIC_FUNCTION performance problems

2009-03-01 Thread Armin Ronacher

Changes by Armin Ronacher :


--
title: mimetypes.MAGIC_FUNCTION implementation clusterfuck -> 
mimetypes.MAGIC_FUNCTION performance problems

___
Python tracker 

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



[issue5401] mimetypes.MAGIC_FUNCTION performance problems

2009-03-01 Thread Georg Brandl

Georg Brandl  added the comment:

Wah, that's really a horrible way to implement this caching.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-03-01 Thread Noam Raphael

Noam Raphael  added the comment:

I'm sorry, but it seems to me that the conclusion of the discussion in
2008 is that the algorithm should simply use the system's
binary-to-decimal routine, and if the result is like 123.456, round it
to 15 digits after the 0, check if the result evaluates to the original
value, and if so, return the rounded result. This would satisfy most
people, and has no need for complex rounding algorithms. Am I mistaken?

If I implement this, will anybody be interested?

Noam

___
Python tracker 

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



[issue1580] Use shorter float repr when possible

2009-03-01 Thread Guido van Rossum

Guido van Rossum  added the comment:

I tried that, and it was more subtle than that in corner cases.

Another argument against it is that on Windows the system input routine
doesn't correctly round unless 17 digits of precision are given.  One of
Tim Peters's responses should have evidence of that (or perhaps it was
on a python-dev thread).

___
Python tracker 

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



[issue5400] patches for multiprocessing module on NetBSD

2009-03-01 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +jnoller

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Jim Jewett

Jim Jewett  added the comment:

I would try to make it more explicit that updates do not reset the 
order, but deleting a item and re-inserting it *does*.  (So it isn't 
the first insertion of the key, it is the first that hasn't yet been 
followed by a deletion.)

Maybe change:

"""
When iterating over an ordered dictionary,
the items are returned in the order their keys were first added.
"""

to [removed "first", added longer explanation]

"""
When iterating over an ordered dictionary,
the items are returned in the order their keys were added.  (This 
implies that updating an item to a new value does not reset the order, 
but deleting the item and re-inserting it moves the item to the end.)
"""

--
nosy: +jimjjewett

___
Python tracker 

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



[issue5401] mimetypes.MAGIC_FUNCTION performance problems

2009-03-01 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Well, that was embarrassing! Fixed in r70086.

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

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Jim Jewett

Jim Jewett  added the comment:

I would also recommend strengthening some of the tests with regard to 
ordering stability across update vs delete-and-reinsert.

TestOrderedDict.test_update does verify that updated items are not 
moved to the end, but the comment suggests it is only checking that the 
previous contents had not been cleared entirely.

test_iterators, test_popitem, and test_pop check only single 
insertions; I think the tests would be stronger if you updated the dict 
with reversed(pairs) before iterating, so that it would be obvious the 
ordering was based on the original insertion, rather than the latest 
access.

test_setdefault should also verify that x is the final key, and that 
the a key hasn't changed position.

I didn't see any tests for insert a, insert b, delete a, re-insert a, 
verify that a is now later than b.

___
Python tracker 

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



[issue5402] MutableMapping code smell (see OrderedDict)

2009-03-01 Thread Jim Jewett

New submission from Jim Jewett :

Copy of issue 5397

In python 3, UserDict (and DictMixin) are gone; presumably they should 
be replaced by either a dict subclass or the ABC MutableMapping.

Unfortunately, there doesn't seem to be a clean way to inherit from 
both.  

In python 2.x, you could write

  class MyDict(DictMixin, dict): ...

but with

  class MyDict(MutableMapping, dict): ...

MutableMapping explicitly overrides __getitem__, __setitem__, and 
__delitem__ to raise a KeyError.

The OrderedDict implementation in issue 5397 puts the concrete class 
first, and then handles composite methods manually, by either rewriting 
them (repr, copy) or explicitly delegating past dict and straight to 
MutableMapping (setdefault, update, etc.)

Both solutions seem fragile.  

Unfortunately, the closest I come to a solution is to split the ABC 
into a Mixin portion and an ABC enforcer.

# The concrete methods of the current ABC
class MapMixin: 

# The abstract methods that get checked
class MutableMapping(MapMixin):

# Trust that dict will always implement 
# all required concrete methods for us
class MyDict(MapMixin, dict):

--
components: Library (Lib)
messages: 82999
nosy: aronacher, georg.brandl, jimjjewett, pitrou, rhettinger
severity: normal
status: open
title: MutableMapping code smell (see OrderedDict)
versions: Python 3.1

___
Python tracker 

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



[issue5238] ssl makefile never closes socket

2009-03-01 Thread David Christian

David Christian  added the comment:

I actually discovered this issue when using httplib over ssl. Closing
the httplib connection was not closing the socket - the socket would
only be closed after garbage collection, due to this bug.  That's what
caused me to investigate and find this flaw.

I ran the regression tests and didn't run into any issues.

___
Python tracker 

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



[issue1533164] Installed but not listed *.pyo break bdist_rpm

2009-03-01 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

done in r70094 and r70096

___
Python tracker 

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



[issue5403] test_md5 segfault

2009-03-01 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

I noticed test_md5 and test_multiprocessing crashed on trunk. I hope
attached patch will fix this issue. (Maybe the patch can be simplified
with goto)

--
components: Extension Modules
files: fix_md5_without_goto.patch
keywords: patch
messages: 83002
nosy: ocean-city
priority: release blocker
severity: normal
status: open
title: test_md5 segfault
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file13226/fix_md5_without_goto.patch

___
Python tracker 

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



[issue2459] speedup for / while / if with better bytecode

2009-03-01 Thread Jeffrey Yasskin

Jeffrey Yasskin  added the comment:

I've updated for_iter.patch to the latest trunk, merging in issue 4715.
I also changed tracing a bit so that the first line of a loop doesn't
get traced twice in the first iteration, and added to test_dis to check
that decreasing line numbers work there.

Review at http://codereview.appspot.com/20103 if you like.

Performance:

32-bit gcc-4.3 Intel Core2:
2to3:
25.09 -> 24.63: 1.87% faster

Django:
Min: 0.614 -> 0.609: 0.86% faster
Avg: 0.616 -> 0.635: 3.09% slower

Pickle: (cPickle)
Min: 1.647 -> 1.651: 0.21% slower
Avg: 1.650 -> 1.656: 0.39% slower

PyBench:
Min: 5341 -> 5273: 1.29% faster
Avg: 5450 -> 5397: 0.98% faster

SlowPickle: (pickle)
Min: 1.384 -> 1.341: 3.13% faster
Avg: 1.385 -> 1.343: 3.08% faster

Spitfire:
Min: 0.773 -> 0.690: 11.97% faster
Avg: 0.776 -> 0.695: 11.62% faster
Spitfire re-run:
Min: 0.740 -> 0.693: 6.81% faster
Avg: 0.744 -> 0.695: 6.93% faster

SlowUnpickle: (pickle)
Min: 0.645 -> 0.668: 3.37% slower
Avg: 0.646 -> 0.670: 3.59% slower
SlowUnpickle re-run:
Min: 0.645 -> 0.660: 2.31% slower
Avg: 0.645 -> 0.661: 2.32% slower


Unpickle: (cPickle)
Min: 1.015 -> 1.006: 0.89% faster
Avg: 1.021 -> 1.009: 1.16% faster


64-bit gcc-4.3 Intel Core2
2to3:
22.31 -> 21.97: 1.57% faster

Django:
Min: 0.577 -> 0.564: 2.29% faster
Avg: 0.579 -> 0.566: 2.20% faster

Pickle:
Min: 1.162 -> 1.178: 1.35% slower
Avg: 1.166 -> 1.183: 1.37% slower

PyBench:
Min: 4498 -> 4193: 7.27% faster
Avg: 4586 -> 4276: 7.25% faster

SlowPickle:
Min: 1.212 -> 1.133: 6.92% faster
Avg: 1.213 -> 1.135: 6.92% faster

Spitfire:
Min: 0.631 -> 0.617: 2.32% faster
Avg: 0.632 -> 0.621: 1.75% faster

SlowUnpickle:
Min: 0.575 -> 0.551: 4.31% faster
Avg: 0.576 -> 0.553: 4.14% faster

Unpickle:
Min: 0.708 -> 0.722: 1.88% slower
Avg: 0.745 -> 0.736: 1.20% faster

--
assignee:  -> pitrou
Added file: http://bugs.python.org/file13227/trunk-opt-loop.patch

___
Python tracker 

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



[issue1533164] Installed but not listed *.pyo break bdist_rpm

2009-03-01 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> done in r70094 and r70096

Thanks!

___
Python tracker 

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



[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Jim, I updated the docs to talk cover delete-reinsert.

Also, added a few more tests as suggested but am leaving test_iterators,
test_popitem, and test_pop unchanged.  It is enough to test
delete-reinsertion once or twice and know that we've separately tested
the component operations (setting new keys, setting existing keys, and
deleting existing keys).

Added file: http://bugs.python.org/file13228/od5.diff

___
Python tracker 

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



[issue5402] MutableMapping code smell (see OrderedDict)

2009-03-01 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

UserDict is not gone.  DictMixin is now mutable mapping.

--
assignee:  -> rhettinger
priority:  -> low

___
Python tracker 

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