[issue4523] logging module __init__ uses has_key

2008-12-08 Thread Raymond Hettinger

Changes by Raymond Hettinger <[EMAIL PROTECTED]>:


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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4590] 2to3 strips trailing L for long iterals in two fixers

2008-12-08 Thread Armin Ronacher

New submission from Armin Ronacher <[EMAIL PROTECTED]>:

I noticed that fix_long and fix_numliterals both strip trailing Ls from
numbers.  That's redudant, one of them should be enough.

I attached a patch that removes the literal changing from the fix_long
fixer.  Because I'm not sure if that may be the correct fixer to modify
I didn't commit it but created an issue for review.

--
assignee: benjamin.peterson
components: 2to3 (2.x to 3.0 conversion tool)
files: remove_redundant.diff
keywords: needs review, patch
messages: 77296
nosy: aronacher, benjamin.peterson
priority: normal
severity: normal
stage: patch review
status: open
title: 2to3 strips trailing L for long iterals in two fixers
type: behavior
versions: 3rd party
Added file: http://bugs.python.org/file12277/remove_redundant.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-08 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

Update patch to include fix for unittest.py and test_unittest.py.

Added file: http://bugs.python.org/file12278/remove_cmp5.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3563] fix_idioms.py generates bad code

2008-12-08 Thread Armin Ronacher

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

I would drop the prefix in that case or attach it to the sorted() call.

So from this code:

x = foo()
# perform sorting
x.sort()

to

# perform sorting
x = sorted(foo())

Makes more sense than sticking it after the sorted() call like it
happens currently.  This should also fix the problem with outdented
statements such as except/finally.

--
nosy: +aronacher

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Amaury Forgeot d'Arc

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

Good catch. Here is a patch, with test.

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
priority:  -> normal
stage: needs patch -> patch review
Added file: http://bugs.python.org/file12280/with_badbool.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4577] distutils: -3 warnings (apply)

2008-12-08 Thread Amaury Forgeot d'Arc

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

Patch is good.

--
assignee:  -> amaury.forgeotdarc
nosy: +amaury.forgeotdarc
stage:  -> commit review

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4552] Doc/tools/sphinxext not included in the 2.6.1 tarball

2008-12-08 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

I don't want to *include* sphinx, jinja and docutils but *document*
which versions of sphinx, jinja and docutils are required to build the docs.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2734] 2to3 converts long(itude) argument to int

2008-12-08 Thread Armin Ronacher

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

This could probably be fixed by adding a `is_builtin` helper function to
the fixer_util module that checks if the name is not overriden in the
module.  I would use something like a weak dictionary for the
`find_binding` function because that could turn out to be quite expensive.

Besides long this is probably also useful for `reduce` and some others.

--
nosy: +aronacher

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4586] "Extending Embedded Python" documention uses removed Py_InitModule function

2008-12-08 Thread blake madden

blake madden <[EMAIL PROTECTED]> added the comment:

I am afraid that the webpage that I mentioned still uses
"Py_InitModule", I just checked.  How do I get embedding to work?  Thanks.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2356] fixer for sys.exitfunc -> atexit

2008-12-08 Thread Armin Ronacher

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

Since yesterday there is a handy little helper that adds imports to
files which is already used for the reduce() / intern() fixers.  This
makes this fix a lot easier.

I attached a version that does that.

However the import adder is not yet as sophisticated as the one in the
previous patch, but the utility method could be improved to better adapt
to existing styleguides.

--
nosy: +aronacher
Added file: http://bugs.python.org/file12279/fix_exitfunc.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4586] "Extending Embedded Python" documention uses removed Py_InitModule function

2008-12-08 Thread blake madden

blake madden <[EMAIL PROTECTED]> added the comment:

I took a look at the rst file in your comments and I tried that example
(which uses PyModule_Create), but I am sorry to say that it doesn't
work.  It says "no module named emb".  Are we sure that PyModule_Create
is all that needs to be called?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4591] uid/gid problem in os.chown

2008-12-08 Thread Sjoerd Mullender

New submission from Sjoerd Mullender <[EMAIL PROTECTED]>:

On Fedora 8 and 10 using Python 2.5.1 and 2.5.2 (64 bit):

$ grep nfsnobody /etc/passwd
nfsnobody:x:4294967294:4294967294:Anonymous NFS
User:/var/lib/nfs:/sbin/nologin

So the UID of nfsnobody is 4294967294 (-2 if viewed as signed 32-bit int).

>>> import pwd, os
>>> print pwd.getpwnam('nfsnobody').pw_uid
4294967294
>>> os.chown('some file', pwd.getpwnam('nfsnobody').pw_uid,
pwd.getpwnam('nfsnobody').pw_gid)
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: signed integer is greater than maximum

The reason for this error is that os.chown uses the "i" format to
convert the second and third arguments.  But the valued do not fit in a
32-bit signed integer.  uid_t and gid_t are defined as unsigned
quantities on this system.

The bug does not occur on 32 bit Fedora since there the uid and gid of
nfsnobody are 65534.

--
components: Library (Lib)
messages: 77301
nosy: sjoerd
severity: normal
status: open
title: uid/gid problem in os.chown
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



[issue4555] Smelly exports

2008-12-08 Thread Marc-Andre Lemburg

Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment:

For Python 2.x you cannot change the "main" function name of C
extensions, since this is used by the Python import mechanism.

--
nosy: +lemburg

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4579] .read() and .readline() differ in failing

2008-12-08 Thread Amaury Forgeot d'Arc

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

Python 2 is very platform-dependent: fdopen simply call the C function
fdopen() and returns a FILE*.
Since the sample code is a mistake (read on a file open in write mode),
how and when the error shows up really depends on the platform's
implementation of the FILE* object.

On the other hand Python 3 re-implemented all this, no FILE is used. The
io.UnsupportedOperation("BufferedWriter.read() not supported") is much
better IMO. And note that io.UnsupportedOperation is a IOError as well.

However the AttributeError is inconsistent. The attached patch turns it
into a UnsupportedOperation as above.

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
priority:  -> normal
versions:  -Python 2.4, Python 2.5
Added file: http://bugs.python.org/file12276/bad_readline.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4591] uid/gid problem in os.chown

2008-12-08 Thread Amaury Forgeot d'Arc

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

This was already corrected by r61540, and will be released with 2.5.3
and 2.6.2.

BUT -- fchown() was not modified. patch is similar to r61540, but I
don't know how to test:

Index: posixmodule.c
===
--- posixmodule.c   (revision 67068)
+++ posixmodule.c   (working copy)
@@ -1902,9 +1902,10 @@
 static PyObject *
 posix_fchown(PyObject *self, PyObject *args)
 {
-   int fd, uid, gid;
+   int fd;
+   long uid, gid;
int res;
-   if (!PyArg_ParseTuple(args, "iii:chown", &fd, &uid, &gid))
+   if (!PyArg_ParseTuple(args, "ill:fchown", &fd, &uid, &gid))
return NULL;
Py_BEGIN_ALLOW_THREADS
res = fchown(fd, (uid_t) uid, (gid_t) gid);

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
priority:  -> normal

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1167] gdbm/ndbm 1.8.1+ needs libgdbm_compat.so

2008-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto <[EMAIL PROTECTED]> added the comment:

Fixed in r67614. (issue4483)

--
nosy: +ocean-city
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



[issue4592] PyModule_Create doesn't work (or example is missing something)

2008-12-08 Thread blake madden

New submission from blake madden <[EMAIL PROTECTED]>:

Following an example of how to extend and embed that I found in patch
file r67655 (the website is out of date [issue4586]), PyModule_Create
appears to not work (or example is not complete).  When I run r67655
(attached also) I get an error saying that "emb" is not a module.

--
components: Extension Modules
files: python.cpp
messages: 77307
nosy: blakemadden
severity: normal
status: open
title: PyModule_Create doesn't work (or example is missing something)
versions: Python 3.0
Added file: http://bugs.python.org/file12281/python.cpp

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2899] Fixers find, rfind, etc in 'string' module

2008-12-08 Thread Armin Ronacher

Changes by Armin Ronacher <[EMAIL PROTECTED]>:


--
nosy: +aronacher

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2454] sha and md5 fixer

2008-12-08 Thread Armin Ronacher

Changes by Armin Ronacher <[EMAIL PROTECTED]>:


--
nosy: +aronacher

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2805] 2to3 doesn't correct divisions

2008-12-08 Thread Armin Ronacher

Changes by Armin Ronacher <[EMAIL PROTECTED]>:


--
nosy: +aronacher

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4585] Build failure on OS X 10.5.5: make: *** [sharedmods] Error 1

2008-12-08 Thread nelis

nelis <[EMAIL PROTECTED]> added the comment:

You asked how my locale looked, I've got:

10-92-86-47:Python-3.0 nelis$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

So I the LC_CTYPE is indeed UTF-8. I can also confirm that I can make if
I first run `export LC_CTYPE="nl_BE.UTF-8"' (the setting a friend of
mine has). I still get the following error, but I think it is unrelated
and I can ignore it and go on:

Failed to find the necessary bits to build these modules:
_gdbm  ossaudiodevreadline
spwd

Afterwards I have been playing around with internationalization a bit,
trying to change the LC_CTYPE. Changing it to "United States
(Computer)", or to "Belgium (Dutch)" changed the other locale settings
to nl_be.UTF-8 but not the LC_CTYPE. The problem might be in OSX, but it
is still strange that this makes building in python impossible.

--
nosy: +nelis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4336] Fix performance issues in xmlrpclib

2008-12-08 Thread Kristján Valur Jónsson

Kristján Valur Jónsson <[EMAIL PROTECTED]> added the comment:

Please consider applying this patch.  It moves the logic handling of 
non-string message_body inside of endheaders(), allowind clients of 
HTTPConnection to substitute endheader();send(data) with 
endheaders(data) without fear.

Added file: http://bugs.python.org/file12282/httplib.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4336] Fix performance issues in xmlrpclib

2008-12-08 Thread Kristján Valur Jónsson

Kristján Valur Jónsson <[EMAIL PROTECTED]> added the comment:

In light of my previous patch, here is a an improvement to urllib.py and 
logging that uses endheaders(body)

Added file: http://bugs.python.org/file12283/htmllibclients.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-08 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

I've created a new branch to work on the issue:
svn+ssh://[EMAIL PROTECTED]/python/branches/py3k-issue1717. It's
easier to work on a branch than exchanging monster patches.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4593] Documentation for multiprocessing - Pool.apply()

2008-12-08 Thread David M. Beazley

New submission from David M. Beazley <[EMAIL PROTECTED]>:

The documentation for the apply() and apply_async() methods of a Pool 
object might emphasize that these operations execute func(*args,**kwargs) 
in only one of the pool workers and that func() is not being executed in 
parallel on all workers.On first reading, I actually thought it might 
be the latter (and had to do some experimentation to figure out what was 
actually happening).

--
assignee: georg.brandl
components: Documentation
messages: 77312
nosy: beazley, georg.brandl
severity: normal
status: open
title: Documentation for multiprocessing - Pool.apply()
versions: Python 2.6, Python 2.7, 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



[issue4593] Documentation for multiprocessing - Pool.apply()

2008-12-08 Thread Christian Heimes

Changes by Christian Heimes <[EMAIL PROTECTED]>:


--
assignee: georg.brandl -> jnoller
keywords: +easy
nosy: +jnoller
priority:  -> normal
stage:  -> needs patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-08 Thread Marc-Andre Lemburg

Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment:

Please put the PyUnicode_Compare() API back in there.

Removing __cmp__ really doesn't have anything to do with removing often
used helper functions for comparing certain object types and only
cripples the C API in a needless way.

Thanks.

--
nosy: +lemburg

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4587] Need to rework the dbm lib/include selection process

2008-12-08 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

About my environment :
- one is linux :
  a) gdbm library, with header gdbm.h,  without *ndbm.h
  b) "Berkeley DB" many versions but the last is 4.4 I think
- other is cross and native(msys) mingw32 environment 
  only "Berkeley DB" 4.7

I will check later the patch but at first look is expected to fail. Lets
see 
http://svn.python.org/view/python/trunk/Modules/dbmmodule.c?rev=67614&view=auto

 . This module don't include gdbm.h header. I expect linux build to fail
with error "No ndbm.h available!"

I could test patch later when I get access to build environment.

Did you like I to test what is result (linux build) when header gdbm.h
is included in module ?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4594] Can't compile with -O3, on ARM, with gcc 3.4.4

2008-12-08 Thread John Stracke

New submission from John Stracke <[EMAIL PROTECTED]>:

I downloaded the source to Python 3.0 onto my Nokia N810, an ARM-based
Linux machine.  The native gcc is 3.4.4 (upgrading might be possible,
but would certainly be a pain).  I was able to build only by switching
from -O3 to -O2; -O3 caused a compiler crash.

Now, this isn't really Python's fault; gcc really shouldn't be crashing.
 However, it'd be nice if configure had a way to specify the
optimization level--I had to go in and edit the generated Makefile by
hand.  Better yet would be if configure could recognize the platform and
set the -O level accordingly.

--
components: Build
messages: 77315
nosy: metageek
severity: normal
status: open
title: Can't compile with -O3, on ARM, with gcc 3.4.4
versions: 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



[issue4593] Documentation for multiprocessing - Pool.apply()

2008-12-08 Thread Jesse Noller

Jesse Noller <[EMAIL PROTECTED]> added the comment:

Ah, I see what you're talking about David. Good catch. It wouldn't make 
sense to run the apply() in all of the workers, as apply() is a single 
function(...) call. map() however is done in parallel amongst all workers.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4585] Build failure on OS X 10.5.5: make: *** [sharedmods] Error 1

2008-12-08 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

Thanks for the information, nelis!

This appears to be a duplicate of issue 2173.  Further analysis should go 
there.

--
resolution:  -> duplicate
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



[issue3206] Multiprocessing Array and sharedctypes.Array error in docs/implementation

2008-12-08 Thread Jesse Noller

Changes by Jesse Noller <[EMAIL PROTECTED]>:


--
resolution:  -> duplicate
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



[issue2173] Python fails silently on bad locale

2008-12-08 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

See issue 4585, which appears to be the same problem.

--
nosy: +marketdickinson

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3206] Multiprocessing Array and sharedctypes.Array error in docs/implementation

2008-12-08 Thread Jesse Noller

Jesse Noller <[EMAIL PROTECTED]> added the comment:

Dupe, issue4449

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2899] Fixers find, rfind, etc in 'string' module

2008-12-08 Thread David W. Lambert

David W. Lambert <[EMAIL PROTECTED]> added the comment:

I expect the answer will be that 2to3 cannot know what sort of object
"string" names.  Bell's theorem, or some such, as I understand it, tells
us that you must execute the algorithm to find out what it does, there
isn't a short cut.

It does seem like 2to3 could assume that you write code with honorable
intention, grace, and style and thereby offer a suggestive note.  The
string module is not an isolated case for such notices.  I made a
similar request to yours for "file" which is gone in version 3.

Unfortunately, code as follows is probably frequent, so we aren't likely
to get support for this feature.  Maybe here is an opportunity for
venture capital!

def f(list):
'''
argument should be a list.
"list" in this scope no longer names __builtins__.list
'''

--
nosy: +LambertDW

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2173] Python fails silently on bad locale

2008-12-08 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

I think I've traced the 'no output' problem back to the device_encoding 
function in Modules/posixmodule.c.  The problem occurs when this function 
is called to try to get the encoding for stdout.

On my machine, if I do:

LC_CTYPE="UTF-8" ./python.exe

then the nl_langinfo call in device_encoding returns an empty string.  If 
I do

LC_CTYPE="bogus" ./python.exe

then it returns "US-ASCII"

and if I do

LC_CTYPE="en_US.UTF-8" ./python.exe

then it returns "UTF-8".

In the first case (where the encoding is set to ""), any subsequent 
attempts to send anything to stdout result in a LookupError with the 
message "unknown encoding".  But of course, since this exception message 
is itself sent to stdout (or possibly stderr?) the same problem occurs 
again and we just don't see any output.

I don't yet know why this causes the module build to fail, or why exit() 
doesn't work.

I think we should try to get this fixed before 3.0.1.  Any help would be 
welcomed.

--
priority: normal -> critical

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4592] PyModule_Create doesn't work (or example is missing something)

2008-12-08 Thread blake madden

blake madden <[EMAIL PROTECTED]> added the comment:

It seems that a call to "PyDict_SetItemString" is what is missing from
r67655:

PyObject* m = PyModule_Create(&EmbModule);
PyDict_SetItemString(PyImport_GetModuleDict(), EmbModule.m_name, m);

I am just guessing here though, don't know if this is correct way to do
things.

--
assignee:  -> georg.brandl
components: +Documentation -Extension Modules
nosy: +georg.brandl

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4592] Example patch is missing something

2008-12-08 Thread blake madden

Changes by blake madden <[EMAIL PROTECTED]>:


--
title: PyModule_Create doesn't work (or example is missing something) -> 
Example patch is missing something

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4595] new types example is out of date

2008-12-08 Thread blake madden

New submission from blake madden <[EMAIL PROTECTED]>:

http://docs.python.org/3.0/extending/newtypes.html

This example is using Py_InitModule3, is this function removed in Python 3?

--
assignee: georg.brandl
components: Documentation
messages: 77323
nosy: blakemadden, georg.brandl
severity: normal
status: open
title: new types example is out of date
versions: 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



[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Jeffrey Yasskin

Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment:

I think your patch leaks a reference to 'x'. Move the Py_DECREF(x) to
before "if (err < 0)"?

And then really nitpicky: your test has 3 blank lines after it, and
should have 2.

Otherwise looks great. Thanks for picking this up!

--
keywords:  -needs review
resolution:  -> accepted
stage: patch review -> commit review

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2173] Python fails silently on bad locale

2008-12-08 Thread Mark Dickinson

Changes by Mark Dickinson <[EMAIL PROTECTED]>:


--
nosy: +nelis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2173] Python fails silently on bad locale

2008-12-08 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

Could someone please try the attached patch and see if it solves the 
problem.

I'm not sure whether Facundo's problem is the same issue or not.

--
keywords: +patch
versions: +Python 3.1
Added file: http://bugs.python.org/file12284/issue2173.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4592] Example patch is missing something

2008-12-08 Thread Amaury Forgeot d'Arc

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

In python2.6, Py_InitModule4() calls PyImport_AddModule().
Why doesn't python3.0's PyModule_Create() do the same?

Index: Objects/moduleobject.c
===
--- Objects/moduleobject.c  (revision 67577)
+++ Objects/moduleobject.c  (working copy)
@@ -103,8 +103,9 @@
_Py_PackageContext = NULL;
}
}
-   if ((m = (PyModuleObject*)PyModule_New(name)) == NULL)
+   if ((m = (PyModuleObject*)PyImport_AddModule(name)) == NULL)
return NULL;
+   Py_INCREF(m);

if (module->m_size > 0) {
m->md_state = PyMem_MALLOC(module->m_size);

--
nosy: +amaury.forgeotdarc, loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4596] 2to3 does not fail as early as possible.

2008-12-08 Thread David W. Lambert

New submission from David W. Lambert <[EMAIL PROTECTED]>:

$ #rm -f file_that_is_not_here.py
$ 2to3 file_that_is_not_here.py


The program spends considerable time preparing itself only to discover
that it cannot open the file.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 77327
nosy: LambertDW
severity: normal
status: open
title: 2to3 does not fail as early as possible.
type: performance

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Amaury Forgeot d'Arc

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

Running the test with -R:: indeed shows the reference leak.
2nd patch with suggested corrections.

--
assignee: jyasskin -> amaury.forgeotdarc
Added file: http://bugs.python.org/file12285/with_badbool_2.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2899] Fixers find, rfind, etc in 'string' module

2008-12-08 Thread Armin Ronacher

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

2to3 could handle it, but it would be a lot of work for something
unnecessary.  You can use "s.replace(a, b)" instead of string.replace(s,
a, b) since at least 2.0.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3206] Multiprocessing Array and sharedctypes.Array error in docs/implementation

2008-12-08 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:


--
superseder:  -> AssertionError in Doc/includes/mp_benchmarks.py

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2899] Fixers find, rfind, etc in 'string' module

2008-12-08 Thread David W. Lambert

David W. Lambert <[EMAIL PROTECTED]> added the comment:

I think the point is to get a message from 2to3 about possible use of
feature that is gone.  Of course python3 raises an exception when trying
to execute the code, but it does leave the user wondering "why did 2to3
report that there are no changes necessary?".

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Jeffrey Yasskin

Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment:

Looks good. Thanks!

I assume this should be merged into the 2.6.x and 3.0.x branches?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4597] EvalFrameEx fails to set 'why' for some exceptions

2008-12-08 Thread Jeffrey Yasskin

New submission from Jeffrey Yasskin <[EMAIL PROTECTED]>:

Several opcodes that can raise an exception fail to set x, err, or why
afterward. This patch fixes all the examples I could find. I could only
figure out how to write a test for PRINT_NEWLINE; the others are hard to
trigger.

--
assignee: jyasskin
components: Interpreter Core
files: fix_exceptions.patch
keywords: needs review, patch
messages: 77332
nosy: jyasskin
priority: normal
severity: normal
stage: patch review
status: open
title: EvalFrameEx fails to set 'why' for some exceptions
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file12286/fix_exceptions.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4552] Doc/tools/sphinxext not included in the 2.6.1 tarball

2008-12-08 Thread Georg Brandl

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

Well, those which "make checkout" checks out :)

I set this up so that nobody needs to care about any additional packages
or dependencies, as long as svn is installed and working.

--
nosy: +georg.brandl

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4597] EvalFrameEx fails to set 'why' for some exceptions

2008-12-08 Thread Neal Norwitz

Neal Norwitz <[EMAIL PROTECTED]> added the comment:

The patch looks good.

These problems also apply to 2.5 I assume?  You might want to ping MvL
to let him know since he's about to cut that release.

--
keywords:  -needs review
nosy: +nnorwitz

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4597] EvalFrameEx fails to set 'why' for some exceptions

2008-12-08 Thread Jeffrey Yasskin

Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment:

Submitted as r67666. I'll ping Martin.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
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



[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Kevin Watters

Changes by Kevin Watters <[EMAIL PROTECTED]>:


--
nosy: +kevinwatters

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4593] Documentation for multiprocessing - Pool.apply()

2008-12-08 Thread David M. Beazley

David M. Beazley <[EMAIL PROTECTED]> added the comment:

Actually, you shouldn't discount the potential usefulness of running 
apply() in all of the worker nodes.  A lot of people coming from 
parallel programming know about things like global broadcasts, 
reductions, and so forth.  For example, if I wanted to perform a global 
operation (maybe some kind of configuration) on all workers, I could see 
doing some kind of global apply() operation to do it.  

That said, I'm not actually asking for any new functionality.   I'd just 
make it more clear that apply() is not performing a function call on all 
pool workers.

Also, given that apply() blocks, I'm not exactly sure how useful it is 
in the context of actually performing work in parallel.   You might want 
to emphasize that apply_async() is better suited for that (the only 
other way I could think of to take advantage of apply() in parallel 
would be to call it from separate threads in the process that created 
the pool).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4049] IDLE does not open too

2008-12-08 Thread Elizabeth Chang

Elizabeth Chang <[EMAIL PROTECTED]> added the comment:

I fixed this by copying the tcl8.4 and tk8.4 directories into 
Python25/Lib from Python25/tcl. This fixes it but it should work 
without having to do this. I start new ticket and reference this one.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4598] IDLE not opening

2008-12-08 Thread Elizabeth Chang

New submission from Elizabeth Chang <[EMAIL PROTECTED]>:

Fresh install, IDLE does not open. Cannot find tk tcl. Reference 
Issue4049. Problem reported in Python 2.5 and 3.0 on Windows.

--
messages: 77338
nosy: ec2929
severity: normal
status: open
title: IDLE not opening
versions: 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



[issue4049] IDLE does not open too

2008-12-08 Thread Elizabeth Chang

Elizabeth Chang <[EMAIL PROTECTED]> added the comment:

Issue 4598 created.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3210] subprocess.Popen does not release process handles if process cannot be started

2008-12-08 Thread Mark Mentovai

Mark Mentovai <[EMAIL PROTECTED]> added the comment:

This is not limited to Windows.  I experience this bug on Mac OS X and
Linux as well.

http://mail.python.org/pipermail/python-list/2008-August/505753.html

Attachment 3210.py is a reduced testcase.  It attempts to execute nocmd,
which should not exist.  The expected behavior is for OSError to be
thrown each time, with ENOENT or EACCES set in the errno field,
depending on the environment.  Due to this bug, Python will hit the file
descriptor limit at some point instead.

For quick reproduction, set a low but reasonable limit on the number of
maximum open files:

[EMAIL PROTECTED] bash$ ulimit -n 256
[EMAIL PROTECTED] bash$ python 3210.py
250
Traceback (most recent call last):
  File "3210.py", line 11, in 
raise e
OSError: [Errno 24] Too many open files

--
nosy: +markmentovai
Added file: http://bugs.python.org/file12287/3210.py

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4599] Strings undisplayable with repr

2008-12-08 Thread Michael Foord

New submission from Michael Foord <[EMAIL PROTECTED]>:

In Python 3 strings with non-ascii characters are undisplayable (even
with repr) in the default interactive interpreter on Windows and Mac.
Shouldn't the repr use escapes as with previous versions of Python?

Python 2.6
Python 2.6 (trunk:66714:66715M, Oct  1 2008, 18:36:04) 
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> d = u'\u20ac'
>>> d
u'\u20ac'

Python 3
Python 3.0 (r30:67503, Dec  6 2008, 21:14:27) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> d = '\u20ac'
>>> d
Traceback (most recent call last):
  File "", line 1, in 
  File
"/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/io.py",
line 1491, in write
b = encoder.encode(s)
  File
"/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/encodings/ascii.py",
line 22, in encode
return codecs.ascii_encode(input, self.errors)[0]
UnicodeEncodeError: 'ascii' codec can't encode character '\u20ac' in
position 1: ordinal not in range(128)
>>> repr(d)
Traceback (most recent call last):
  File "", line 1, in 
  File
"/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/io.py",
line 1491, in write
b = encoder.encode(s)
  File
"/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/encodings/ascii.py",
line 22, in encode
return codecs.ascii_encode(input, self.errors)[0]
UnicodeEncodeError: 'ascii' codec can't encode character '\u20ac' in
position 2: ordinal not in range(128)
>>>

--
components: Interpreter Core, Macintosh, Windows
messages: 77341
nosy: mfoord
severity: normal
status: open
title: Strings undisplayable with repr
versions: 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



[issue4587] Need to rework the dbm lib/include selection process

2008-12-08 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

I confirm my expectation:
in case 'elif cand == "gdbm":' the if statement for "gdbm.h" has to be
removed. This header don't provide dbm/ndbm compatible
structure/function names.
If setup is without 'if find_file("gdbm.h"...' statement dbm module is
build successfully and test_dbm pass.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4600] __class__ assignment: new-style? heap? == confusing

2008-12-08 Thread Terry J. Reedy

New submission from Terry J. Reedy <[EMAIL PROTECTED]>:

ob.__class__ = ob2
gives some confusing TypeError messages.

>>> c.__class__ = 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __class__ must be set to new-style class, not 'int' object

Problem: 'new-style' is obsolete in 3.0. It is also too inclusive...

>>> c.__class__ = object
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __class__ assignment: only for heap types

object *is* 'new-style'.  I presume 'heap type' means 'class defined by
class statement'.  If so, let us say so, since beginning programmers may
not know what a 'heap type' is.  If the above is incorrect, then this
experienced programmer also does not know what it means in Python
context ;-).

Proposal: when someone tries to set __class__ to an inappropriate
object, give similar error message for instances and heap classes.

TypeError: __class__ must be set to a class defined by a class
statement, not 'xxx' [object].

where 'object', without the brackets, is added for non-classes, as it is
today.

>>> c.__class__ = object
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __class__ assignment: only for heap types

C, the class of c, *is* a heap type.  The different problem, the target
being an instance of heap class, should get a different message.  'Heap'
is still possibly confusing. Proposal:

TypeError: __class__ assignment: only for instances of classes defined
by class statements.

--
components: Interpreter Core
messages: 77343
nosy: tjreedy
severity: normal
status: open
title: __class__ assignment: new-style? heap? == confusing
type: behavior
versions: 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



[issue4601] permissions errors with altinstall in 3.0

2008-12-08 Thread Leger

New submission from Leger <[EMAIL PROTECTED]>:

Under Debian/Lenny, with Python3.0.final install from the tarball, any
user can't import lib-dynload, launch IDLE ... but local root can do them.

When I login in root and run "chmod -R o+rx /usr/lib/python3.0/*", users
can use normaly python3.0.

Install detail : "configure --with-pydebug --with-doc-strings
--enable-shared --enable-profiling --enable-ipv6 --with-threads
--with-tsc --prefix=/usr ; make ; make test" and after "make altinstall
> altinstall.log 2>&1". I join altinstall.log.

--
components: Library (Lib)
files: altinstall.log
messages: 77344
nosy: legerf
severity: normal
status: open
title: permissions errors with altinstall in 3.0
type: resource usage
versions: Python 3.0
Added file: http://bugs.python.org/file12288/altinstall.log

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-08 Thread Marc-Andre Lemburg

Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment:

Instead of removing cmp(a, b) and replacing all uses with (a>b)-(b

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



[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

In order to reproduce the reported problem I had to conjure the attached 
repro.py which is missing '\n' on the last line.

I need to double check the language definition, but I feel this is not a 
bug because a file that ends with an unterminated line is not a well-
formed python program.

Added file: http://bugs.python.org/file12289/repro.py

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

According to my understanding of

http://docs.python.org/reference/lexical_analysis.html#id1

a newline character is required at the end of the python file.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4587] Need to rework the dbm lib/include selection process

2008-12-08 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

Roumen> I confirm my expectation:
Roumen> in case 'elif cand == "gdbm":' the if statement for "gdbm.h" has to 
be
Roumen> removed. This header don't provide dbm/ndbm compatible
Roumen> structure/function names.
Roumen> If setup is without 'if find_file("gdbm.h"...' statement dbm module 
is
Roumen> build successfully and test_dbm pass.

Right.  Dumb move on my part.  New patch attached.

Skip

Added file: http://bugs.python.org/file12290/setup.diff

___
Python tracker <[EMAIL PROTECTED]>

___Index: setup.py
===
--- setup.py(revision 67628)
+++ setup.py(working copy)
@@ -1010,39 +1010,63 @@
 
 # The standard Unix dbm module:
 if platform not in ['cygwin']:
-if find_file("ndbm.h", inc_dirs, []) is not None:
-# Some systems have -lndbm, others don't
-if self.compiler.find_library_file(lib_dirs, 'ndbm'):
-ndbm_libs = ['ndbm']
-else:
-ndbm_libs = []
-exts.append( Extension('dbm', ['dbmmodule.c'],
-   define_macros=[('HAVE_NDBM_H',None)],
-   libraries = ndbm_libs ) )
-elif self.compiler.find_library_file(lib_dirs, 'gdbm'):
-gdbm_libs = ['gdbm']
-if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'):
-gdbm_libs.append('gdbm_compat')
-if find_file("gdbm/ndbm.h", inc_dirs, []) is not None:
-exts.append( Extension(
-'dbm', ['dbmmodule.c'],
-define_macros=[('HAVE_GDBM_NDBM_H',None)],
-libraries = gdbm_libs ) )
-elif find_file("gdbm-ndbm.h", inc_dirs, []) is not None:
-exts.append( Extension(
-'dbm', ['dbmmodule.c'],
-define_macros=[('HAVE_GDBM_DASH_NDBM_H',None)],
-libraries = gdbm_libs ) )
-else:
-missing.append('dbm')
-elif db_incs is not None:
-exts.append( Extension('dbm', ['dbmmodule.c'],
-   library_dirs=dblib_dir,
-   runtime_library_dirs=dblib_dir,
-   include_dirs=db_incs,
-   define_macros=[('HAVE_BERKDB_H',None),
-  ('DB_DBM_HSEARCH',None)],
-   libraries=dblibs))
+dbm_order = os.environ.get("PYDBMLIBORDER",
+   "ndbm:gdbm:bdb").split(":")
+dbmext = None
+for cand in dbm_order:
+if cand == "ndbm":
+if find_file("ndbm.h", inc_dirs, []) is not None:
+# Some systems have -lndbm, others don't
+if self.compiler.find_library_file(lib_dirs, 'ndbm'):
+ndbm_libs = ['ndbm']
+else:
+ndbm_libs = []
+print "building dbm using ndbm"
+dbmext = Extension('dbm', ['dbmmodule.c'],
+   define_macros=[
+   ('HAVE_NDBM_H',None),
+   ],
+   libraries=ndbm_libs)
+break
+
+elif cand == "gdbm":
+if self.compiler.find_library_file(lib_dirs, 'gdbm'):
+gdbm_libs = ['gdbm']
+if self.compiler.find_library_file(lib_dirs, 
'gdbm_compat'):
+gdbm_libs.append('gdbm_compat')
+if find_file("gdbm/ndbm.h", inc_dirs, []) is not None:
+print "building dbm using gdbm"
+dbmext = Extension(
+'dbm', ['dbmmodule.c'],
+define_macros=[
+('HAVE_GDBM_NDBM_H', None),
+],
+libraries = gdbm_libs)
+break
+if find_file("gdbm-ndbm.h", inc_dirs, []) is not None:
+print "building dbm using gdbm"
+dbmext = Extension(
+'dbm', ['dbmmodule.c'],
+define_macros=[
+('HAVE_GDBM_DASH_NDBM_H', None),
+ 

[issue1717] Get rid of more refercenes to __cmp__

2008-12-08 Thread Guido van Rossum

Changes by Guido van Rossum <[EMAIL PROTECTED]>:


--
nosy:  -gvanrossum

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4587] Need to rework the dbm lib/include selection process

2008-12-08 Thread Skip Montanaro

Changes by Skip Montanaro <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file12275/setup.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4602] 2to3 drops executable bit with --write

2008-12-08 Thread Adeodato Simó

New submission from Adeodato Simó <[EMAIL PROTECTED]>:

Hello,

after using 2to3 --write over some scripts, I found it very cumbersome
having to run `chmod +x` on each of them afterwards.

The attached patch is a possible way to fix this issue. It'd be great 
if somebody could apply it, or write a more appropriate fix.

--
components: 2to3 (2.x to 3.0 conversion tool)
files: 2to3_preserve_mode.diff
keywords: patch
messages: 77349
nosy: dato
severity: normal
status: open
title: 2to3 drops executable bit with --write
versions: Python 3.0
Added file: http://bugs.python.org/file12291/2to3_preserve_mode.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4555] Smelly exports

2008-12-08 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

I guess you *could* change the name of extensions that become builtin
modules. However, I think it is not worth the trouble, especially since
PEP 3121 solves the problem for good, for Python 3.

I propose to simply filter out init[_a-z]+ from the set of "bad" symbols.

That leaves us with asdl_*_seq_new, and _add_one_to_index_; the latter
is already reported as issue3101.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4601] permissions errors with altinstall in 3.0

2008-12-08 Thread Leger

Leger <[EMAIL PROTECTED]> added the comment:

My root umask = 0027 (hardened system), so the altinstall/install script
don't manage umask parameter.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4602] 2to3 drops executable bit with --write

2008-12-08 Thread Adeodato Simó

Changes by Adeodato Simó <[EMAIL PROTECTED]>:


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



[issue4601] permissions errors with altinstall in 3.0

2008-12-08 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

I'm able to reproduce the bug with umask set to 0027:
drwxr-x--- 2 root root 3072 déc  8 22:59 
(...)/lib/python3.1/lib-dynload

With umask 0077, it's:
drwx-- 2 root root 3072 déc  8 22:59 
(...)/lib/python3.1/lib-dynload

The problem is specific to this directory.

--
nosy: +haypo

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3101] global function _add_one_to_index_C

2008-12-08 Thread Martin v. Löwis

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


--
title: global function _add_one_to_C -> global function _add_one_to_index_C

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3101] global function _add_one_to_index_C

2008-12-08 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

I think _add_one_to_index_C and _add_one_to_index_F should be renamed.
If they are meant to be called by non-core extension modules, their
names should start with Py_, else with _Py_.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4601] permissions errors with altinstall in 3.0

2008-12-08 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

install() method of the install_lib command 
(Lib/distutils/command/install_lib.py) calls self.copy_tree() which 
calls copy_tree() from Lib/distutils/dir_util.py. By default, this 
function preserve the modes (perserve_mode=1 by default). Or the build 
created a directory with permissions "drwx--".

I wrote that only lib-dynload directory has a problem. But other files 
are install with permissions -rw---:
 - .../lib/python?.?/*.{pyc,pyo}
 - .../lib/python?.?/lib2to3/PatternGrammar*.pickle
 - .../lib/python?.?/lib2to3/Grammar*.pickle
 - .../lib/python?.?/lib-dynload/Python*.egg-info

--
components: +Distutils -Library (Lib)
versions: +Python 2.6, Python 2.7, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4591] uid/gid problem in os.chown

2008-12-08 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

2^31-2 doesn't fit in long on 32 bits CPU. On my Linux box, uid_t is an 
unsigned integer (32 bits unsigned integer). Why not using "unsigned 
int"? chown prototype:

   int chown(const char *path, uid_t owner, gid_t group);

--
nosy: +haypo

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4601] permissions errors with altinstall in 3.0

2008-12-08 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

With Python trunk, the directory has the right permission (drwxr-xr-x) 
whereas build/lib.linux(...) has permission 
drwx--.

But the problem is still open for listed files 
(.pyc, .pyo, .picle, .egg-info).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4594] Can't compile with -O3, on ARM, with gcc 3.4.4

2008-12-08 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

> Now, this isn't really Python's fault; gcc really shouldn't be crashing.
>  However, it'd be nice if configure had a way to specify the
> optimization level--I had to go in and edit the generated Makefile by
> hand. 

Well, Python does have a way - the way you have been using.

However, as yet another way, you can set the OPT environment variable,
to define the optimization flags to be used (and other non-essential
compiler flags).

> Better yet would be if configure could recognize the platform and
> set the -O level accordingly.

I'm opposed. Selecting such a thing by platform and compiler version
is too transient to be maintainable. It would be different if the
platform would have been around for 10 years, and had seen no compiler
change for 8 years, but in this case, this likely is fixed before the
next Python release is even made. Please report this to the system
vendor.

--
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4597] EvalFrameEx fails to set 'why' for some exceptions

2008-12-08 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

This is fine to port to 2.5; please go ahead. Don't forget to add
Misc/NEWS entries, though - also add them for the branches you have
changed already.

--
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4598] IDLE not opening

2008-12-08 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

Do you have TCL_LIBRARY or TK_LIBRARY environment variables set?

This is a very obscure behavior - the installer is known to work on many
machines, including IDLE. So something must be particular with your
Windows installation.

--
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4603] 3.0 document tab interpretation change

2008-12-08 Thread Terry J. Reedy

New submission from Terry J. Reedy <[EMAIL PROTECTED]>:

In 2.6, Ref Manual / Lexical Analysis / Indentation says

"First, tabs are replaced (from left to right) by one to eight spaces
such that the total number of characters up to and including the
replacement is a multiple of eight (this is intended to be the same rule
as used by Unix). The total number of spaces preceding the first
non-blank character then determines the line’s indentation. "

and Using Python / Command line / Misc options says

"-t
Issue a warning when a source file mixes tabs and spaces for
indentation in a way that makes it depend on the worth of a tab
expressed in spaces. Issue an error when the option is given twice (-tt)."

Inyeol Lee, on c.l.p., in response to a report of a TabError, says "-tt
option in python 2.x is now default in python 3.0.
Apparently it got slipped from any documentation, including what's
new."

In 3.0 docs, the -t option *was* removed from Using Python, but the
Indentation sentences quoted above remain unchanged, though obsolete.  I
would guess that they should be replaced by something like

"When a source file mixes tabs and spaces for indentation in a way that
makes it depend on the worth of a tab expressed in spaces, a TabError is
raised." 

Perhaps What's New should get a sentence too.  "The former -tt startup
option to raise TabError on ambiguous mixtures of tabs and spaces for
indentation has been removed as an option and is now the standard behavior."

--
assignee: georg.brandl
components: Documentation
messages: 77360
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: 3.0 document tab interpretation change
versions: Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-08 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

Marc-Andre, how  do you like a function PyUnicode_Equal() instead of
PyUnicode_Compare()?

The old PyUnicode_Compare() function returns -1 for smaller value and
errors, 0 for equality and +1 for larger value. I find it confusing to
have one function that follows the old PyObject_Compare() behavior.

Instead I'm proposing PyUnicode_Equal() which returns -1 for errors, 0
for unequal and +1 for equal. The function follows the semantic of
http://docs.python.org/c-api/object.html#PyObject_RichCompareBool nicely.

About your proposal for cmp(), where should we put the method? I'm -0.5
on builtins.

___
Python tracker <[EMAIL PROTECTED]>

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



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

2008-12-08 Thread Forest Wilkinson

Changes by Forest Wilkinson <[EMAIL PROTECTED]>:


--
nosy: +forest

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4599] Strings undisplayable with repr

2008-12-08 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

This specific character shouldn't be undisplayable on Windows, not even
on your version of Windows. Instead, Python should find out how to
convert it to your terminal's encoding, rather than using ASCII.

It's a bug that the OSX port using ASCII; it probably should use UTF-8
by default for the terminal encoding.

In any case, it is *not* a bug that Python doesn't escape the character.
If you want it escaped, use the ascii() builtin function.

--
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3101] global function _add_one_to_index_C

2008-12-08 Thread Antoine Pitrou

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

I think they currently are private functions which happen to be used
accross two different C source files. So they should be renamed
_Py_something (or the situation should be fixed so that they can be made
static).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4601] directory permission error with make install in 3.0

2008-12-08 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

Gotcha! os.path.walk() was replaced by os.walk() but walk() argument is 
no more a callback because walk() is a generator! Here is a fix.

--
keywords: +patch
title: permissions errors with altinstall in 3.0 -> directory permission error 
with make install in 3.0
versions:  -Python 2.6, Python 2.7
Added file: http://bugs.python.org/file12292/setup_chmod.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4599] Strings undisplayable with repr

2008-12-08 Thread Michael Foord

Michael Foord <[EMAIL PROTECTED]> added the comment:

Hmmm... nope - my terminal encoding (according to Python) on WIndows
Vista x64 (with 32bit Python and a vanilla cmd) is cp850.

C:\compile>C:\Python30\python.exe
Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> '\u20ac'
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python30\lib\io.py", line 1491, in write
b = encoder.encode(s)
  File "C:\Python30\lib\encodings\cp850.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u20ac' in
position
1: character maps to 

Oh well. (The traceback I posted was from Max OS X 10.5 - I didn't dig
closely enough to see that a different encoding was being used on
Windows, my bad - and thanks for the tip about ascii() ).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4599] Strings undisplayable with repr

2008-12-08 Thread Michael Foord

Michael Foord <[EMAIL PROTECTED]> added the comment:

OK - and as a further follow up, the traceback I posted for Mac OS X was
from a terminal called iTerm. I tried the same thing on the standard
'Terminal' app and it prints the Euro symbol fine. Looks like iTerm is
an ascii terminal.

Sorry for the noise, I think this can be closed.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2008-12-08 Thread Antoine Pitrou

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

Here is patch, using the "small storage at the end of Py_buffer" idea.
It adds a lot of unit tests as well.

--
keywords: +needs review, patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file12293/issue4580.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3101] global function _add_one_to_index_C

2008-12-08 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

> I think they currently are private functions which happen to be used
> accross two different C source files. 

But see msg71879

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4558] with_stdc89

2008-12-08 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

Socket module need to be patched too otherwise test_socket fail on UNIX
domain socket tests.

After clean build and with new patch the regression tests results are:
337 tests OK.
3 tests failed:
test_curses test_urllib2_localnet test_urllibnet
21 tests skipped:
test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl
test_gl test_imgfile test_kqueue test_macos test_macostools
test_pep277 test_py3kwarn test_scriptpackages test_sqlite
test_startfile test_sunaudiodev test_unicode_file test_winreg
test_winsound test_zipfile64
Those skips are all expected on linux2.

Interesting for failed tests is that every succeed if run independently.

Added file: http://bugs.python.org/file12294/python-trunk-20081209-c89.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4558] with_stdc89

2008-12-08 Thread Roumen Petrov

Changes by Roumen Petrov <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file12253/python-trunk-20081206-c89.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4599] Strings undisplayable with repr

2008-12-08 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

> Hmmm... nope - my terminal encoding (according to Python) on WIndows
> Vista x64 (with 32bit Python and a vanilla cmd) is cp850.

Ah, ok. That doesn't have the euro sign, either. Try it in IDLE, though.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4599] Strings undisplayable with repr

2008-12-08 Thread Martin v. Löwis

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


--
resolution:  -> works for me
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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-08 Thread Antoine Pitrou

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

IMO PyUnicode_Compare() should be replaced by a hypothetical
PyObject_RichCompare(), which allows to take shortcuts when comparing
strings of different length and a Py_EQ or Py_NE comparison is requested.
(see #3106 too)

--
nosy: +pitrou

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1717] Get rid of more refercenes to __cmp__

2008-12-08 Thread Marc-Andre Lemburg

Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment:

On 2008-12-09 00:12, Christian Heimes wrote:
> Christian Heimes <[EMAIL PROTECTED]> added the comment:
> 
> Marc-Andre, how  do you like a function PyUnicode_Equal() instead of
> PyUnicode_Compare()?
> 
> The old PyUnicode_Compare() function returns -1 for smaller value and
> errors, 0 for equality and +1 for larger value. I find it confusing to
> have one function that follows the old PyObject_Compare() behavior.

For Unicode objects you don't have the issues with general rich
comparisons. Unicode objects only know <, = and >, so the C approach
of using -1, 0, +1 for these results will work just fine.

It doesn't in the general case, where comparisons can return arbitrary
objects.

> Instead I'm proposing PyUnicode_Equal() which returns -1 for errors, 0
> for unequal and +1 for equal. The function follows the semantic of
> http://docs.python.org/c-api/object.html#PyObject_RichCompareBool nicely.

Yes, but for sorting Unicode (in C) and other quick checks that rely on
lexical ordering you need checks for < and > as well.

It's better to have just one C API than 3 or 5 to cover all comparison
cases.

> About your proposal for cmp(), where should we put the method? I'm -0.5
> on builtins.

Good question.

It is in the builtins in Python 2.x, so keeping it there would make
porting easier, but then it's probably better to put it somewhere else
to make people aware of the fact that the underlying machinery has
changed.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2008-12-08 Thread Antoine Pitrou

Changes by Antoine Pitrou <[EMAIL PROTECTED]>:


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



[issue3101] global function _add_one_to_index_C

2008-12-08 Thread Antoine Pitrou

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

Well, then a proper API should be devised. Perhaps Travis can shed more
light on what he thinks would be useful.

___
Python tracker <[EMAIL PROTECTED]>

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



  1   2   >