[issue3047] string object's lstrip function

2008-06-06 Thread Jura

New submission from Jura <[EMAIL PROTECTED]>:

example from command line:

'_element_no_of_hsscch'.lstrip('_element_')
'o_of_hsscch'
'_element_o_of_hsscch'.lstrip('_element_')
'o_of_hsscch'

--
components: Interpreter Core
messages: 67748
nosy: jsostok
severity: normal
status: open
title: string object's lstrip function
type: behavior
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3048] getsizeof incorrect for Unicode strings

2008-06-06 Thread Martin v. Löwis

New submission from Martin v. Löwis <[EMAIL PROTECTED]>:

sys.getsizeof doesn't take the actual length of the Unicode string into
account:

py> sys.getsizeof(u"")
32
[31332 refs]
py> sys.getsizeof(u"1"*100)
32
[31332 refs]

--
assignee: schuppenies
messages: 67750
nosy: loewis, schuppenies
severity: normal
status: open
title: getsizeof incorrect for Unicode strings

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3046] Locking should be removed from the new buffer protocol

2008-06-06 Thread Stefan Behnel

Stefan Behnel <[EMAIL PROTECTED]> added the comment:

As a quick summary of the problems with the current PEP:

1) Many use cases will not require any locking at all, either because
they run single-threaded with a short-read/short-write pattern, or
because they do not write at all.

2) Write locks require exclusive access rights, but there isn't
currently a way to change an existing read lock into a write lock. This
means that to acquire a write lock, all consumers (including the
requester) must first release all read locks before a write lock can be
granted. Therefore, it is not necessary to have such a thing as a read
lock in the first place, as any read request essentially becomes a
read-lock from the POV of a write lock request. And for data integrity
reasons, some kind of write lock must always be applied when writing is
requested, regardless of requesting a lock or not.

3) The requirement in point 2) for releasing all locks before granting a
write lock necessitates short-read/short-write access, in which case
locking is of limited usefulness already.

4) More complex locking scenarios may also require special locking
semantics that are not currently handled by the proposed locking protocol.

The proposal is therefore to

a) remove the locking protocol all-together
b) leave it to application space how read/write locking should be
handled (if required at all).
c) leave it to providers how a request for a writable buffer should be
handled: by just granting it (thus jeopardising data integrity), by
applying a lock internally, or by copying buffers.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3047] string object's lstrip function

2008-06-06 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

What did you expect? Quoting from the docs,

"""The chars argument is not a prefix; rather, all combinations of its
values are stripped:

>>> 'www.example.com'.lstrip('cmowz.')
'example.com'
"""

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3049] Some 3k sizeof tests fail

2008-06-06 Thread Martin v. Löwis

New submission from Martin v. Löwis <[EMAIL PROTECTED]>:

When merging the sizeof changes to 3k, I had to disable a few tests,
marked with XXX. Can you please take a look at why precisely they broke,
and change them appropriately?

--
assignee: schuppenies
messages: 67752
nosy: loewis, schuppenies
severity: normal
status: open
title: Some 3k sizeof tests fail

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2997] PyNumberMethods has left-over fields in Py3

2008-06-06 Thread Stefan Behnel

Stefan Behnel <[EMAIL PROTECTED]> added the comment:

:) sorry, that's the problem when you don't have commit rights and leave
the changes in your local copy.

So this is still an open issue that should be fixed before beta1, thanks.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3046] Locking should be removed from the new buffer protocol

2008-06-06 Thread Stefan Behnel

Stefan Behnel <[EMAIL PROTECTED]> added the comment:

Here is a patch that removes all occurrences of the locking protocol
from the current py3k branch code base.

There are still some issues in memoryobject.c:

- there was an occurrence of PyBUF_SHADOW that might have to be handled

- memory_getbuf and memory_releasebuf must be reimplemented as it is no
longer allowed to call getbuffer/releasebuffer with a NULL pointer

Added file: http://bugs.python.org/file10534/buffer-no-locking.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3047] string object's lstrip function

2008-06-06 Thread Jura

Jura <[EMAIL PROTECTED]> added the comment:

print '_element_no_of_hsscch'.lstrip.__doc__
S.lstrip([chars]) -> string or unicode

Return a copy of the string S with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is unicode, S will be converted to unicode before stripping

Ok, I didn't understand it correctly, because i red only __doc__ from
which is not the functionality clear. I found a workaround for it...

Let's leave it closed.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-06-06 Thread Stefan Behnel

Stefan Behnel <[EMAIL PROTECTED]> added the comment:

While PyUnicode_AsStringAndSize() may be a better solution if the length
is required, PyUnicode_AsString is enough() when it is not required. So
I don't buy that argument. Since there are dedicated UTF-8 encoding
functions, both functions are pure convenience anyway.

Embedded \0 bytes can bite you, but that's completely unrelated to the
issue discussed here.

I wouldn't oppose renaming the function, but I don't see why it should go.

--
nosy: +scoder

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1798] Add ctypes calling convention that allows safe access of errno

2008-06-06 Thread Thomas Heller

Thomas Heller <[EMAIL PROTECTED]> added the comment:

A different patch but implementing the same functionality was now
committed as trunk rev 63977.

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3002] shutil.copyfile blocks indefinitely on named pipes

2008-06-06 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
priority:  -> critical
versions: +Python 3.0 -Python 2.3, Python 2.4

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3043] Recursion bug in deepcopy

2008-06-06 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3002] shutil.copyfile blocks indefinitely on named pipes

2008-06-06 Thread Ralf Schmitt

Ralf Schmitt <[EMAIL PROTECTED]> added the comment:

The open('fifo', 'rb') already blocks. One has to use os.fdopen with
O_NONBLOCK to prevent blocking.

fd=os.open('fifo', os.O_RDONLY | os.O_NONBLOCK)

and then use

stat.S_ISFIFO(os.fstat(fd).st_mode)

to check if this is a fifo.
Checking with os.stat before opening with open will result in a race
condition.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1798] Add ctypes calling convention that allows safe access of errno

2008-06-06 Thread Armin Rigo

Armin Rigo <[EMAIL PROTECTED]> added the comment:

> (Another note: the C-level errno and the TLS copy should also be
> synchronized when the C code invokes a Python callback.)

What I meant is what should occur when a pure Python function is used
as a callback.  At this point there is already some logic e.g. to
re-acquire the GIL if necessary.  Maybe it needs to grow logic to
optionally copy the C-level errno into the TLS variable at the start,
and at the end copy it back into the C-level errno at the end, for the
cases where the C code expects the callback to be able to set errno.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1798] Add ctypes calling convention that allows safe access of errno

2008-06-06 Thread Thomas Heller

Thomas Heller <[EMAIL PROTECTED]> added the comment:

>> (Another note: the C-level errno and the TLS copy should also be
>> synchronized when the C code invokes a Python callback.)
> 
> What I meant is what should occur when a pure Python function is used
> as a callback.  At this point there is already some logic e.g. to
> re-acquire the GIL if necessary.  Maybe it needs to grow logic to
> optionally copy the C-level errno into the TLS variable at the start,
> and at the end copy it back into the C-level errno at the end, for the
> cases where the C code expects the callback to be able to set errno.

I figured that out in the meantime and implemented it in this way.
See the code around line 295 in Modules/_ctypes/callbacks.c.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2997] PyNumberMethods has left-over fields in Py3

2008-06-06 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

Let me quote a comment from GvR about the similar issue1185:

"""
Can you redo the patch while keeping the slot *position* (though not the
name or type)?  The wasted space is minimal (4-8 bytes per type or class
object) and it means a lot for third party code if the positional struct
initialization never breaks due to insertion or removal of a slot. 
Since everyone has a zero here anyway, I propose to name the slot
nb_reserved and make its type int.
"""

OTOH, it's python 3.0, and we are allowed to break things...

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2997] PyNumberMethods has left-over fields in Py3

2008-06-06 Thread Stefan Behnel

Stefan Behnel <[EMAIL PROTECTED]> added the comment:

I would accept that if this had been done in all cases, but as I wrote
in my first comment, the previously existing slot "nb_divide", which
comes *before* the named ones, has already been removed, so there is no
way existing Py2 code can work unchanged in Py3, even if we leave the
three fields in.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3050] Implement PEP 371: multiprocessing module

2008-06-06 Thread Jesse Noller

New submission from Jesse Noller <[EMAIL PROTECTED]>:

This issue tracks the work pending for the inclusion of the pyprocessing 
module under the multiprocessing name for Python 2.6 and 3.0. If needed, 
additional tickets will be created for issues which will need to be 
addressed after initial inclusion.

Currently open:
- Redo all documentation to match ReST format of stdlib
- Update docs to reflect new PEP8 names
- Update all unit tests to be in Unittest format

Closed:
- Rename module API to be PEP8 compliant (roudkerk)
- Link csource libs into python-trunk build (jnoller)
- redo all local "." style imports to reflect the new namespace 
(jnoller)

--
components: Extension Modules
messages: 67763
nosy: jnoller, roudkerk
severity: normal
status: open
title: Implement PEP 371: multiprocessing module
type: feature request
versions: Python 2.6, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1185] py3k: Completely remove nb_coerce slot

2008-06-06 Thread Stefan Behnel

Stefan Behnel <[EMAIL PROTECTED]> added the comment:

As noted in issue2997, the nb_divide slot (4th field!) has already been
removed, so Py2 code has to be adapted anyway. I therefore recommend to
just remove all unused fields to get a clean struct for Py3.

--
nosy: +scoder

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3051] heapq change breaking compatibility

2008-06-06 Thread Thomas Herve

New submission from Thomas Herve <[EMAIL PROTECTED]>:

A recent change in heapq implements it in terms of less-than:
http://svn.python.org/view/python/trunk/Modules/_heapqmodule.c?rev=63827&r1=63675&r2=63827

Unfortunately, it breaks usage of heapq when a class only implements
__le__ and not __ge__ or __cmp__. This is done this way in Twisted:
http://twistedmatrix.com/trac/browser/trunk/twisted/internet/base.py#L159.

If not mandatory, it would be nice if this change was reverted or that a
backward compatible change was done instead.

--
components: Library (Lib)
messages: 67765
nosy: therve
severity: normal
status: open
title: heapq change breaking compatibility
versions: Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3050] Implement PEP 371: multiprocessing module

2008-06-06 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


--
dependencies: +Add PEP 8 compliant aliases to threading module, Thread local 
storage and PyGILState_* mucked up by os.fork()

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3049] Some 3k sizeof tests fail

2008-06-06 Thread Robert Schuppenies

Robert Schuppenies <[EMAIL PROTECTED]> added the comment:

Fixed in r63985.

--
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3050] Implement PEP 371: multiprocessing module

2008-06-06 Thread Alec Thomas

Changes by Alec Thomas <[EMAIL PROTECTED]>:


--
nosy: +alecthomas

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3051] heapq change breaking compatibility

2008-06-06 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3052] Mac Modules failing to compile

2008-06-06 Thread Benjamin Peterson

New submission from Benjamin Peterson <[EMAIL PROTECTED]>:

On Mac 10.4 PPC:

building 'MacOS' extension
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -I. -I/temp/python/trunk/./Include
-I/temp/python/trunk/./Mac/Include -I. -IInclude -I./Include
-I/usr/local/include -I/temp/python/trunk/Include -I/temp/python/trunk
-c /temp/python/trunk/Mac/Modules/MacOS.c -o
build/temp.macosx-10.3-ppc-2.6/temp/python/trunk/Mac/Modules/MacOS.o-Wno-deprecated-declarations
/temp/python/trunk/Mac/Modules/MacOS.c:44: error: parse error before
'Fsiorefnum'
/temp/python/trunk/Mac/Modules/MacOS.c:44: warning: no semicolon at end
of struct or union
/temp/python/trunk/Mac/Modules/MacOS.c:46: error: parse error before '}'
token
/temp/python/trunk/Mac/Modules/MacOS.c:46: warning: type defaults to
'int' in declaration of 'rfobject'
/temp/python/trunk/Mac/Modules/MacOS.c:46: warning: data definition has
no type or storage class
/temp/python/trunk/Mac/Modules/MacOS.c:55: error: parse error before '*'
token
/temp/python/trunk/Mac/Modules/MacOS.c:56: warning: function declaration
isn't a prototype
/temp/python/trunk/Mac/Modules/MacOS.c: In function 'do_close':
/temp/python/trunk/Mac/Modules/MacOS.c:57: error: 'self' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c:57: error: (Each undeclared
identifier is reported only once
/temp/python/trunk/Mac/Modules/MacOS.c:57: error: for each function it
appears in.)
/temp/python/trunk/Mac/Modules/MacOS.c: At top level:
/temp/python/trunk/Mac/Modules/MacOS.c:67: error: parse error before '*'
token
/temp/python/trunk/Mac/Modules/MacOS.c:68: warning: function declaration
isn't a prototype
/temp/python/trunk/Mac/Modules/MacOS.c: In function 'rf_read':
/temp/python/trunk/Mac/Modules/MacOS.c:74: error: 'self' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c:79: error: 'args' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c:88: warning: implicit declaration
of function 'PyMac_Error'
/temp/python/trunk/Mac/Modules/MacOS.c: At top level:
/temp/python/trunk/Mac/Modules/MacOS.c:102: error: parse error before
'*' token
/temp/python/trunk/Mac/Modules/MacOS.c:103: warning: function
declaration isn't a prototype
/temp/python/trunk/Mac/Modules/MacOS.c: In function 'rf_write':
/temp/python/trunk/Mac/Modules/MacOS.c:108: error: 'self' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c:112: error: 'args' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c: At top level:
/temp/python/trunk/Mac/Modules/MacOS.c:129: error: parse error before
'*' token
/temp/python/trunk/Mac/Modules/MacOS.c:130: warning: function
declaration isn't a prototype
/temp/python/trunk/Mac/Modules/MacOS.c: In function 'rf_seek':
/temp/python/trunk/Mac/Modules/MacOS.c:136: error: 'self' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c:140: error: 'args' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c: At top level:
/temp/python/trunk/Mac/Modules/MacOS.c:174: error: parse error before
'*' token
/temp/python/trunk/Mac/Modules/MacOS.c:175: warning: function
declaration isn't a prototype
/temp/python/trunk/Mac/Modules/MacOS.c: In function 'rf_tell':
/temp/python/trunk/Mac/Modules/MacOS.c:179: error: 'self' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c:183: error: 'args' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c: At top level:
/temp/python/trunk/Mac/Modules/MacOS.c:199: error: parse error before
'*' token
/temp/python/trunk/Mac/Modules/MacOS.c:200: warning: function
declaration isn't a prototype
/temp/python/trunk/Mac/Modules/MacOS.c: In function 'rf_close':
/temp/python/trunk/Mac/Modules/MacOS.c:201: error: 'args' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c:203: error: 'self' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c: At top level:
/temp/python/trunk/Mac/Modules/MacOS.c:222: error: parse error before
'*' token
/temp/python/trunk/Mac/Modules/MacOS.c:224: warning: return type
defaults to 'int'
/temp/python/trunk/Mac/Modules/MacOS.c: In function 'newrfobject':
/temp/python/trunk/Mac/Modules/MacOS.c:225: error: 'self' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c:227: error: parse error before
')' token
/temp/python/trunk/Mac/Modules/MacOS.c: At top level:
/temp/python/trunk/Mac/Modules/MacOS.c:236: error: parse error before
'*' token
/temp/python/trunk/Mac/Modules/MacOS.c:237: warning: function
declaration isn't a prototype
/temp/python/trunk/Mac/Modules/MacOS.c: In function 'rf_dealloc':
/temp/python/trunk/Mac/Modules/MacOS.c:238: error: 'self' undeclared
(first use in this function)
/temp/python/trunk/Mac/Modules/MacOS.c: At top level:
/temp/python/trunk/Mac/Modules/MacOS.c:243: error: parse error before
'*' token
/temp/python/trunk/Mac/Modules/Ma

[issue2337] Backport oct() and hex() to use __index__

2008-06-06 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

This was rejected by Guido.

--
resolution:  -> rejected
status: pending -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3052] Mac Modules failing to compile

2008-06-06 Thread Ronald Oussoren

Ronald Oussoren <[EMAIL PROTECTED]> added the comment:

Is this on OSX 10.4?

I'll fix this tonight or tomorrow (the latter would probably result in a 
commit on sunday morning PST).

The fix will look like this:

#ifdef __LP64__
FSIORefNum fRefNum;
#else   
SInt16 fRefNum;
#endif


That is, unless I can find the correct way to detect if the code is 
compiled with the 10.5 SDK or not.

--
resolution:  -> accepted

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3052] Mac Modules failing to compile

2008-06-06 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

This is 10.4.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3053] test_shutil fails under AIX

2008-06-06 Thread Antoine Pitrou

New submission from Antoine Pitrou <[EMAIL PROTECTED]>:

test_shutil fails with the following error under some AIX 5.3 machine:

==
FAIL: test_on_error (__main__.TestShutil)
--
Traceback (most recent call last):
  File "Lib/test/test_shutil.py", line 35, in test_on_error
shutil.rmtree(TESTFN, onerror=self.check_args_to_onerror)
  File "/qakplus/qa_test/SandBoxes/Antoine/Python-2.5.2/Lib/shutil.py",
line 161, in rmtree
onerror(os.listdir, path, sys.exc_info())
  File "Lib/test/test_shutil.py", line 49, in check_args_to_onerror
self.assertEqual(func, os.remove)
AssertionError:  != 


The problem seems to be that the system is stricter with permissions
(please note I don't know AIX at all, and the filesystems are unknown
brands of network filesystems :-)), and @test in that test case is set
to chmod 0400:

$ chmod 400 @test
$ ./python -c "import os; print os.listdir('@test')"
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 13] Permission denied: '@test'
$ chmod 100 @test
$ ./python -c "import os; print os.listdir('@test')"
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 13] Permission denied: '@test'
$ chmod 500 @test
$ ./python -c "import os; print os.listdir('@test')"
['a']


The error was witnessed with Python 2.5.2 but the test case doesn't seem
to have changed in trunk so it should be the same there too.

--
components: Tests
messages: 67771
nosy: pitrou
severity: normal
status: open
title: test_shutil fails under AIX
versions: Python 2.5, Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3053] test_shutil fails under AIX

2008-06-06 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Here is a working patch.
I've also added a try/finally block, because otherwise the following
tests in regrtest.py couldn't run properly (@test was unremovable
because of wrong permissions).

--
keywords: +patch
Added file: http://bugs.python.org/file10535/3053.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3002] shutil.copyfile blocks indefinitely on named pipes

2008-06-06 Thread Ralf Schmitt

Ralf Schmitt <[EMAIL PROTECTED]> added the comment:

if the destination is a named pipe, it will also block (waiting for a
reader).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3053] test_shutil fails under AIX

2008-06-06 Thread Raghuram Devarakonda

Raghuram Devarakonda <[EMAIL PROTECTED]> added the comment:

Is there any particular reason to assert for failed function at all?
This test seems to be for 'onerror' function and the test would be valid
even without asserting whether the failed API is 'remove' or 'listdir'
etc. Isn't it?

--
nosy: +draghuram

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3026] mmap broken with large files on 64bit system

2008-06-06 Thread Ralf Schmitt

Ralf Schmitt <[EMAIL PROTECTED]> added the comment:

the same bug also occurs when computing the md5 of a string larger than
2**32

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3053] test_shutil fails under AIX

2008-06-06 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Apparently it dates back to this commit:
http://hg.pitrou.net/public/cpython/trunk/rev/56254b99fb78

Perhaps someone should ask the original author. But indeed I'm not sure
why it's testing such implementation details. The only requirement about
the first argument passed to the onerror callback is that it's one of
(os.listdir, os.remove, os.rmdir).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1785] "inspect" gets broken by some descriptors

2008-06-06 Thread Facundo Batista

Facundo Batista <[EMAIL PROTECTED]> added the comment:

Really don't know why this was assigned to me...

--
assignee: facundobatista -> 

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3046] Locking should be removed from the new buffer protocol

2008-06-06 Thread Travis Oliphant

Travis Oliphant <[EMAIL PROTECTED]> added the comment:

Greg Ewing's comment in the thread that read/write locking is orthogonal
to memory-buffer moving is to me the most convincing argument that the
locking portion of the getbuffer function call should be removed and
potentially placed in a separate API at some point.   This will simplify
the protocol a bit.  

I will apply the patch.

--
nosy: +teoliphant

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3051] heapq change breaking compatibility

2008-06-06 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

It would be better if the Twisted code changed to define all of the 
rich comparisons instead of relying on an accidental and erroneous 
implementation detail.  The heapq change because other people's code 
that used __lt__ was breaking.  They had some basis for the complaint 
because heapq is documented to match sort() which is also based on 
__lt__ (and so is the bisect module).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3051] heapq change breaking compatibility

2008-06-06 Thread Thomas Herve

Thomas Herve <[EMAIL PROTECTED]> added the comment:

Okay then. At least the issue is recorded somewhere, if someone has the
same problem.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3051] heapq change breaking compatibility

2008-06-06 Thread Jean-Paul Calderone

Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment:

The heapq documentation isn't very clear about its requirements.  It
does explicitly say that "Heaps are arrays for which heap[k] <=
heap[2*k+1] and heap[k] <= heap[2*k+2] for all k, counting elements from
zero." (this in the module reference for the heapq module, both in the
Python 2.5 version and the in-development version) which might lead one
to believe that <= (__le__) is the important operation.  I don't know
where it is documented that heapq behaves the same as sort().  I think
the documentation needs some improvement to avoid this kind of
confusion.  It's very hard, often impossible, to know what is an
"accidental and erroneous implementation detail" and what is a stable,
public API.

Also, I'm not sure why the code is being changed to accomodate newly
written applications which never could have worked, breaking existing
applications which did work, but I suppose that's just the decision
CPython developers want to make.

--
nosy: +exarkun

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3021] Lexical exception handlers

2008-06-06 Thread Adam Olsen

Adam Olsen <[EMAIL PROTECTED]> added the comment:

PEP 3134's implicit exception chaining (if accepted) would require your
semantic, and your semantic is simpler anyway (even if the
implementation is non-trivial), so consider my objections to be dropped.

PEP 3134 also proposes implicit chaining during a finally block, which
raises questions for this case:

try:
...
finally:
print(sys.exc_info())
raise

If sys.exc_info() were removed (with no direct replacement) we'd have
that behaviour answered.  raise could be answered by making it a syntax
error, but keep in mind this may be nested in another except block:

try:
...
except:
try:
...
finally:
raise

I'd prefer a syntax error in this case as well, to avoid any ambiguity
and to keep the implementation simple.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3051] heapq change breaking compatibility

2008-06-06 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

I'll fix this to accommodate both cases, __lt__ and __le__. After 
trying xx with x=x with x<=y, and may swap
the arguments of x==y and x!=y."  -- PEP 207

--
priority:  -> high

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3049] Some 3k sizeof tests fail

2008-06-06 Thread Martin v. Löwis

Changes by Martin v. Löwis <[EMAIL PROTECTED]>:


--
resolution:  -> fixed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3052] Mac Modules failing to compile

2008-06-06 Thread Ronald Oussoren

Ronald Oussoren <[EMAIL PROTECTED]> added the comment:

This should be fixed in revision 63997.

--
resolution: accepted -> fixed
status: open -> pending

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3054] test_disutils fails

2008-06-06 Thread Ronald Oussoren

New submission from Ronald Oussoren <[EMAIL PROTECTED]>:

test_distutils fails when you're not building in the root of the source 
tree.

That is:

  mkdir build
  cd build
  ../configure
  make
  make check

This fails like this:

test test_distutils failed -- Traceback (most recent call last):
  File "/Users/ronald/Projects/python/python-
trunk/Lib/distutils/tests/test_build_ext.py", line 23, in setUp
shutil.copy(xx_c, self.tmp_dir)
  File "/Users/ronald/Projects/python/python-trunk/Lib/shutil.py", line 
82, in copy
copyfile(src, dst)
  File "/Users/ronald/Projects/python/python-trunk/Lib/shutil.py", line 
46, in copyfile
fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: 
'/Users/ronald/Projects/python/python-trunk/build104/Modules/xxmodule.c'

--
components: Distutils
messages: 67785
nosy: ronaldoussoren
priority: high
severity: normal
status: open
title: test_disutils fails
versions: Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3055] test_list on 64-bit platforms

2008-06-06 Thread Ronald Oussoren

New submission from Ronald Oussoren <[EMAIL PROTECTED]>:

test_list, and possible other tests, use a lot of memory when Python is 
build in 64-bit mode. This causes heavy swapping when the machine doesn't 
have a huge amount of memory.

I've filed this bug because an OSX box with 3 GBytes of RAM gets 
completely unresponsive when trying to run test_list (due to heavy 
swapping).

--
components: Tests
messages: 67786
nosy: ronaldoussoren
priority: low
severity: normal
status: open
title: test_list on 64-bit platforms
type: resource usage
versions: Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1619130] 64-bit Universal Binary build broken

2008-06-06 Thread Ronald Oussoren

Ronald Oussoren <[EMAIL PROTECTED]> added the comment:

This should be fixed on the trunk, I've introduced a new configure option 
that makes it possible to build a 4-way universal build on OSX 10.5

Note that the default build will still be a 2-way universal build that 
runs on 10.3.9 and later.

--
resolution: accepted -> fixed
status: open -> pending
type:  -> feature request

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3054] test_disutils fails

2008-06-06 Thread Ronald Oussoren

Changes by Ronald Oussoren <[EMAIL PROTECTED]>:


--
components: +Tests -Distutils
type:  -> behavior

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3051] heapq change breaking compatibility

2008-06-06 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

Fixed in r63998.

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3021] Lexical exception handlers

2008-06-06 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

With or without my patch, bare "raise" inside a "finally" statement
raises a "RuntimeError: no active exception to re-raise". (except, of
course, when the try/finally is itself enclosed in an except block)
That's because a finally block is not considered an exception handler. I
don't think there's any reason to change this.

I'm not for adding syntax errors. After all the bare "raise" statement
just does the moral equivalent of re-raising sys.exc_info() verbatim. In
those situations where sys.exc_info() would return a non-empty result,
why shouldn't "raise" be accepted as well?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2065] trunk version does not compile with vs8 and vc6

2008-06-06 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10475/ocean.zip

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2065] trunk version does not compile with vs8 and vc6

2008-06-06 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file10536/ocean.zip

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3021] Lexical exception handlers

2008-06-06 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

(an unexpected side effect of my patch is that the interpreter has
become 5-10% faster under Linux, witnessed with pystone and pybench. I
don't know the explanation)

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2848] Remove mimetools usage from the stdlib

2008-06-06 Thread Humberto Diogenes

Changes by Humberto Diogenes <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file10537/email.parser-small_fix.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2848] Remove mimetools usage from the stdlib

2008-06-06 Thread Humberto Diogenes

Humberto Diogenes <[EMAIL PROTECTED]> added the comment:

Attached a patch to rename all calls to the mimetools-specific 
.getheader() to .get(), which works on both libraries (mimetools and 
email.Message). That eases transition without breaking any tests.

Added file: http://bugs.python.org/file10538/replace_getheaders_by_get.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3056] Simplify the Integral ABC

2008-06-06 Thread Raymond Hettinger

New submission from Raymond Hettinger <[EMAIL PROTECTED]>:

* Reduce Integral to just a single additional abstract method.
* Supply the binary operations as mixins instead of abstract methods.
* Three argument __pow__ is now optional.
* Convert with __int__ instead of __long__.

--
assignee: gvanrossum
components: Library (Lib)
files: numbers2.diff
keywords: patch
messages: 67792
nosy: gvanrossum, rhettinger
severity: normal
status: open
title: Simplify the Integral ABC
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file10539/numbers2.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3056] Simplify the Integral ABC

2008-06-06 Thread Raymond Hettinger

Changes by Raymond Hettinger <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file10540/pep2.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2848] Remove mimetools usage from the stdlib

2008-06-06 Thread Humberto Diogenes

Humberto Diogenes <[EMAIL PROTECTED]> added the comment:

As we're moving away from using .getheader() everywhere (file 10538), I 
think it's a good time to make HTTPResponse conform to PEP8 and define 
.get_header (with underscore) instead.

Added file: 
http://bugs.python.org/file10541/rename_HTTPResponse.getheaders.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2848] Remove mimetools usage from the stdlib

2008-06-06 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

-1 on the get_header() change.  I would like this patch to be as 
minimal as possible.  The new spelling is a bit awkward and it 
introduces an unnecessary change that could break code.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3021] Lexical exception handlers

2008-06-06 Thread Adam Olsen

Adam Olsen <[EMAIL PROTECTED]> added the comment:

PEP 3134 gives reason to change it.  __context__ should be set from
whatever exception is "active" from the try/finally, thus it should be
the inner block, not the outer except block.

This flipping of behaviour, and the general ambiguity, is why I suggest
a syntax error.  "In the face of ambiguity, refuse the temptation to guess."

PEP 3134 has not been officially accepted, but many parts have be added
anyway.  Your cleanups pave the way for the last of it.  I suggest
asking on python-3000 for a pronouncement on the PEP.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2912] let platform.uname try harder

2008-06-06 Thread James Thomas

James Thomas <[EMAIL PROTECTED]> added the comment:

I can work on this task.

--
nosy: +jjt009

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2848] Remove mimetools usage from the stdlib

2008-06-06 Thread Humberto Diogenes

Humberto Diogenes <[EMAIL PROTECTED]> added the comment:

Raymond, thanks for the parser solution! It worked -- just broke some 
tests because of the nature of FeedParser. While rfc822.Message can read 
the file and stop at some point in the middle (meaning that self.fp can 
still be read), FeedParser will always read the whole file *and* close 
it, even if setting _headersonly to True. This is the same problem that 
I had to work around on issue 2849. I'm attaching a patch that 
demonstrates it: lots of tests giving "I/O operation on closed file."

Right now I can think of two options:
 * Working around it, again (don't know how)
 * Implement some flag in FeedParser to make it consume only the headers 
and leave the file open.

Any other idea?

Oh, and if you think it's better not to mess with the name of other 
methods like getheader, that's fine by me. It was only a suggestion, 
after all. ;)

Added file: 
http://bugs.python.org/file10542/remove_mimetools_from_http.client.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2912] let platform.uname try harder

2008-06-06 Thread James Thomas

James Thomas <[EMAIL PROTECTED]> added the comment:

i'm looking at the source and there doesn't appear to be a function
uname within os.py. are we just considering the uname function in
platform.py?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2912] let platform.uname try harder

2008-06-06 Thread James Thomas

James Thomas <[EMAIL PROTECTED]> added the comment:

much handling code already seems to exist under the line
except AttributeError:
in platform.py (function uname(), lines 1101-1161 platform.py)
i'm not too familiar with the Python codebase (i just began developing
with Python a few days back)

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3021] Lexical exception handlers

2008-06-06 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Ok, it makes sense to have the same behaviour for except and finally
blocks then. As for the syntax error, I'm still not convinced. The point
of Py3k is to change semantics: people should expect some incompatible
changes. Also the previous behaviour was rather under-specified, so it
could be considered a bug. And it seems to me syntax errors should be
used to guard against potential syntax mistakes, not semantic subtleties.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3021] Lexical exception handlers

2008-06-06 Thread Adam Olsen

Adam Olsen <[EMAIL PROTECTED]> added the comment:

I agree, the argument for a syntax error is weak.  It's more instinct
than anything else.  I don't think I'd be able to convince you unless
Guido had the same instinct I do. ;)

___
Python tracker <[EMAIL PROTECTED]>

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