[issue6065] bdist_msi.py failed assert when including extension modules

2009-05-20 Thread Tim Golden

Changes by Tim Golden :


--
assignee:  -> tarek
components: +Distutils
nosy: +tarek
type:  -> behavior
versions: +Python 2.7

___
Python tracker 

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



[issue4174] Performance optimization for min() and max() over lists

2009-05-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I am with Raymond here: I don't think the performance improvement would
be worth a significant complification of the code - unless the
improvement is /very/ large.

--

___
Python tracker 

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



[issue6067] make error

2009-05-20 Thread gast

New submission from gast :

please help my!

OS - AIX 5.3 64x
i have need to install Python 2.6

./configure --with-gcc

configure: WARNING: wchar.h: present but cannot be compiled
configure: WARNING: wchar.h: check for missing prerequisite headers?
configure: WARNING: wchar.h: see the Autoconf documentation
configure: WARNING: wchar.h: section "Present But Cannot Be 
Compiled"
configure: WARNING: wchar.h: proceeding with the preprocessor's result
configure: WARNING: wchar.h: in the future, the compiler will take 
precedence
configure: WARNING: ## -
--- ##
configure: WARNING: ## Report this to http://www.python.org/python-
bugs ##
configure: WARNING: ## -
--- ##

 
make

In file included from Include/unicodeobject.h:120,
 from Include/Python.h:85,
 from ./Modules/python.c:3:
/opt/freeware/lib/gcc/powerpc-ibm-aix5.1.0.0/4.0.0/include/wchar.h:299: 
error: parse error before 'mbstate_t'
/opt/freeware/lib/gcc/powerpc-ibm-aix5.1.0.0/4.0.0/include/wchar.h:302: 
error: parse error before 'mbstate_t'
make: 1254-004 The error code from the last command is 1.

What can i do for correct it? please...

--
components: Installation
messages: 88108
nosy: gast
severity: normal
status: open
title: make error
type: compile error
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



[issue5982] classmethod, staticmethod: expose wrapped function

2009-05-20 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Is there a difficulty I did not see? Here is a patch.

--
keywords: +patch
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file14021/staticmethod_func.patch

___
Python tracker 

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



[issue6068] c_ulonglong structure members appear read-only

2009-05-20 Thread higstar

New submission from higstar :

When defining a structure with members of ctype type c_ulonglong, some
members appear read only?

I created this test.py and appended the results below:
-
import ctypes
import time

class all_ulong(ctypes.BigEndianStructure):
_fields_= [
   ("Data0",   ctypes.c_ulong, 4),
   ("Data1",   ctypes.c_ulong, 4),
  ]
class all_ulonglong(ctypes.BigEndianStructure):
_fields_= [
   ("Data0",   ctypes.c_ulonglong, 4),
   ("Data1",   ctypes.c_ulonglong, 4),
  ]

def inc_both_members(test):
test.Data0 += 1
test.Data1 += 1
def print_both_members(test):
print("Data0 is %d, Data1 is %d for %s"%(test.Data0, test.Data1,
test.__class__.__name__))

tests = [all_ulong(), all_ulonglong()]
for test in tests:
print_both_members(test)

Failed = False
while not Failed:
for test in tests:
inc_both_members(test)
print_both_members(test)
if not tests[0].Data0 == tests[1].Data0: 
Failed = True
if not tests[0].Data1 == tests[1].Data1: 
Failed = True
-
>c:\python25\python.exe test.py
Data0 is 0, Data1 is 0 for all_ulong
Data0 is 0, Data1 is 0 for all_ulonglong
Data0 is 1, Data1 is 1 for all_ulong
Data0 is 1, Data1 is 1 for all_ulonglong
Data0 is 2, Data1 is 2 for all_ulong
Data0 is 2, Data1 is 1 for all_ulonglong

>c:\python26\python.exe test.py
Data0 is 0, Data1 is 0 for all_ulong
Data0 is 0, Data1 is 0 for all_ulonglong
Data0 is 1, Data1 is 1 for all_ulong
Data0 is 1, Data1 is 1 for all_ulonglong
Data0 is 2, Data1 is 2 for all_ulong
Data0 is 2, Data1 is 1 for all_ulonglong

>c:\python30\python.exe test.py
Data0 is 0, Data1 is 0 for all_ulong
Data0 is 0, Data1 is 0 for all_ulonglong
Data0 is 1, Data1 is 1 for all_ulong
Data0 is 1, Data1 is 1 for all_ulonglong
Data0 is 2, Data1 is 2 for all_ulong
Data0 is 2, Data1 is 1 for all_ulonglong


As you can see the second member Data1, is not incrementing correctly.

I found this issue because I started using c_ulonglong types for all
members so that when casting a byte stream to one of these ctype
structures, there are no incorrect values when casting to a member
crossing byte/word/long boundaries.

--
assignee: theller
components: ctypes
messages: 88110
nosy: higstar, theller
severity: normal
status: open
title: c_ulonglong structure members appear read-only
type: compile error
versions: Python 2.5, 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



[issue6069] casting error from ctypes array to structure

2009-05-20 Thread higstar

New submission from higstar :

Structure fails to correctly cast from a 2 byte bitfield.

>From my very limited investigation, is looks like when using a member
type of less than the total size of the structure (or at least the size
of any byte boundaries) the casting is not done correctly?

I created this test.py and appended the results below:

---
import ctypes
import time

class closest_fit(ctypes.BigEndianStructure):
#_pack_  = 1# aligned to 8 bits, not ctypes default of 32
_fields_= [
   ("Data0",   ctypes.c_ubyte, 7),
   ("Data1",   ctypes.c_ubyte, 8),
   ]

class all_ulong(ctypes.BigEndianStructure):
#_pack_  = 1# aligned to 8 bits, not ctypes default of 32
_fields_= [
   ("Data0",   ctypes.c_ulonglong, 7),
   ("Data1",   ctypes.c_ulonglong, 8),
  ]

def castbytes(type):
buffer = (ctypes.c_byte * 2)()
buffer[0] = 0x55
buffer[1] = 0x55
return ctypes.cast(ctypes.pointer(buffer),
ctypes.POINTER(type)).contents

def print_members(test):
print("Data0 is 0x%X, Data1 is 0x%X for %s"%(test.Data0, test.Data1,
test.__class__.__name__))

test_classes = [ closest_fit, all_ulonglong]

Failed = False
tests = [castbytes(type) for type in test_classes]
for test in tests:
print_members(test)
if not tests[0].Data0 == tests[1].Data0: 
Failed = True
if not tests[0].Data1 == tests[1].Data1: 
Failed = True

if Failed:
print("Failed")
else:
print("Passed")
---

>c:\python25\python.exe test.py
Data0 is 0x2A, Data1 is 0x55 for closest_fit
Data0 is 0x2A, Data1 is 0xAA for all_ulonglong
Failed

>c:\python26\python.exe test.py
Data0 is 0x2A, Data1 is 0x55 for closest_fit
Data0 is 0x2A, Data1 is 0xAA for all_ulonglong
Failed

>c:\python30\python.exe test.py
Data0 is 0x2A, Data1 is 0x55 for closest_fit
Data0 is 0x2A, Data1 is 0xAA for all_ulonglong
Failed

As you can see the second member Data1, should be 0xAA, however when
using c_ubyte types for members the value is not offset by one bit.

As you can see using c_ulonglong for all members avoids this issue,
however this results in a read only structure (see Issue 6068).

I am using structures to cast CAN messages which are 8 bytes, with very
funky bit fields crossing all sorts of byte boundaries, so I essentially
expected that ctypes would provide a method for an arbitrary bit field
definition for use within python.  Hopefully this is just my bad ctypes
driving, or a simple fix.

--
assignee: theller
components: ctypes
messages: 88111
nosy: higstar, theller
severity: normal
status: open
title: casting error from ctypes array to structure
versions: Python 2.5, 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



[issue6068] c_ulonglong structure members appear read-only

2009-05-20 Thread higstar

Changes by higstar :


--
type: compile error -> 

___
Python tracker 

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



[issue6070] Pyhon 2.6 makes .pyc/.pyo bytecode files executable

2009-05-20 Thread Oleg Broytmann

New submission from Oleg Broytmann :

On compilation of .pyc/.pyo bytecode files on import Python 2.6 copies
Unix file access attributes (-rwx-) from the imported file. I'd think
it's ok except for executable (-x-) bit - bytecode files are not
directly executable. That is, for a module.py with attributes -rwxr-x---
I expect python2.6 -c 'import module' would produce module.pyc with
attributes -rw-r-.

python compileall.py . saves compiled files without the executable bit;
it doesn't copy attributes - it just saves files and saving obeys umask.
python2.5 -c 'import module.py' doesn't copy the executable bit, it
obeys umask too. I consider this as a regression in 2.6. Please mask out
executable bits on bytecode files saving.

--
components: Interpreter Core
messages: 88112
nosy: phd
severity: normal
status: open
title: Pyhon 2.6 makes .pyc/.pyo bytecode files executable
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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-05-20 Thread James Broadhead

James Broadhead  added the comment:

Has there been any progress on this since January? 


It is causing/affecting:
http://www.selenic.com/mercurial/bts/issue967

--
nosy: +jamesbroadhead

___
Python tracker 

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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-05-20 Thread Hans L

Hans L  added the comment:

These patches (well, the 2.6 patch) works for me.  If there's something
I can do to help get this accepted/applied, I'd be happy to do it.
Obviously, I had no part in these patches, but I can take a stab at
updating documentation or something if that is all that is needed.

--

___
Python tracker 

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



[issue941346] AIX shared library fix

2009-05-20 Thread Loris Bennett

Loris Bennett  added the comment:

Shouldn't line 170 be

   CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -Wl,-brtl
-Wl,-bnortllib -lm -o $objfile"

instead of

   CCOPT="$CCOPT -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -brtl -bnortllib -lm -o
$objfile"

Otherwise the -brtl and -bnortllib flags are interpreted as compiler
flags and errors like the following will occur:

   gcc: unrecognized option '-brtl'

--
nosy: +loris

___
Python tracker 

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



[issue941346] AIX shared library fix

2009-05-20 Thread Loris Bennett

Loris Bennett  added the comment:

Addition to last message:

More importantly, without "-Wl", the flags are not passed to the linker
and the tcl/tk libs will not be found.

--

___
Python tracker 

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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-05-20 Thread Facundo Batista

Facundo Batista  added the comment:

Hans, please take a look to my comment 79573 in this same bug. If you
could do that, it'd be amazing...

Thank you!

--

___
Python tracker 

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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-05-20 Thread Hans Lellelid

Hans Lellelid  added the comment:

Sure -- I will tackle that this week; I hope I can come up with
something satisfactory.  As I have not provided doc patches before for
Python I may need to spin up a bit on that (and of course on the exact
meaning of the set_tunnel method in this context) -- but I'm happy to help!

--

___
Python tracker 

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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-05-20 Thread Senthil

Senthil  added the comment:

Sorry for the delay. I know that patches work and I had tested them as
well. I shall push those patches to trunk/p3k within this week.

--

___
Python tracker 

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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-05-20 Thread Senthil

Senthil  added the comment:

> Facundo Batista  added the comment:
> 
> Hans, please take a look to my comment 79573 in this same bug. If you
> could do that, it'd be amazing...

Oops, had missed that one.. Shall update the patch, Facundo.

--

___
Python tracker 

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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-05-20 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

reassigning to the volunteer to get this in :)

--
assignee: facundobatista -> orsenthil

___
Python tracker 

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



[issue6072] unittest.TestCase._result is very likely to collide (and break) with application-defined TestCase attributes

2009-05-20 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee:  -> michael.foord
nosy: +michael.foord

___
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-05-20 Thread ivank

Changes by ivank :


--
nosy: +ivank

___
Python tracker 

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



[issue5767] xmlrpclib loads invalid documents

2009-05-20 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

Here's a patch which removes sgmlop support from xmlrpclib.

--
keywords: +patch
Added file: http://bugs.python.org/file14023/xmlrpclib.patch

___
Python tracker 

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



[issue5982] classmethod, staticmethod: expose wrapped function

2009-05-20 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> amaury.forgeotdarc
resolution:  -> accepted

___
Python tracker 

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



[issue6055] References to "pysqlite" in documentation of sqlite3 should be changed.

2009-05-20 Thread Georg Brandl

Georg Brandl  added the comment:

pysqlite is an alias of sqlite3; it's developed outside of the core
under that name.  I agree that this can be confusing, and I've now
removed almost all mentions (and qualified the remaining one) in r72801.

I will not touch occurrences in source code; this will make syncing with
pysqlite unnecessarily hard.

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



[issue6057] sqlite3 error classes should be documented

2009-05-20 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee: georg.brandl -> ghaering
nosy: +ghaering

___
Python tracker 

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



[issue6051] smtplib docs should link to email module examples

2009-05-20 Thread Georg Brandl

Georg Brandl  added the comment:

Added a note and a reference in r72802.

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



[issue6072] unittest.TestCase._result is very likely to collide (and break) with application-defined TestCase attributes

2009-05-20 Thread ivank

Changes by ivank :


--
nosy: +ivank

___
Python tracker 

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



[issue6072] unittest.TestCase._result is very likely to collide (and break) with application-defined TestCase attributes

2009-05-20 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone :

r72219 introduced an `_result´ attribute to `TestCase´.  As `TestCase´
is designed specifically with the intent that applications should
subclass it -- and frequently -- I would suggest that the attribute be
given a name less likely to collide with a name chosen by application
code.  Given the huge quantity of `TestCase´ subclasses, it will likely
be a great time saver to address the collision in CPython rather than in
each application.

--
components: Library (Lib)
messages: 88124
nosy: exarkun
severity: normal
status: open
title: unittest.TestCase._result is very likely to collide (and break) with 
application-defined TestCase attributes
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue5485] pyexpat has no unit tests for UseForeignDTD functionality

2009-05-20 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

Here's a new patch which adds SetParamEntityParsing to the pyexpat
library docs and adds another test for external entity reference
handling.  This is probably all I'll do on this ticket.

--
Added file: http://bugs.python.org/file14024/pyexpat.patch

___
Python tracker 

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



[issue6072] unittest.TestCase._result is very likely to collide (and break) with application-defined TestCase attributes

2009-05-20 Thread Michael Foord

Michael Foord  added the comment:

Patch is fine. I'll apply shortly. There was a specific use case for
being able to call doCleanups directly which was why the results object
needed to be stored.

--

___
Python tracker 

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



[issue1711603] logging

2009-05-20 Thread David Andrzejewski

Changes by David Andrzejewski :


--
title: syslog syscall support for SysLogLogger -> logging
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



[issue5829] float('1e500') -> inf, complex('1e500') -> ValueError

2009-05-20 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks, Eric.  Committed in r72803;  backported to trunk in r72805.

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



[issue1711603] syslog syscall support for SysLogLogger -> logging

2009-05-20 Thread David Andrzejewski

Changes by David Andrzejewski :


--
title: logging -> syslog syscall support for SysLogLogger -> logging
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



[issue1711603] syslog syscall support for SysLogLogger

2009-05-20 Thread David Andrzejewski

Changes by David Andrzejewski :


--
title: syslog syscall support for SysLogLogger -> logging -> syslog syscall 
support for SysLogLogger

___
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-05-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

That's probably because hashlib switched to using the new buffer API,
and array.array() only supports the old one in 2.x.

Perhaps hashlib should have some fallback code for such legacy types...

--
nosy: +pitrou
priority:  -> high
stage:  -> needs 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-05-20 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone :

It used to be possible to use hashlib with arrays; it no longer seems
possible.

exar...@charm:~$ python -c '
import sys, hashlib, array
print sys.version_info
print hashlib.sha1(array.array("b", [1, 2, 3])).hexdigest()
'
(2, 5, 2, 'final', 0)
7037807198c22a7d2b0807371d763779a84fdfcf
exar...@charm:~$ ~/Projects/python/trunk/python -c '
import sys, hashlib, array
print sys.version_info
print hashlib.sha1(array.array("b", [1, 2, 3])).hexdigest()
'
sys.version_info(major=2, minor=7, micro=0, releaselevel='alpha', serial=0)
Traceback (most recent call last):
  File "", line 4, in 
TypeError: object supporting the buffer API required
exar...@charm:~$

--
components: Library (Lib)
messages: 88122
nosy: exarkun
severity: normal
status: open
title: no longer possible to hash arrays
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue1689458] pdb unable to jump to first statement

2009-05-20 Thread Jeffrey Yasskin

Jeffrey Yasskin  added the comment:

Fixed in r72796. Will forward-port to py3k shortly.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue6064] Add "daemon" argument to threading.Thread constructor

2009-05-20 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
keywords: +easy

___
Python tracker 

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



[issue6066] POP_MARK was not in pickle protocol 0

2009-05-20 Thread Collin Winter

Collin Winter  added the comment:

Applied in r72792 (trunk), r72793 (py3k), r72808 (release26-maint).

--
assignee:  -> collinwinter
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



[issue6072] unittest.TestCase._result is very likely to collide (and break) with application-defined TestCase attributes

2009-05-20 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

Here's a patch which renames `_result´ to `_resultForDoCleanups´. 
Another possibility would be for `doCleanups´ to take the result object
as an argument.  This would make it harder for applications to call
directly, though (I've never wanted to run cleanups early, though).

--
keywords: +patch
Added file: http://bugs.python.org/file14022/rename-results.patch

___
Python tracker 

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



[issue1689458] pdb unable to jump to first statement

2009-05-20 Thread Jeffrey Yasskin

Jeffrey Yasskin  added the comment:

Merged to py3k in r72809.

--
status: open -> closed
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



[issue4547] Long jumps with frame_setlineno

2009-05-20 Thread Georg Brandl

Georg Brandl  added the comment:

I think you can apply this.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue6029] FAIL: test_longdouble (ctypes.test.test_callbacks.Callbacks) [SPARC/64-bit]

2009-05-20 Thread Clifford W Johnson

Clifford W Johnson  added the comment:

The following script (based on an extract of test_callbacks.py)
demonstrates the problem.  When run on a Sparc-based Solaris 10
platform, the output shows correct operation only when the c_longdouble
arguments appear first in the function call -- the use of other types
would seem to throw off argument alignment.

Could this be an issue with libffi?

#!/bin/env python

import sys
from ctypes import *


class Callback:
functype = CFUNCTYPE

def callback(self, *args):
self.got_args = args
return args[-1]

def check_type(self, typ, arg):
print "typ=%s" % (typ,)

print "Trying (typ) ..."
PROTO = self.functype.im_func(typ, typ)
result = PROTO(self.callback)(arg)
print "%s result=%s; got_args=%r" % ("*FAILED*" if result !=
3.14 else "WORKED", result, self.got_args)

print "Trying (c_byte, typ) ..."
PROTO = self.functype.im_func(typ, c_byte, typ)
result = PROTO(self.callback)(-3, arg)
print "%s result=%s; got_args=%r" % ("*FAILED*" if result !=
3.14 else "WORKED", result, self.got_args)

print "Trying (typ, c_byte) ..."
PROTO = self.functype.im_func(typ, typ, c_byte)
result = PROTO(self.callback)(arg, -3)
print "%s result=%s; got_args=%r" % ("*FAILED*" if result !=
3.14 else "WORKED", result, self.got_args)

print "Trying (c_byte, typ, typ) ..."
PROTO = self.functype.im_func(typ, c_byte, typ, typ)
result = PROTO(self.callback)(-3, arg, arg)
print "%s result=%s; got_args=%r" % ("*FAILED*" if result !=
3.14 else "WORKED", result, self.got_args)

print "Trying (typ, typ) ..."
PROTO = self.functype.im_func(typ, typ, typ)
result = PROTO(self.callback)(arg, arg)
print "%s result=%s; got_args=%r" % ("*FAILED*" if result !=
3.14 else "WORKED", result, self.got_args)

print "Trying (c_double, typ) ..."
PROTO = self.functype.im_func(typ, c_double, typ)
result = PROTO(self.callback)(arg, arg)
print "%s result=%s; got_args=%r" % ("*FAILED*" if result !=
3.14 else "WORKED", result, self.got_args)

print "trying (c_int, typ) ..."
PROTO = self.functype.im_func(typ, c_int, typ)
result = PROTO(self.callback)(-3, arg)
print "%s result=%s; got_args=%r" % ("*FAILED*" if result !=
3.14 else "WORKED", result, self.got_args)

print "trying (c_long, typ) ..."
PROTO = self.functype.im_func(typ, c_long, typ)
result = PROTO(self.callback)(-3, arg)
print "%s result=%s; got_args=%r" % ("*FAILED*" if result !=
3.14 else "WORKED", result, self.got_args)

print "trying (c_longlong, typ) ..."
PROTO = self.functype.im_func(typ, c_longlong, typ)
result = PROTO(self.callback)(-3, arg)
print "%s result=%s; got_args=%r" % ("*FAILED*" if result !=
3.14 else "WORKED", result, self.got_args)

callback = Callback()
callback.check_type(c_longdouble, 3.14)
# callback.check_type(c_longdouble, -3.14)


> ./python ~/tryLongDouble.py
typ=
Trying (typ) ...
WORKED result=3.14; got_args=(3.1401,)
Trying (c_byte, typ) ...
*FAILED* result=0.0; got_args=(-3, 0.0)
Trying (typ, c_byte) ...
*FAILED* result=-3.0; got_args=(3.1401, -3)
Trying (c_byte, typ, typ) ...
*FAILED* result=-inf; got_args=(-3, nan, -inf)
Trying (typ, typ) ...
WORKED result=3.14; got_args=(3.1401, 3.1401)
Trying (c_double, typ) ...
*FAILED* result=0.0; got_args=(3.1401, 0.0)
trying (c_int, typ) ...
*FAILED* result=0.0; got_args=(-3, 0.0)
trying (c_long, typ) ...
*FAILED* result=0.0; got_args=(-3, 0.0)
trying (c_longlong, typ) ...
*FAILED* result=0.0; got_args=(-3, 0.0)

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



[issue6073] threading.Timer and gtk.main are not compatible

2009-05-20 Thread Eric Atienza

New submission from Eric Atienza :

this simple code:
"
import gtk
from threading import Timer
from time import sleep

def p():
print "p"

Timer(1, p).start()

#gtk.main()
sleep(10)
print "done"
does print "p" a second after it starts.
when I remove the comment of the gtk.main() line: the "p" is never printed.

It is very exposed, as Timer is a common tool to build a GUI therefore
with the gtk.main() loop active.

--
components: Library (Lib)
messages: 88137
nosy: atienza
severity: normal
status: open
title: threading.Timer and gtk.main are not compatible
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



[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

2009-05-20 Thread Peter Simanyi

New submission from Peter Simanyi :

Some source code control tools, like Perforce, by default sync files readonly, 
and it's useful to 
leave them readonly so that you can mark files changed by making them writeable 
even if they're not 
checked out (e.g. working offline).

When python implicitly compiles a .py file that's readonly, it will create a 
.pyc file that's 
readonly. This would be fine, except that when the .py file changes, python 
*silently* refuses to 
overwrite a .pyc file that's readonly, even if the directory is completely 
writable by the user 
executing Python.

The attached script shows this behavior. Running "python -v" will produce the 
following line 
showing this:

  import b # from c:\Documents and Settings\psimanyi\tmp\b.py
  # can't create c:\Documents and Settings\psimanyi\tmp\b.pyc

And because I hoped this was a Windows-only problem, I tested on OSX (Leopard) 
and Ubuntu (9.10 
alpha): it occurs on all three platforms.

Thanks!



I fixed showpycreadonly.sh after attaching it, so to be sure you have the 
current version, it 
follows:

rm -f [ab].py{,c}

echo 'import b' > a.py
echo 'print "b"' > b.py
ls -l b.py
python a.py
ls -l b.pyc
rm b.pyc
chmod -w b.py
python a.py
ls -l b.pyc
touch b.py
python -v a.py 2>&1 | grep b.py

--
components: Interpreter Core
files: showpycreadonly.sh
messages: 88138
nosy: pdsimanyi
severity: normal
status: open
title: .pyc files created readonly if .py file is readonly, python won't 
overwrite
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file14025/showpycreadonly.sh

___
Python tracker 

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



[issue6075] Patch for IDLE/OS X to work with Tk-Cocoa

2009-05-20 Thread Kevin Walzer

New submission from Kevin Walzer :

In version 8.6 of Tk (now in beta stage), Tk on OS X will be built on top 
of the Cocoa API, replacing the deprecated Carbon API. Tk-Cocoa implements 
some UI behaviors (help menu, application menu) differently than Tk-
Carbon. The attached files patch IDLE to detect whether Tk is built on top 
of Cocoa or Carbon, and implement the correct UI behavior.

--
components: IDLE
files: EditorWindow.patch
keywords: patch
messages: 88139
nosy: wordtech
severity: normal
status: open
title: Patch for IDLE/OS X to work with Tk-Cocoa
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file14026/EditorWindow.patch

___
Python tracker 

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



[issue6075] Patch for IDLE/OS X to work with Tk-Cocoa

2009-05-20 Thread Kevin Walzer

Changes by Kevin Walzer :


Added file: http://bugs.python.org/file14027/Bindings.patch

___
Python tracker 

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



[issue6075] Patch for IDLE/OS X to work with Tk-Cocoa

2009-05-20 Thread Kevin Walzer

Changes by Kevin Walzer :


Added file: http://bugs.python.org/file14028/macosxSupport.patch

___
Python tracker 

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



[issue6075] Patch for IDLE/OS X to work with Tk-Cocoa

2009-05-20 Thread Kevin Walzer

Kevin Walzer  added the comment:

These patches were tested on Python/IDLE 2.6.2 and Tk version 8.5.7. My 
build of Tk, which runs on top of Cocoa, is based on a fork of Tk hosted 
at http://github.com/das/tcltk/tree/de-carbon-8-5. Tk-Cocoa will become 
the main line for Mac OS X in Tk 8.6, now in beta. I have not tested these 
patches with a standard build of Tk-Carbon, but the patches default to the 
current IDLE behavior if Tk-Cocoa is not detected.

--

___
Python tracker 

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



[issue6064] Add "daemon" argument to threading.Thread constructor

2009-05-20 Thread Miki Tebeka

Miki Tebeka  added the comment:

Attaching a patch against trunk (at revision 72805).

--
keywords: +patch
Added file: http://bugs.python.org/file14029/threading.diff

___
Python tracker 

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



[issue6076] Missing title for configDialog.py

2009-05-20 Thread Kevin Walzer

New submission from Kevin Walzer :

The configDialog for IDLE in version 2.6.2 is missing a title in the 
window: this patch adds a "Preferences" title to the window.

--
components: IDLE
files: configDialog.patch
keywords: patch
messages: 88143
nosy: wordtech
severity: normal
status: open
title: Missing title for configDialog.py
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file14030/configDialog.patch

___
Python tracker 

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



[issue6068] c_ulonglong structure members appear read-only

2009-05-20 Thread higstar

higstar  added the comment:

Right...I've just found a caveat in section 16.15.1.12 of the html
documentation which means this should be a feature request:

"Bit fields are only possible for integer fields"

--
type:  -> feature request

___
Python tracker 

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



[issue6069] casting error from ctypes array to structure

2009-05-20 Thread higstar

higstar  added the comment:

After reading the documentation for ctypes (specifically "Bit fields are
only possible for integer fields" from section 16.15.1.12) I've updated
the test.

---
import ctypes
import time

class uint(ctypes.BigEndianStructure):
_pack_  = 1# aligned to 8 bits, not ctypes default of 32
_fields_= [
   ("Data0",   ctypes.c_uint, 31),
   ("Data1",   ctypes.c_uint, 32),
   ]

class ulonglong(ctypes.BigEndianStructure):
_pack_  = 1# aligned to 8 bits, not ctypes default of 32
_fields_= [
   ("Data0",   ctypes.c_ulonglong, 31),
   ("Data1",   ctypes.c_ulonglong, 32),
  ]

size_of_structures_in_bytes = 8

def castbytes(type):
buffer = (ctypes.c_byte * size_of_structures_in_bytes)()
for index in range(size_of_structures_in_bytes):
buffer[index] = 0x55
return ctypes.cast(ctypes.pointer(buffer),
ctypes.POINTER(type)).contents

def print_members(test):
print("Data0 is 0x%X, Data1 is 0x%X for %s"%(test.Data0, test.Data1,
test.__class__.__name__))

test_classes = [ uint, ulonglong]

Failed = False
tests = [castbytes(type) for type in test_classes]
for test in tests:
print_members(test)

if not tests[0].Data0 == tests[1].Data0 == 0x2AAA:
Failed = True
print("Data0 failed")
if not tests[0].Data1 == tests[1].Data1 == 0x:
Failed = True
print("Data1 failed")

if not Failed:
print("Passed")

--

___
Python tracker 

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



[issue6068] support read/write c_ulonglong type bitfield structures

2009-05-20 Thread higstar

Changes by higstar :


--
title: c_ulonglong structure members appear read-only -> support read/write 
c_ulonglong type bitfield structures

___
Python tracker 

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



[issue6075] Patch for IDLE/OS X to work with Tk-Cocoa

2009-05-20 Thread Kevin Walzer

Kevin Walzer  added the comment:

This updated patch of macosxSupport.py adds a fix that addresses the 
preferences dialog, see http://bugs.python.org/issue5232.

--
Added file: http://bugs.python.org/file14031/macosxSupport.patch

___
Python tracker 

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



[issue6075] Patch for IDLE/OS X to work with Tk-Cocoa

2009-05-20 Thread Kevin Walzer

Changes by Kevin Walzer :


Removed file: http://bugs.python.org/file14028/macosxSupport.patch

___
Python tracker 

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



[issue5232] Setting font from preference dialog in IDLE on OS X broken

2009-05-20 Thread Kevin Walzer

Kevin Walzer  added the comment:

Added Brad's snippet to macosxSupport.py: see http://bugs.python.org/issue6075

--
nosy: +wordtech

___
Python tracker 

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



[issue5232] Setting font from preference dialog in IDLE on OS X broken

2009-05-20 Thread Kurt B. Kaiser

Kurt B. Kaiser  added the comment:

Superceeded by 6075.

--
assignee:  -> kbk
nosy: +kbk
resolution:  -> later
status: open -> closed
superseder:  -> Patch for IDLE/OS X to work with Tk-Cocoa

___
Python tracker 

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



[issue6068] support read/write c_ulonglong type bitfield structures

2009-05-20 Thread higstar

higstar  added the comment:

I added the following to test_bitfields.py and got the results listed below:
def test_ulonglong_crossing_32_boundary(self):
class X(BigEndianStructure):
_fields_ = [("a", c_ulonglong, 16),
("b", c_ulonglong, 32),
("c", c_ulonglong, 16)]

x = X()
self.failUnlessEqual((x.a, x.b, x.c), (0, 0, 0))
x.a, x.b, x.c = 1, 1, 1
self.failUnlessEqual((x.a, x.b, x.c), (1, 1, 1))

==
FAIL: test_ulonglong_crossing_32_boundary (__main__.BitFieldTest)
--
Traceback (most recent call last):
  File "W:\ctypes\build\lib.win32-2.6\ctypes\test\test_bitfields.py",
line 98, in test_ulonglong_crossing_32_boundary
self.failUnlessEqual((x.a, x.b, x.c), (1, 1, 1))
AssertionError: (1L, 0L, 1L) != (1, 1, 1)

--
Ran 16 tests in 0.015s

FAILED (failures=1)

--

___
Python tracker 

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