[issue2507] Exception state lives too long in 3.0

2008-05-03 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
priority: critical -> release blocker

__
Tracker <[EMAIL PROTECTED]>

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



[issue2720] make compiling struct be passed around to all ast helpers

2008-05-03 Thread Georg Brandl

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

Sure, if it still compiles. :)

--
assignee: georg.brandl -> benjamin.peterson

__
Tracker <[EMAIL PROTECTED]>

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



[issue2158] confusing exception when opening a filename with nonprintable characters

2008-05-03 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

backported r61468 to release25-maint in r62659.

--
assignee:  -> gregory.p.smith
resolution:  -> fixed
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue2745] Add support for IsWow64Process

2008-05-03 Thread Martin v. Löwis

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

I think this can be just as well done with (untested, as I don't have
access to a Windows system right now)

def iswow64():
if platform.getarchitecture()[0] == '64-bit':return False
return os.environ["PROCESSOR_ARCHITECTURE"] != "x86"

IOW, it's wow64 iff it's a 32-bit Python not running on an x86 machine.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2740] Cmd module doesn't support readline completion on OSX Leopard

2008-05-03 Thread Ronald Oussoren

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

I don't really agree. Libedit's configuration is different from that of GN 
U readline. It might be useful to document this issue in the documentation 
of the readline module (and of rlcompleter).

Another alternative would be to add code to the readline module that 
emulates the GNU syntax when compeling using libedit, but I don't think 
that's worth the effort.

I would be willing to review such a patch though.

--
nosy: +ronaldoussoren

__
Tracker <[EMAIL PROTECTED]>

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



[issue2641] setuptools gets site-packages wrong on Mac

2008-05-03 Thread Ronald Oussoren

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

This is a bug in the mercurial installer. The problem is in the Makefile, 
not in setup.py.

Specially, the makefile calls "python setup.py --prefix=/usr/local". 
That's not the correct prefix with a framework install on MacOSX.

I propose closing this issue because it is not a bug in distutils.

BTW. Mercurial seems to work fine otherwise ('hg' and 'hg version' give 
output, I haven't tried to use it otherwise).

--
nosy: +ronaldoussoren
resolution:  -> invalid
status: open -> pending

__
Tracker <[EMAIL PROTECTED]>

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



[issue2663] shutil.copytree glob-style filtering [patch]

2008-05-03 Thread Tarek Ziadé

Tarek Ziadé <[EMAIL PROTECTED]> added the comment:

Right, thanks.

I have corrected the doc, and pushed some examples at the bottom of the
module documentation.

Added file: http://bugs.python.org/file10177/copytree.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2663] shutil.copytree glob-style filtering [patch]

2008-05-03 Thread Tarek Ziadé

Changes by Tarek Ziadé <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10127/shutil.copytree.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2663] shutil.copytree glob-style filtering [patch]

2008-05-03 Thread Tarek Ziadé

Changes by Tarek Ziadé <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file10178/copytree.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2663] shutil.copytree glob-style filtering [patch]

2008-05-03 Thread Tarek Ziadé

Changes by Tarek Ziadé <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10177/copytree.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2715] Remove carbon-specific code from binhex

2008-05-03 Thread Ronald Oussoren

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

Have you read that code? The Carbon-specific code in there is needed to 
make the module behave correctly in OSX: the Carbon specific code is used 
to get and set some Mac-specific file attributes.

It should be easy enough to move that code into a small C extensions 
though, that way binhex will no longer depent on the Carbon python 
package.

--
nosy: +ronaldoussoren

__
Tracker <[EMAIL PROTECTED]>

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



[issue2663] shutil.copytree glob-style filtering [patch]

2008-05-03 Thread Tarek Ziadé

Changes by Tarek Ziadé <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file10179/copytree.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2663] shutil.copytree glob-style filtering [patch]

2008-05-03 Thread Tarek Ziadé

Changes by Tarek Ziadé <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10178/copytree.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2441] Mac build_install.py script fetches unavailable SQLite version

2008-05-03 Thread Gerhard Häring

Gerhard Häring <[EMAIL PROTECTED]> added the comment:

Glyph, do you know somebody with a Mac who could verify this patch?
Perhaps you have a Mac yourself? :-) I'd suggest to update the patch to
the latest SQLite version then while at it (3.5.8 currently).

--
assignee: ghaering -> glyph
nosy: +glyph
priority:  -> normal

__
Tracker <[EMAIL PROTECTED]>

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



[issue1724366] cPickle module doesn't work with universal line endings

2008-05-03 Thread Ronald Oussoren

Changes by Ronald Oussoren <[EMAIL PROTECTED]>:


--
assignee: jackjansen -> 

_
Tracker <[EMAIL PROTECTED]>

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



[issue995019] Ensure -single_module on Mac OS X

2008-05-03 Thread Ronald Oussoren

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

Closing as this doesn't seem really useful anyway and nobody responded to 
my question if the issue is still relevant.

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


Tracker <[EMAIL PROTECTED]>


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



[issue2486] Consider using bytes type instead of str to store Decimal coefficients

2008-05-03 Thread Mark Dickinson

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

I've made some progress here:  I have a version of decimal.py for
Python 3.0 that uses a Deccoeff instead of a string for the Decimal
coefficient.  It still needs a little work to make things efficient,
but it already passes all the tests in test_decimal.  There are no
API changes.

What's a Deccoeff?  Read on, and/or see attached file.

Deccoeff (for *Dec*imal *coeff*icient) is an extension type for Python
3.0 that combines some of the most useful aspects of both the integer
and string types.

First, you can do arithmetic directly with Deccoeff instances:

>>> from deccoeff import Deccoeff
>>> x = Deccoeff('7')
>>> y = Deccoeff('11')
>>> x + y
Deccoeff('18')
>>> x * y
Deccoeff('77')
>>> y - x
Deccoeff('4')
>>> x < y
True

Only nonnegative integers can be represented as Deccoeff instances,
since that's all that's needed for Decimal: a subtraction that would
produce a negative result instead raises OverflowError:

>>> x-y
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: difference is negative and cannot be represented as a 
Deccoeff

Powering also works:

>>> x ** y
Deccoeff('1977326743')
>>> y ** x
Deccoeff('19487171')

So much for arithmetic:  a Deccoeff instance can also be treated as a sequence:
it can be sliced (though the 'step' argument is not supported):

>>> x = Deccoeff('123456789')
>>> x[2:]
Deccoeff('1234567')
>>> x[:5]
Deccoeff('56789')

and indexed:

>>> x[3]
Deccoeff('6')

The length gives the total number of digits:

>>> len(x)
9

Note that the indices work in the opposite direction to the one you
might expect by looking at the string representation of a Deccoeff:
indexing is set up so that index 0 refers to the units digit, 1 to the
tens digit, 2 to the hundreds digit, etc.

Negative indices also make sense (but not in the usual Python sense of
counting from the end of the object): you should imagine the Deccoeff
as a finite string of digits padded with zeros infinitely on both the
left and right.  Then it makes sense to do, for example:

>>> x[-2:]
Deccoeff('12345678900')
>>> x[-3:4]
Deccoeff('6789000')

This provides a convenient way to do a 'decimal shift left'.  There
are many places in Decimal where it's appropriate to use x[n:] without
knowing in advance whether n is positive or negative.

This is a work in progress...  Comments very welcome.

Added file: http://bugs.python.org/file10180/deccoeff.c

__
Tracker <[EMAIL PROTECTED]>

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



[issue2720] make compiling struct be passed around to all ast helpers

2008-05-03 Thread Benjamin Peterson

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

Done in r62663.

--
resolution:  -> accepted
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue2504] Add gettext.pgettext() and variants support

2008-05-03 Thread Torsten Bronger

Changes by Torsten Bronger <[EMAIL PROTECTED]>:


--
nosy: +bronger

__
Tracker <[EMAIL PROTECTED]>

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



[issue2746] ElementTree ProcessingInstruction uses character entities in content

2008-05-03 Thread Dave Hughes

New submission from Dave Hughes <[EMAIL PROTECTED]>:

In the ElementTree and cElementTree implementations in Python 2.5 (and 
possibly Python 2.6 as I also found this issue when testing an SVN 
checkout of ElementTree 1.3), the conversion of a ProcessingInstruction 
to a string converts XML reserved characters (<, >, &) to character 
entities:

>>> from xml.etree.ElementTree import *
>>> tostring(ProcessingInstruction('test', ''))
''

>>> from xml.etree.cElementTree import *
>>> tostring(ProcessingInstruction('test', ''))
''

The XML 1.0 spec is rather vague on whether character entities are 
permitted in PIs (it explicitly states parameter entities are not 
parsed in PIs, but says nothing about parsing character entities). 
However, it does have this to say in section 2.4 "Character Data and 
Markup":

"The ampersand character (&) and the left angle bracket (<) MUST NOT 
appear in their literal form, except when used as markup delimiters, or 
within a comment, a processing instruction, or a CDATA section."

So, XML reserved chars don't need converting in PIs (the only string 
not permitted in a PI's content according to the spec, section 2.6, is 
'?>'), which sort of implies that they shouldn't be. As for practical 
reasons why they shouldn't be:

Breaks generated PHP:

>>> from xml.etree.cElementTree import *
>>> doc = Element('html')
>>> SubElement(doc, 'head')

>>> SubElement(doc, 'body')

>>> doc[1].append(ProcessingInstruction('php', 'if (2 < 1) print 
"Something has gone horribly wrong!";'))
>>> tostring(doc)
''

Different from xml.dom:

>>> from xml.dom.minidom import *
>>> i = getDOMImplementation()
>>> doc = i.createDocument(None, 'html', None)
>>> doc.documentElement.appendChild(doc.createElement('head'))

>>> doc.documentElement.appendChild(doc.createElement('body'))

>>> 
doc.documentElement.lastChild.appendChild(doc.createProcessingInstruction('test',
 ''))

>>> doc.toxml()
'\n?>'

Different from lxml:

>>> from lxml.etree import *
>>> tostring(ProcessingInstruction('test', ''))
'?>'

I suspect the only change necessary to fix this is to replace the 
_escape_cdata() call for ProcessingInstruction (and possibly Comment 
too given the spec quote above) in ElementTree._write() with an 
_encode() call, as shown in this patch (which includes the Comment 
change as well):

Index: elementtree/ElementTree.py
===
--- elementtree/ElementTree.py  (revision 511)
+++ elementtree/ElementTree.py  (working copy)
@@ -663,9 +663,9 @@
 # write XML to file
 tag = node.tag
 if tag is Comment:
-file.write("" % _escape_cdata(node.text, 
encoding))
+file.write("" % _encode(node.text, encoding))
 elif tag is ProcessingInstruction:
-file.write("" % _escape_cdata(node.text, encoding))
+file.write("" % _encode(node.text, encoding))
 else:
 items = node.items()
 xmlns_items = [] # new namespaces in this scope

Sorry I haven't got a similar patch for cElementTree. I've had a quick 
look through the source, but haven't yet figured out where the change 
should be made (unless it's not required - does cElementTree reuse that 
bit of ElementTree?).

--
components: XML
messages: 66154
nosy: waveform
severity: normal
status: open
title: ElementTree ProcessingInstruction uses character entities in content
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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



[issue2349] Py3K warn against assigning to True/False

2008-05-03 Thread Benjamin Peterson

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

Okay, now that #2720 was dealt with, here's another (close to final)
patch. I added an ast_warn help function. When -Werror is used, the
warnings are converted to SyntaxErrors. Raymond or Brett, if you could
take a look, that would be great. Thanks!

Added file: http://bugs.python.org/file10181/bool_assign5.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2740] Cmd module doesn't support readline completion on OSX Leopard

2008-05-03 Thread Ruben Kerkhof

Ruben Kerkhof <[EMAIL PROTECTED]> added the comment:

Documenting this would be great, since it caught me by surprise and took 
a while to figure out.

To get the Cmd module to work, atm you have to override the call to 
parse_and_bind, setting self.completekey isn't enough, so that one is 
broken on Leopard.

Patching the readline module is indeed a lot of work, you need to 
convert readline names like 'Tab' to integers to pass them to libedit, 
and convert  the syntax as well. It would be better if libedit would 
just accept readline syntax, but that's outside the scope of Python.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2747] Documentation of new gobject types fails

2008-05-03 Thread Ali Afshar

New submission from Ali Afshar <[EMAIL PROTECTED]>:

When using the automodule directive on a module that creates new Gobject
types (eg custom PyGTK widget), the implicit registration of the
imported types fail. (Normally any GObject subclass which has a
__gtype_name__ attribute is automatically registered as a new GType
using a metaclass.

I have had a dig around some of the code of gobject, and pygobject, but
not really any help to me.

http://svn.gnome.org/viewvc/pygobject/trunk/gobject/gobjectmodule.c?revision=777&view=markup
http://svn.gnome.org/viewvc/glib/trunk/gobject/gtype.c?revision=6454&view=markup

If anyone wants a quick look.

The directive I am using is:

.. automodule:: pygtkdock
:members:



I have also attached the exception I am getting.

--
assignee: georg.brandl
components: Documentation tools (Sphinx)
files: sphinx-err-FK4s9A.log
messages: 66158
nosy: aafshar, georg.brandl
severity: normal
status: open
title: Documentation of new gobject types fails
type: crash
versions: Python 2.5
Added file: http://bugs.python.org/file10182/sphinx-err-FK4s9A.log

__
Tracker <[EMAIL PROTECTED]>

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



[issue2735] range: lean and mean

2008-05-03 Thread Benjamin Peterson

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

Address more concerns with attached patch.

Added file: http://bugs.python.org/file10183/range_lean_and_mean5.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue1950] Potential overflows due to incorrect usage of PyUnicode_AsString.

2008-05-03 Thread Alexandre Vassalotti

Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment:

Alexander Belopolsky wrote:
> The patch looks good.  Just a question: I thought the strings returned
> by PyUnicode_AsStringAndSize are 0-terminated, while your patch at
> several places attempts to explicitly 0-terminate a copy of such string.  
> Are you sure this is necessary?

I wasn't sure if the strings returned by PyUnicode_AsStringAndSize were
0-terminated, so I didn't take any chance and explicitly terminated
them. But I just verified myself and they are indeed 0-terminated. So, I
modified the patch in consequence.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2486] Decimal slowdown in 3.0 due to str/unicode changes

2008-05-03 Thread Nick Coghlan

Nick Coghlan <[EMAIL PROTECTED]> added the comment:

(I changed the issue title to better reflect where the discussion has
moved to)

I really like the approach of a custom internal type for the mantissa
storage (the module containing would probably best be called _decimal).
Then it should be possible to focus on letting C do what it does best
(high speed arithmetic) and Python do what it does best (provide the
nice API and context management features)

--
title: Consider using bytes type instead of str to store Decimal coefficients 
-> Decimal slowdown in 3.0 due to str/unicode changes

__
Tracker <[EMAIL PROTECTED]>

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



[issue1950] Potential overflows due to incorrect usage of PyUnicode_AsString.

2008-05-03 Thread Alexandre Vassalotti

Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment:

Marc-Andre Lemburg wrote:
[SNIP]
> The above cast needs to be (Py_ssize_t). size_t is an unsigned length
type.

Actually, the cast is right (even though it is not strictly necessary).
  It just the patch that is confusing. Here is the relevant code:  

/* Normal module, so work out the package name if any */
char *start = PyUnicode_AsString(modname);
char *lastdot = strrchr(start, '.');
size_t len;
int error;
/* snip */
len = (size_t)(lastdot - start);
if (len >= MAXPATHLEN) {
PyErr_SetString(PyExc_ValueError,
"Module name too long");
return NULL;
}

I removed the cast from the patch (I don't know why I added it, anyway)
to avoid further confusion.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1950] Potential overflows due to incorrect usage of PyUnicode_AsString.

2008-05-03 Thread Alexandre Vassalotti

Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment:

Committed to r62667.

Thank you all for your comments!

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

__
Tracker <[EMAIL PROTECTED]>

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



[issue2748] ceil(), floor() and round() broken in Decimal

2008-05-03 Thread Mark Dickinson

New submission from Mark Dickinson <[EMAIL PROTECTED]>:

In Python 3.0, the Decimal __round__, __ceil__ and __floor__ functions
don't work as intended:  they all return 1, 0, or -1.

This is easy to fix.  The only reason I'm making an issue (literally) of 
it is that I remember some discussion of whether these functions should
be implemented at all for Decimal, but I don't remember what the outcome 
of that discussion was.  Adding Jeffrey to the nosy list in case he 
remembers.

Either all three functions should be removed, or they should be 
corrected and tests should be added for them.

--
assignee: facundobatista
components: Library (Lib)
messages: 66164
nosy: facundobatista, jyasskin, marketdickinson
severity: normal
status: open
title: ceil(), floor() and round() broken in Decimal
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue2748] ceil(), floor() and round() broken in Decimal

2008-05-03 Thread Jeffrey Yasskin

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

I remember the answer being that they shouldn't be supported, but then I
stopped paying attention and some patches went in bringing Decimal
closer to the Real API again, so I'm not sure if the earlier discussion
still applies. I'm happy to let the decimal maintainers decide.

--
nosy: +rhettinger

__
Tracker <[EMAIL PROTECTED]>

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



[issue2715] Remove carbon-specific code from binhex

2008-05-03 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

On Sat, May 3, 2008 at 1:36 AM, Ronald Oussoren <[EMAIL PROTECTED]> wrote:
>
>  Ronald Oussoren <[EMAIL PROTECTED]> added the comment:
>
>  Have you read that code?

Not in detail, no.

> The Carbon-specific code in there is needed to
>  make the module behave correctly in OSX: the Carbon specific code is used
>  to get and set some Mac-specific file attributes.
>
>  It should be easy enough to move that code into a small C extensions
>  though, that way binhex will no longer depent on the Carbon python
>  package.

OK.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1950] Potential overflows due to incorrect usage of PyUnicode_AsString.

2008-05-03 Thread Marc-Andre Lemburg

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

On 2008-05-03 20:25, Alexandre Vassalotti wrote:
> Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment:
> 
> Committed to r62667.
> 
> Thank you all for your comments!
> 
> --
> resolution:  -> fixed
> status: open -> closed

What about my comments regarding the PyUnicode_AsString() API in
http://bugs.python.org/msg65962

Should I open a separate tracker item for this ?

I don't know who added those APIs, but they are neither in line with
the rest of the Unicode API, nor are they really all that helpful.
I guess they were just added out of a misunderstanding of the
already existing code.

I'd suggest to remove PyUnicode_AsString() altogether (which your
patch has already done in a couple of places).

--
title: Potential overflows due to incorrect usage of PyUnicode_AsString. -> 
Potential overflows due to incorrect usage of   PyUnicode_AsString.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2744] Fix test_cProfile

2008-05-03 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

A key thing to realize is that test_cprofile has heavily changed in
2.6 compared to what is currently disabled in 3.0.

--
nosy: +brett.cannon

__
Tracker <[EMAIL PROTECTED]>

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



[issue2748] ceil(), floor() and round() broken in Decimal

2008-05-03 Thread Raymond Hettinger

Changes by Raymond Hettinger <[EMAIL PROTECTED]>:


--
assignee: facundobatista -> rhettinger

__
Tracker <[EMAIL PROTECTED]>

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



[issue2748] ceil(), floor() and round() broken in Decimal

2008-05-03 Thread Mark Dickinson

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

I've removed __round__, __ceil__ and __floor__ in r62669;  the code was 
undocumented, untested and just plain wrong, so there doesn't seem to be 
any point in leaving it in.  (I'm not quite sure how it got there in the 
first place.)

This still leaves the question of whether to implement these functions.
I can provide a patch if it's desirable.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2748] ceil(), floor() and round() broken in Decimal

2008-05-03 Thread Raymond Hettinger

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

Thanks Mark.  I'll review your patch when it's ready.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2704] IDLE: Patch to make PyShell behave more like a Terminal interface

2008-05-03 Thread Roger Serwy

Roger Serwy <[EMAIL PROTECTED]> added the comment:

Hi Terry,

The patch allows you to select previous output if your cursor leaves the 
command line area. Press the left arrow button at a new command line 
does this.

Thank you for your feedback!

- RDS

Terry J. Reedy wrote:
> Terry J. Reedy <[EMAIL PROTECTED]> added the comment:
>
> I like the two changes: jump to command line and scroll previous command
> lines without having to search back up through the output.  Just don't
> imitate the Windows terminal too closely with its inability to just
> select previous output (without Symbol/Edit/Mark).
>
> --
> nosy: +tjreedy
>
> __
> Tracker <[EMAIL PROTECTED]>
> 
> __
>
>

__
Tracker <[EMAIL PROTECTED]>

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



[issue2749] Raise a DeprecationWarning for warnings.showwarning(.., line)

2008-05-03 Thread Brett Cannon

New submission from Brett Cannon <[EMAIL PROTECTED]>:

In order to move the warnings.showwarning() API forward to support the new 
'line' argument, a DeprecationWarning is needed for implementations that 
lack support for it.

>From the Python side a simple check for the 'line' argument using 
'inspect' will work. For the C side, a check that there is more than 1 
default argument should suffice, although a quick check of what other ways 
to introspect Python function objects from C code should be done first 
before settling on this solution.

--
assignee: brett.cannon
components: Interpreter Core
keywords: easy
messages: 66172
nosy: brett.cannon
priority: critical
severity: normal
status: open
title: Raise a DeprecationWarning for warnings.showwarning(.., line)
type: behavior
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue2582] Unpickling of range objects fail in Py3k

2008-05-03 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


--
priority:  -> critical

__
Tracker <[EMAIL PROTECTED]>

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



[issue2749] Raise a DeprecationWarning for warnings.showwarning(.., line)

2008-05-03 Thread Benjamin Peterson

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

Brett, can you list the places showwarning is used?

--
nosy: +benjamin.peterson

__
Tracker <[EMAIL PROTECTED]>

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



[issue2749] Raise a DeprecationWarning for warnings.showwarning(.., line)

2008-05-03 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

On Sat, May 3, 2008 at 2:11 PM, Benjamin Peterson
<[EMAIL PROTECTED]> wrote:
>
>  Benjamin Peterson <[EMAIL PROTECTED]> added the comment:
>
>  Brett, can you list the places showwarning is used?
>

Lib/warnings.py and Python/_warnings.c. In both cases just search for
"showwarning"; there is only a single call site in both files.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2747] Documentation of new gobject types fails

2008-05-03 Thread Ali Afshar

Ali Afshar <[EMAIL PROTECTED]> added the comment:

I have managed to reduce the bug to a tiuny test case. It seems that
this only happens when calling automodule directive on a package, with
code in __init__.py which registers a new GType. Moving the code to a a
regular module inside a package allows it to be imported normally.

I have attached the project directory, and there is a script "build.sh"
which just demonstrates how I run the builder to get the PYTHONPATH
correct to be able to improt the package.

Added file: http://bugs.python.org/file10184/sphinx-bug-test.tar.gz

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Bob Ippolito

New submission from Bob Ippolito <[EMAIL PROTECTED]>:

Attached is the tarball for simplejson 1.9, the proposed version to be
included in the stdlib.

Estimated work remaining:

 * Rename simplejson to json
 * Build simplejson/_speedups.c from Modules/Setup and Windows projects
 * Convert documentation to Python docs
 * Port to Python 3.0

--
components: Library (Lib)
files: simplejson-1.9.tar.gz
messages: 66176
nosy: bob.ippolito
severity: normal
status: open
title: Add simplejson to Python 2.6/3.0 standard library
type: feature request
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file10185/simplejson-1.9.tar.gz

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Benjamin Peterson

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

This work might be a good thing to a do on a Bazaar branch.

--
nosy: +benjamin.peterson

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Brett Cannon

Changes by Brett Cannon <[EMAIL PROTECTED]>:


--
keywords: +patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Brett Cannon

Changes by Brett Cannon <[EMAIL PROTECTED]>:


--
priority:  -> critical

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

The most critical steps are to get the code building and to get the tests 
passing. Once that is working the code can be checked in and the other 
steps (docs, PEP 7/8, 3.0 conversion) can happen after the fact.

--
nosy: +brett.cannon

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Christian Heimes

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

Yeah, either make a bzr branch or an ordinary svn branch. If you need
some help with the C code I can be of assistance. I'm in #python-dev.
Let's coordinate the next steps there.

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

On Sat, May 3, 2008 at 3:19 PM, Christian Heimes <[EMAIL PROTECTED]> wrote:
>
>  Christian Heimes <[EMAIL PROTECTED]> added the comment:
>
>  Yeah, either make a bzr branch or an ordinary svn branch. If you need
>  some help with the C code I can be of assistance. I'm in #python-dev.
>  Let's coordinate the next steps there.

I am about to create a bzr branch in my personal directory named
issue2750-simplejson.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

Branch is at http://code.python.org/python/users/brett/issue2750-
simplejson/ .

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

Just so it is documented, Bob said on IRC that we do not need to keep 
compatibility with any specific version of Python.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Benjamin Peterson

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

I'll do PEP 8 review.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1563] asyncore and asynchat incompatible with Py3k str and bytes

2008-05-03 Thread Brett Cannon

Changes by Brett Cannon <[EMAIL PROTECTED]>:


--
priority: normal -> critical

__
Tracker <[EMAIL PROTECTED]>

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



[issue2748] ceil(), floor() and round() broken in Decimal

2008-05-03 Thread Mark Dickinson

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

Here's a patch that implements __ceil__, __floor__ and __round__.  (It 
seems that just removing __ceil__, __floor__ and __round__ is not an 
option, as I just discovered when r62669 turned all the buildbots red.)

Points to note:

(1) Two-argument round has essentially the same semantics as quantize.  
To be precise, for a Decimal instance x and an int n,

round(x, n) 

is exactly interchangeable with 

x.quantize(Decimal('1E%s' % -n))

In particular, this means that round uses the rounding mode from the 
current context (which will usually, but not always, be 
ROUND_HALF_EVEN), and that an InvalidOperation exception will be raised 
(or NaN returned) if the rounded value has too many digits for the 
current context precision.

After thinking about it, it seemed better to make the two expressions 
above identical than to have subtle and potentially confusing 
differences between them.

(2) Decimal.__round__ takes two optional arguments, 'context' and 
'rounding', again with exactly the same semantics as the corresponding 
optional arguments for quantize.  At the moment, these arguments aren't 
considered public, and aren't documented.  (And they're only accessible 
through __round__ anyway, not directly through the round() builtin.)

(3) For one-argument round, ceil, and floor, the only real decision to 
be made is what to do with NaNs and infinities.  The spirit of IEEE 
754/854/754r suggests that an attempt to turn an infinity into an 
integer should signal the 'overflow' floating-point exception, while 
turning a NaN into an integer should signal 'invalid';  correspondingly, 
the patch raises OverflowError or ValueError respectively in these 
situations.

--
keywords: +patch
Added file: http://bugs.python.org/file10186/decimal_ceilfloor.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Bob Ippolito

Bob Ippolito <[EMAIL PROTECTED]> added the comment:

The json package is in brett's branch, integrates with the test suite,
builds the C extension and passes all tests (at least on OS X and Linux
UCS2 and UCS4).

Missing the docs and python 3.0 support still, otherwise things look good.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2751] Regression for executing packages

2008-05-03 Thread Benjamin Peterson

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

If I have a package like this:

pack/
__init__.py

and __init__.py looks like this
if __name__ == "__main__":
print "Spam"

python -m pack gives
one is a package and cannot be directly executed

This is regression from 2.5 where "Spam" would be printed.

--
components: Interpreter Core
messages: 66184
nosy: benjamin.peterson
priority: critical
severity: normal
status: open
title: Regression for executing packages
type: behavior
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue2745] Add support for IsWow64Process

2008-05-03 Thread Mark Hammond

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

I'm not sure if that is suggesting MS had no reason to add that API
function, or those reasons don't apply to users of Python, but as its
clear there is significant resistance I'm rejecting this report.

--
resolution:  -> rejected
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue2750] Add simplejson to Python 2.6/3.0 standard library

2008-05-03 Thread Benjamin Peterson

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

I'm going to handle the docs, too.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2751] Regression for executing packages

2008-05-03 Thread Nick Coghlan

Nick Coghlan <[EMAIL PROTECTED]> added the comment:

The ability to execute packages was never intended, since doing so
breaks imports in a variety of subtle ways. It was actually a bug in 2.5
that it was permitted at all, so 2.6 not only disabled it again, but
also added a test to make sure it stays disabled (2.4 correctly rejected
it with an ImportError, just as 2.6 does).

Here's the relevant svn log entry:

r56509 | nick.coghlan | 2007-07-23 23:41:45 +1000 (Mon, 23 Jul 2007) | 5
lines

Correctly cleanup sys.modules after executing runpy relative import
tests
Restore Python 2.4 ImportError when attempting to execute a package
(as imports cannot be guaranteed to work properly if you try it)

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

__
Tracker <[EMAIL PROTECTED]>

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



[issue2751] Regression for executing packages

2008-05-03 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


--
assignee:  -> ncoghlan
nosy: +ncoghlan

__
Tracker <[EMAIL PROTECTED]>

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



[issue2745] Add support for IsWow64Process

2008-05-03 Thread Martin v. Löwis

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

One reason for IsWow64Process is that it allows to determine the
wow-ness of a different process, which is e.g. needed to display the
asterisk in the process viewer. This reason indeed doesn't apply to
Python, and your patch doesn't expose that functionality.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2752] Wrong comment in socket documentation

2008-05-03 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' <[EMAIL PROTECTED]>:

In the example section of socket module I see:

HOST = '' # Symbolic name meaning the local host
PORT = 50007  # Arbitrary non-privileged port

'', at least on Windows, is an alias for telling the socket to listen on
all available interfaces while 'localhost' is used for referencing the
local interface (usually '127.0.0.1').

--
assignee: georg.brandl
components: Documentation
messages: 66191
nosy: georg.brandl, giampaolo.rodola
severity: normal
status: open
title: Wrong comment in socket documentation
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue2753] Test issue

2008-05-03 Thread Martin v. Löwis

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

Testing the integration with the review tool.

--
files: regrtest.diff
keywords: patch
messages: 66192
nosy: loewis
severity: normal
status: open
title: Test issue
Added file: http://bugs.python.org/file10187/regrtest.diff

__
Tracker <[EMAIL PROTECTED]>

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