[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread HiroakiKawai

HiroakiKawai  added the comment:

The sample code has bug. expat is OK.

Method char_data must append the incoming characters because the 
character sequence is an buffered input.
  def char_data(self, data):
self.data += data

You should reset it by self.data = '' at end_element().

--
nosy: +kawai

___
Python tracker 

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



[issue4908] adding a get_metadata in distutils

2009-01-24 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Well since Python 2.4 doesn't have the egg-info feature, that is another
story.

___
Python tracker 

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



[issue5040] Bug of CGIXMLRPCRequestHandler

2009-01-24 Thread Wayne Huang

New submission from Wayne Huang :

I met a bug of CGIXMLRPCRequestHandler in Python3.0. Because of the bug,
I couldn't use RPC in Apache CGI.

The version of my Python 3.0 is "Python 3.0 (r30:67507, Dec  3 2008,
20:14:27) [MSC v.1500 32 bit (Intel)] win32".

The code of my client is follow.

s = xmlrpc.client.ServerProxy('http://localhost/cgi-bin/rpc.py')
print(s.system.listMethods())

The code of my server in Apache's cgi-bin is follow

#!C:/Python30/python.exe

from xmlrpc.server import *

handler=CGIXMLRPCRequestHandler()
handler.register_introspection_functions()
handler.handle_request()

When I run the client code,some error of parser raise.

I found it is the matter of 'Content-Length' in the HTTP Response of
CGIXMLRPCRequestHandler,it is a wrong number.

--
components: Library (Lib)
messages: 80440
nosy: WayneHuang
severity: normal
status: open
title: Bug of CGIXMLRPCRequestHandler
type: performance
versions: Python 3.0

___
Python tracker 

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



[issue4672] Distutils SWIG support blocks use of SWIG -outdir option

2009-01-24 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Good suggestion, I'll add the quotes in the spawn call

Which does a simple log.info(string.join(cmd, ' ')) at the moment

--
assignee:  -> tarek
nosy: +tarek
versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 -Python 2.5

___
Python tracker 

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



[issue3677] importing from UNC roots doesn't work

2009-01-24 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

added the mem release in r68882.
I'll try to add test cases too.

___
Python tracker 

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



[issue3677] importing from UNC roots doesn't work

2009-01-24 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Added tests for UNC path imports in r68883 and r68884

___
Python tracker 

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



[issue3677] importing from UNC roots doesn't work

2009-01-24 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

>The path variable should be PyMem_Free'd

Sorry if I'm missing something, but is this really needed?
Other PyArg_ParseTuple(args, "s... doesn't seem to have
corresponding PyMem_Free.

static PyObject *
imp_new_module(PyObject *self, PyObject *args)
{
char *name;
if (!PyArg_ParseTuple(args, "s:new_module", &name))
return NULL;
return PyModule_New(name);
}

___
Python tracker 

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



[issue5025] test_kqueue failure on OS X

2009-01-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

I just saw this same test_kqueue failure pop up on the OS X 3.x buildbot,
so it's evidently not just a peculiarity of my machine.

Unless there are any objections, I'll go ahead and check this in:  I think 
it's a sufficiently trivial fix that it's not worth wasting Christian's 
time with. :)

--
assignee: christian.heimes -> marketdickinson

___
Python tracker 

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



[issue5025] test_kqueue failure on OS X

2009-01-24 Thread Mark Dickinson

Changes by Mark Dickinson :


--
priority:  -> normal

___
Python tracker 

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



[issue3677] importing from UNC roots doesn't work

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

Martin v. Löwis  added the comment:

> Sorry if I'm missing something, but is this really needed?

Yes, the "es" converter allocates memory.

___
Python tracker 

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



[issue4111] Add DTrace probes

2009-01-24 Thread Skip Montanaro

Skip Montanaro  added the comment:

Laca> Please see here for discussion about the -G flag on OS X:
Laca> http://markmail.org/message/4nheqnexjr2o6mcx

Laca> If I read it correctly, on OS X, you will need to use -h instead
Laca> of -G and it won't emit an object file (dtrace.o) so you will not
Laca> need to link it.

Laca> Unfortunately, this means that the makefile will have to be
Laca> different on Solaris and OS X :(

We can worm around that using configure.  Thanks for the reference.  That
will go a long way toward getting the Sun dtrace probes working on Mac OSX.
For reference by others, here's Lee Packham's dtrace patch for PostgreSQL on
Mac OSX: 
http://blog.leenux.org.uk/wp-content/uploads/2008/10/postgresql-825-fixosxdtracediff.gz

___
Python tracker 

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



[issue3677] importing from UNC roots doesn't work

2009-01-24 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Ah, "es" is used in py3k, thanks. And sorry about my merge which had 
memory leak.

___
Python tracker 

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



[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread Takeshi Matsuyama

Takeshi Matsuyama  added the comment:

Hi kawai.
I got correct output by modifying the code like you say, but I still
cannot understand why this happens.
Could you tell me more briefly, or point any documents about it?
I can't find any notes which say don't pass strings but append it for
CharacterDataHandler in official documents.
Does everyone know/understand it already? Only I am so stupid? (;;)

___
Python tracker 

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



[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly

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

Martin v. Löwis  added the comment:

Committed as r68885, r68886, r68887, and r6

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



[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread HiroakiKawai

HiroakiKawai  added the comment:

That's the spec of XML SAX interface.

___
Python tracker 

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



[issue5041] Memory leak in imp.find_module

2009-01-24 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

I found memory leak related to "es" on PyArg_ParseTuple.

--
components: Extension Modules
files: py3k_memory_leak.patch
keywords: easy, needs review, patch
messages: 80452
nosy: ocean-city
severity: normal
status: open
title: Memory leak in imp.find_module
type: resource usage
versions: Python 3.0
Added file: http://bugs.python.org/file12844/py3k_memory_leak.patch

___
Python tracker 

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



[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread HiroakiKawai

HiroakiKawai  added the comment:

Please read "The ContentHandler.characters() callback is missing data!" 
http://www.saxproject.org/faq.html

and close this issue :)

___
Python tracker 

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



[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread Takeshi Matsuyama

Takeshi Matsuyama  added the comment:

a mistake of my former message, briefly -> in detail

>Please read "The ContentHandler.characters() callback is missing data!" 
>http://www.saxproject.org/faq.html
I was just reading above site. it is now very clear for me.
Thanks kawai and I'm sorry to take up your time, gagenellina.

___
Python tracker 

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



[issue5037] unicode(x) for weakref.proxy objects invokes __str__ instead of __unicode__

2009-01-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

weakref.proxy needs to be fixed to delegate the unicode slot correctly.

>>> from weakref import proxy
>>> "__unicode__" in dir(type(proxy(Exception)))
False

That predicate must return true in order for the delegation to do the
right thing (this is actually the case for all of the slots and
pseudo-slots that can bypass __getattribute__ on the instance object -
it's just that most of them are already handled correctly).

This need to explicitly delegate all supported slots is the reason why
weakref proxy instances add so many magic method stubs when compared to
the actual interface of the underlying class:

>>> len(set(dir(type(proxy(Exception - set(dir(Exception)))
53

___
Python tracker 

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



[issue4393] Portability fixes in longobject.c

2009-01-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fixed in r68890, r68891, r68895 and r68896

--
status: open -> closed

___
Python tracker 

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



[issue5042] Structure sub-subclass does not initialize with base class positional arguments

2009-01-24 Thread Jason R. Coombs

New submission from Jason R. Coombs :

When trying to create a sub-subclass of a ctypes.Structure, the behavior
is not as expected.

An executable example that describes the problem in detail and
demonstrates the issue is available at
http://paste.turbogears.org/paste/29555 and also attached.

The failing behavior is near the beginning, following the description.

Three unsuccessful workarounds follow.

The expected behavior is found at the end, where a final workaround has
been implemented.

Can this behavior be improved in subsequent releases of ctypes?  If not,
can ctypes at least support the workaround natively (perhaps by
providing a method in the Structure class that performs the workaround
and can be called by a sub-subclass during __init__)?

--
assignee: theller
components: ctypes
files: ctypes subclassing issues.py
messages: 80457
nosy: jaraco, theller
severity: normal
status: open
title: Structure sub-subclass does not initialize with base class positional 
arguments
type: behavior
versions: Python 2.5, Python 2.6, Python 3.0
Added file: http://bugs.python.org/file12845/ctypes subclassing issues.py

___
Python tracker 

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



[issue5025] test_kqueue failure on OS X

2009-01-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fixed in the trunk in r68897.  Will merge to 2.6, 3.0 and 3.1.

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



[issue3881] IDLE won't start in custom directory.

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

Martin v. Löwis  added the comment:

Committed as r68893, r68894, r68898, r68901.

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



[issue3105] Python 2.5.2 Windows Source Distribution missing Visual Studio 2005 ssl build files

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

Martin v. Löwis  added the comment:

This patch is out of date; VS 2005 is no longer of interest.

--
nosy: +loewis
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue2271] msi installs to the incorrect location (C drive)

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

Martin v. Löwis  added the comment:

Fixed in r66305.

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



[issue4566] 2.6.1 breaks many applications that embed Python on Windows

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

Martin v. Löwis  added the comment:

Mark, the patch is fine, please apply. Great work!

--
assignee:  -> mhammond
resolution:  -> accepted

___
Python tracker 

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



[issue4982] Running python 3 as Non-admin User requests the Runtime to terminate in an unusual way.

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

Martin v. Löwis  added the comment:

Do you have PYTHONPATH set, by any chance? Python 3.0 shouldn't pick up
c:\python25.

--
nosy: +loewis

___
Python tracker 

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



[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fixed in the trunk in r68903.  If the buildbots are happy with the new 
tests, I'll port to 2.6, 3.0 and 3.1.

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



[issue4908] adding a get_metadata in distutils

2009-01-24 Thread Ray

Ray  added the comment:

There wouldn't be an easy way to read the distutils setup.py info at
all in 2.4?  i suppose i could write something specific for our
environment.

On 1/24/09, Tarek Ziadé  wrote:
>
>  Tarek Ziadé  added the comment:
>
>  Well since Python 2.4 doesn't have the egg-info feature, that is another
>  story.
>
>
>  ___
>  Python tracker 
>  
>  ___
>

___
Python tracker 

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



[issue5043] get_msvcr() returns None rather than []

2009-01-24 Thread Luke Kenneth Casson Leighton

New submission from Luke Kenneth Casson Leighton :

def get_msvcr():
"""Include the appropriate MSVC runtime library if Python was built
with MSVC 7.0 or later.
"""
msc_pos = sys.version.find('MSC v.')
if msc_pos != -1:
msc_ver = sys.version[msc_pos+6:msc_pos+10]
if msc_ver == '1300':
# MSVC 7.0
return ['msvcr70']
elif msc_ver == '1310':
# MSVC 7.1
return ['msvcr71']
elif msc_ver == '1400':
# VS2005 / MSVC 8.0
return ['msvcr80']
elif msc_ver == '1500':
# VS2008 / MSVC 9.0
return ['msvcr90']
else:
raise ValueError("Unknown MS Compiler version %i " % msc_Ver)

return [] -

--
components: Build
messages: 80466
nosy: lkcl
severity: normal
status: open
title: get_msvcr() returns None rather than []
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



[issue5031] Thread.daemon docs

2009-01-24 Thread Jesse Noller

Changes by Jesse Noller :


Removed file: http://bugs.python.org/file12843/issue5031.patch

___
Python tracker 

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



[issue5031] Thread.daemon docs

2009-01-24 Thread Jesse Noller

Jesse Noller  added the comment:

Then the patch I wrote before "correcting it" was more purist ;) I 
preferred the `daemon` = ``False`` wording as well. Here's a corrected 
patch.

Added file: http://bugs.python.org/file12846/issue5031.patch

___
Python tracker 

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



[issue5037] unicode(x) for weakref.proxy objects invokes __str__ instead of __unicode__

2009-01-24 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Here's a patch.

--
keywords: +needs review, patch
priority:  -> high
Added file: http://bugs.python.org/file12847/weakref_unicode.patch

___
Python tracker 

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



[issue5044] name not found in generator in eval()

2009-01-24 Thread Frank Henigman

New submission from Frank Henigman :

# works
>>> eval( "sum( [ a[0]=='a' for j in 'a' ] )", {}, dict(a='a'))
# take out the square brackets
>>> eval( "sum(   a[0]=='a' for j in 'a'   )", {}, dict(a='a'))
NameError: global name 'a' is not defined

--
components: Interpreter Core
messages: 80469
nosy: fjhpy
severity: normal
status: open
title: name not found in generator in eval()
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue1529142] Allowing multiple instances of IDLE with sub-processes

2009-01-24 Thread Weeble

Weeble  added the comment:

I installed Ubuntu on a laptop at the beginning of January and have
applied the patch I submitted above to IDLE. I've been using it
regularly for the last few weeks and have had no problems with it.

___
Python tracker 

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



[issue5043] get_msvcr() returns None rather than []

2009-01-24 Thread Roumen Petrov

Roumen Petrov  added the comment:

My comment on this part of code is( from issue3871): 
+# FIXME: next code is from issue870382
+# MS C-runtime libraries never support backward compatibility.
+# Linking to a different library without to specify correct runtime
+# version for the headers will link renamed functions to msvcrt.
+# See issue3308: this piece of code is python problem even
+# with correct w32api headers.
+# Issue: for MSVC compiler we can get the version and from version
+# to determine mcvcrt as code below. But what about if python is
+# build with GCC compiler?
+# Output of sys.version is information for python build on first
+# line, on the next line is information for the compiler and the
+# output lack information for the C-runtime.

My vote is to remove function get_msvcr() from cygwinccompiler.py.

--
nosy: +rpetrov

___
Python tracker 

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



[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Hmm.  After checking in this patch, the gentoo x86 trunk buildbot
has a new failure in test_pickletools, with the following output:

test_pickletools
**
File 
"/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/pickletools.py", 
line ?, in 
pickletools.__test__.disassembler_test
Failed example:
dis(pickle.dumps(random.random, 0))
Expected:
0: cGLOBAL 'random random'
   15: pPUT0
   18: .STOP
highest protocol among opcodes = 0
Got:
0: cGLOBAL 'bsddb.test.test_thread random'
   31: pPUT0
   34: .STOP
highest protocol among opcodes = 0
**
1 items had failures:
   1 of  25 in pickletools.__test__.disassembler_test
***Test Failed*** 1 failures.
test test_pickletools failed -- 1 of 95 doctests failed

I'm having some difficulty figuring out how this could be
related to the checkin of this patch.

Anyone have any ideas where this might be coming from?

___
Python tracker 

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



[issue4676] python3 closes + home keys

2009-01-24 Thread Weeble

Weeble  added the comment:

I have experienced similar problems in Python 2.6.1 on Windows, and
found them to be due to Tk 8.5. I posted my findings here:

http://mail.python.org/pipermail/idle-dev/2009-January/002738.html

In summary, Tk 8.5 changed the name of the "anchor" mark to be unique to
each Text widget. The code to make the home key toggle between column 0
and the start of the text tries to make use of the "anchor" mark and
gets confused.

In the email I proposed a simple fix which I'm testing out right now.
Should I attach it as a patch?

--
nosy: +weeble

___
Python tracker 

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



[issue5016] FileIO.seekable() can return False

2009-01-24 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12821/fileio_append.patch

___
Python tracker 

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



[issue5016] FileIO.seekable() can return False

2009-01-24 Thread STINNER Victor

STINNER Victor  added the comment:

Woops, I attached the wrong patch!

Added file: http://bugs.python.org/file12848/fileio_seekable.patch

___
Python tracker 

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



[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This is not a new failure but an erratic one, and caused by a weakness
in pickle's handling of functions. See #3657.

--
nosy: +pitrou

___
Python tracker 

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



[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks, Antoine!

___
Python tracker 

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



[issue3657] pickle can pickle the wrong function

2009-01-24 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +marketdickinson

___
Python tracker 

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



[issue2527] Pass a namespace to timeit

2009-01-24 Thread David W. Lambert

David W. Lambert  added the comment:

This note is simply a reminder that Antoine's 'from __main__ import *' 
solution fails in python3.  Also, resolution of this issue probably 
could incorporate Issue1397474.


>>> import timeit
>>> timeit.timeit('None','from __main__ import *')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.0/timeit.py", line 227, in timeit
return Timer(stmt, setup, timer).timeit(number)
  File "/usr/local/lib/python3.0/timeit.py", line 135, in __init__
code = compile(src, dummy_src_name, "exec")
  File "", line 2
SyntaxError: import * only allowed at module level

--
nosy: +LambertDW

___
Python tracker 

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



[issue5044] name not found in generator in eval()

2009-01-24 Thread David W. Lambert

Changes by David W. Lambert :


--
nosy: +LambertDW

___
Python tracker 

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



[issue4676] python3 closes + home keys

2009-01-24 Thread Weeble

Weeble  added the comment:

Another complication. On Windows, this line doesn't do what it claims:

if (event.state & 12) != 0 and event.keysym == "Home":
# state&1==shift, state&4==control, state&8==alt
return # ; fall back to class binding

The comment says state&8==alt, but this is wrong. state&8==mod1, and on
Windows Tk defines mod1 to be num-lock. So if you have num-lock on,
home_callback will always fall back to the standard binding.

See the Tk source:
xlib/X11/X.h   defines Mod1Mask
win/tkWinX.c   maps VK_NUMLOCK to Mod1Mask

___
Python tracker 

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



[issue3657] pickle can pickle the wrong function

2009-01-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

I just committed Tim's suggested change in r68906.  This seemed a no-
brainer, regardless of what should be done about pickle.whichmodule.  One 
fewer sporadic buildbot failure sounds like a good thing to me.

(I hadn't noticed the pickletools failures until just after I committed a 
pickle module change, so I was rather thrown until Antoine directed me 
here...)

___
Python tracker 

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



[issue5045] imaplib should remove length of literal strings

2009-01-24 Thread Branden Moore

New submission from Branden Moore :

IMAP Literals are a tricky subject.  Currently, if IMAP returns:

* text text text {5}\r\n
12345more text

imaplib will return 2 data items:
[("text text text {5}", '12345'), "more text"]

This forces users of imaplib to then parse out and remove the '{5}' from
the first part of the tuple before appending the literal string.  It
would be nice to have imaplib strip the '{size}' portion of the string
in the first part of the tuple, so that the return value would be:
[("text text text ", '12345'), "more text"]

Though, because this entire response from the IMAP server should be
interpreted as a single line, it would be even better to return a
response such that 'data' is:
[(("text text text ", '12345'), "more text")]

a.k.a., a single 'data' item (only one IMAP response per data item) that
contains either a string or a tuple.  The tuple will contain either more
tuples and/or more strings.  Each sub-tuple here would contain two
strings, text, and the IMAP Literal String.

This would make parsing the responses from imaplib much more simple.  It
demarks obviously where IMAP Literal Strings are, and doesn't require
additional string parsing on the side of the imaplib user.

Thanks!

--
components: Library (Lib)
messages: 80480
nosy: bmoore
severity: normal
status: open
title: imaplib should remove length of literal strings
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6

___
Python tracker 

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



[issue5046] native win32 and wine mingw+msys build of python2.7

2009-01-24 Thread Luke Kenneth Casson Leighton

New submission from Luke Kenneth Casson Leighton :

this is an update of the mingw+msys port for native win32,
with the aim of being both compiled and used under both
wine-win32 and native-win32.

it is not a cross-compile patch.  it does not require -lwine.
it does not require a unix system.  it does not require cygwin.
(repeat the previous four sentences for both build _and_ use
of the resultant python.exe).  this information is specifically
given and stated [so blandly] because several people have been
extremely confused by what this patch achieves, due to the
tools being utilised to achieve it [wine].

the patch is against svn trunk r68884.

as of 2 hours ago, the following tests failed:
22 tests failed:
test_cmath test_cmd_line_script test_compiler test_ctypes
test_decimal test_distutils test_file test_logging test_mailbox
test_math test_ntpath test_os test_parser test_posixpath test_pwd
test_smtplib test_startfile test_tempfile test_transformer
test_winsound test_zipfile test_zipimport_support

since then, several have been corrected.  test_pwd should not be
being tested.  several of the tests (test_tempfile) are fails due
to use of native wine msvcrt (it gets better when win32 msvcrt
is used).

this is work-in-progress for those people interested.

builds with --enable-msvcr9build are possible.

incorporation of roumen's cross-compile work is ongoing.

--
components: Build
files: python-2.7a0-r68884-mingw-msys.patch
keywords: patch
messages: 80481
nosy: lkcl
severity: normal
status: open
title: native win32 and wine mingw+msys build of python2.7
type: feature request
versions: Python 2.7
Added file: 
http://bugs.python.org/file12849/python-2.7a0-r68884-mingw-msys.patch

___
Python tracker 

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



[issue5047] Remove Monterey support from configure.in

2009-01-24 Thread Skip Montanaro

New submission from Skip Montanaro :

The attached patch removes vestiges of Monterey compiler support from
configure.in.  Apparently Monterey was some ill-conceived 64-bit SCO/IBM
operating system which died in 2000.  Can't see why we need to support it.

Skip

===File ~/src/python/trunk/configure.in.diff
Index: configure.in
===
--- configure.in(revision 68905)
+++ configure.in(working copy)
@@ -216,7 +216,7 @@
 if test -z "$MACHDEP"
 then
ac_sys_system=`uname -s`
-   if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
+   if test "$ac_sys_system" = "AIX" \
-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
ac_sys_release=`uname -v`
else
@@ -438,9 +438,6 @@
AR="\$(srcdir)/Modules/ar_beos"
RANLIB=:
;;
-Monterey*)
-RANLIB=:
-without_gcc=;;
*)  without_gcc=no;;
esac])
 AC_MSG_RESULT($without_gcc)
@@ -562,10 +559,6 @@
 case $CC in
 cc|*/cc) CC="$CC -Ae";;
 esac;;
-Monterey*)
-case $CC in
-cc) CC="$CC -Wl,-Bexport";;
-esac;;
 SunOS*)
 # Some functions have a prototype only with that define, e.g. confstr
 AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional 
function prototypes.])
@@ -626,8 +619,6 @@
   exp_extra="."
   fi
   LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra 
\$(LIBRARY); $LINKCC";;
-   Monterey64*)
-  LINKCC="$LINKCC -L/usr/lib/ia64l64";;
QNX*)
   # qcc must be used because the other compilers do not
   # support -N.
@@ -855,15 +846,6 @@
OPT="-O"
;;
 esac
-
-# The current (beta) Monterey compiler dies with optimizations
-# XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
-case $ac_sys_system in
-   Monterey*)
-   OPT=""
-   ;;
-esac
-
 fi

 AC_SUBST(BASECFLAGS)
@@ -1709,7 +1691,6 @@
else LDSHARED='$(CC) -G'
fi;;
SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
-   Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
atheos*) LDSHARED="gcc -shared";;
*)  LDSHARED="ld";;
@@ -1746,7 +1727,6 @@
then CCSHARED="-fPIC"
else CCSHARED="-Kpic -belf"
fi;;
-   Monterey*) CCSHARED="-G";;
IRIX*/6*)  case $CC in
   *gcc*) CCSHARED="-shared";;
   *) CCSHARED="";;


--
messages: 80482
nosy: skip.montanaro
severity: normal
status: open
title: Remove Monterey support from configure.in

___
Python tracker 

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



[issue5034] itertools.fixlen

2009-01-24 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Am still leaning towards rejecting this one based on:
* paucity of use cases
* non-atomicity (it can be built-out of existing tools)
* minimizing the number of tools in the toolkit
* not convinced that padded tuple unpacking is desirable

___
Python tracker 

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



[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fix merged in r68907 (2.6), r68908 (3.1) and r68909 (3.0).

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



[issue4111] Add DTrace probes

2009-01-24 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue5026] [reopening] native build of python win32 using msys under both wine and native win32

2009-01-24 Thread Luke Kenneth Casson Leighton

Luke Kenneth Casson Leighton  added the comment:

#5046 supercedes this patch, for python2.7.  still relevant
for python2.5 though.

___
Python tracker 

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



[issue5046] native win32 and wine mingw+msys build of python2.7

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

Martin v. Löwis  added the comment:

Please don't post work in progress to this bugtracker.

--
nosy: +loewis
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue5047] Remove Monterey support from configure.in

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

Martin v. Löwis  added the comment:

You might want to take a look at r16962. It changed a few other things
as well.

Please do put patches into attachments, rather than including them in
the message.

--
nosy: +loewis

___
Python tracker 

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



[issue5047] Remove Monterey support from configure.in

2009-01-24 Thread Skip Montanaro

Skip Montanaro  added the comment:

Martin> You might want to take a look at r16962. It changed a few other
Martin> things as well.

Will do.

Martin> Please do put patches into attachments, rather than including
Martin> them in the message.

Yeah, that's new mail program version suckage.  You would think an Emacs
command called "mail-attach-file" would actually attach the damn file
instead of simply embedding it into the mail message.

Skip

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-24 Thread Jeffrey Yasskin

Jeffrey Yasskin  added the comment:

In the comment, you might mention both -fno-crossjumping and -fno-gcse.
-fno-crossjumping's description looks like it ought to prevent combining
computed gotos, but
http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Optimize-Options.html says
-fno-gcse actually does it, and in my brief tests, the manual is
actually correct (compiling with just -fno-crossjumping combined gotos
anyway).

Otherwise, threadedceval6.patch looks good to submit to me.

___
Python tracker 

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



[issue5047] Remove Monterey support from configure.in

2009-01-24 Thread Skip Montanaro

Skip Montanaro  added the comment:

Here's the original patch as an attachment.

--
keywords: +patch
Added file: http://bugs.python.org/file12850/configure.in.diff

___
Python tracker 

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



[issue5047] Remove Monterey support from configure.in

2009-01-24 Thread Skip Montanaro

Skip Montanaro  added the comment:

And a diff for README.  The other changes in r16962 seem to be bug fixes 
which, while exposed by the Monterey port, don't appear to be platform-
dependent.

Added file: http://bugs.python.org/file12851/README.diff

___
Python tracker 

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



[issue5048] Extending itertools.combinations

2009-01-24 Thread Konrad

New submission from Konrad :

The function itertools.combinations might benefit from making
the 'r' (length of the combinations) argument optionally a sequence.

With that change one could call combinations(sequence, [2, 3]) in
order to get all combinations of length 2 and 3.
In particular, one could call combinations(sequence,
range(len(sequence)) in order to get *all* combinations of given
sequence.

The change would be backwards compatible as it would check for
sequential arguments.

--
components: Library (Lib)
messages: 80492
nosy: konryd, rhettinger
severity: normal
status: open
title: Extending itertools.combinations
type: feature request

___
Python tracker 

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



[issue5049] ctypes unwilling to allow pickling wide character array

2009-01-24 Thread Jason R. Coombs

New submission from Jason R. Coombs :

Using Python 2.6.1, I'm unable to pickle a simple object with an array
of wide characters.

import ctypes, pickle

class MyStruct(ctypes.Structure):
  _fields_ = [('name', ctypes.c_wchar*2)]

s = MyStruct('DC')

pickle.dumps(s) # raises ValueError.

Replace ctypes.c_wchar with ctypes.c_char and the pickling works fine.

--
assignee: theller
components: ctypes
messages: 80493
nosy: jaraco, theller
severity: normal
status: open
title: ctypes unwilling to allow pickling wide character array
type: behavior
versions: Python 2.6, Python 3.0

___
Python tracker 

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



[issue5049] ctypes unwilling to allow pickling wide character

2009-01-24 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I just discovered that trying to pickle a structure with even just a
c_wchar (not an array) also fails.

--
title: ctypes unwilling to allow pickling wide character array -> ctypes 
unwilling to allow pickling wide character

___
Python tracker 

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



[issue5049] ctypes unwilling to allow pickling wide character

2009-01-24 Thread Jesse Noller

Changes by Jesse Noller :


--
nosy: +jnoller

___
Python tracker 

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



[issue5048] Extending itertools.combinations

2009-01-24 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Do you have compelling use cases?

Is it worth what it takes to preserve the relation with permuations()
and product() and the lexicographic orderings?

Do we care the length of the output is no longer predictable by a simple
n! / r! / (n-r)!  ?

Do we care that the variable length output prevents uses in for-loops
with tuple unpacking:

   for a, b, c in combinations('ABCDEF', [2,3]):
. . .

--
assignee:  -> rhettinger
components: +Extension Modules -Library (Lib)
versions: +Python 2.7, Python 3.1

___
Python tracker 

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



[issue5050] unicode(C) invokes C.__unicode__ when __unicode__ is defined

2009-01-24 Thread Yu-Jie Lin

New submission from Yu-Jie Lin :

Run the following code

class A:
  def __str__(self):
return "__str__"
  def __unicode__(self):
return "__unicode__"

a = A()

print str(a), unicode(a)
print str(A), unicode(A)



Results on Python 2.5.4 (r254:67916):
__str__ __unicode__
__main__.A
Traceback (most recent call last):
  File "/home/livibetter/tmp/unicode_classobj.py", line 14, in 
print str(A), unicode(A)
TypeError: unbound method __unicode__() must be called with A instance
as first argument (got nothing instead)

Results on Python 2.6.1 (r261:67515):
__str__ __unicode__
__main__.A __main__.A



I was expecting the same result as on 2.6.1. By my observation,
unicode(C) tries to invoke C.__unicode__ if __unicode__ is defined in C,
where C is a class object.

I believe this behavior is incorrect.

--
messages: 80496
nosy: livibetter
severity: normal
status: open
title: unicode(C) invokes C.__unicode__ when __unicode__ is defined
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



[issue5050] unicode(C) invokes C.__unicode__ when __unicode__ is defined

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

Martin v. Löwis  added the comment:

No further bugs will be fixed in Python 2.5, unless they are security
bugs (which this is not). So closing it as "won't fix".

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



[issue5048] Extending itertools.combinations

2009-01-24 Thread Ezio Melotti

Ezio Melotti  added the comment:

It would also be nice to have a __len__ method on both permutations and
combinations.

len(permutations(sequence)) could return the number of permutations
using the formulas (e.g. n! for permutations) without generating all the
possible permutations (as opposed to something like
len(list(permutations(sequence.

Also, is there a way to calculate combinations with repetitions[1]?
Maybe we could add an optional argument repetitions=True/False.

[1]:
http://en.wikipedia.org/wiki/Combinations#Number_of_combinations_with_repetition

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue5048] Extending itertools.combinations

2009-01-24 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Guido disallowed returning a len method on iterators.  He expected
bool(it) to be False.

The recipes section of the itertools docs has code for
combinations_with_replacement().  It was not included originally because
it was unclear whether there was actually a need to generate them. 
Possibly, people are mainly interested in knowing how many there are but
having no need to actually enumerate them.  That being said, if I get
more requests or if some real world use cases arise, I would be happy to
C the recipe and add it in Py2.7.

___
Python tracker 

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