[issue7475] No hint about codecs removed : base64 bz2 hex zlib ...

2009-12-11 Thread flox

flox  added the comment:

«Everything you thought you knew about binary data and Unicode
 has changed.»

Reopening for the documentation part.

This "mistake" deserves some words in the documentation:
  docs.python.org/dev/py3k/whatsnew/3.0.html
  #text-vs-data-instead-of-unicode-vs-8-bit

And the conversion may be automated with 2to3, maybe.

--
assignee:  -> georg.brandl
components: +2to3 (2.x to 3.0 conversion tool), Documentation -Library (Lib)
nosy: +georg.brandl
status: closed -> open
title: codecs missing: base64 bz2 hex zlib ... -> No hint about codecs removed 
: base64 bz2 hex zlib ...

___
Python tracker 

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



[issue7475] No hint about codecs removed : base64 bz2 hex zlib ...

2009-12-11 Thread flox

flox  added the comment:

Is it possible to add "DeprecationWarning" for these codecs
when using "python -3" ?

>>> {}.has_key('a')
__main__:1: DeprecationWarning: dict.has_key() not supported in 3.x;
use the in operator
False
>>> print `123`
:1: SyntaxWarning: backquote not supported in 3.x; use repr()
123
>>> 'abc'.encode('base64')
'YWJj\n'

--

___
Python tracker 

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



[issue7475] No hint about codecs removed : base64 bz2 hex zlib ...

2009-12-11 Thread flox

Changes by flox :


--
versions: +Python 2.7

___
Python tracker 

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



[issue7475] No hint about codecs removed: base64 bz2 hex zlib ...

2009-12-11 Thread flox

Changes by flox :


--
title: No hint about codecs removed : base64 bz2 hex zlib ... -> No hint about 
codecs removed: base64 bz2 hex zlib ...

___
Python tracker 

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



[issue7470] logger.StreamHandler emit encoding fallback is wrong

2009-12-11 Thread Vinay Sajip

Vinay Sajip  added the comment:

Never mind my earlier comment, I looked at the change more carefully
after a cup of coffee, and it now makes sense to me ;-)

Fixed checked into trunk (r76754), thanks.

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

___
Python tracker 

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



[issue7475] No hint about codecs removed: base64 bz2 hex zlib ...

2009-12-11 Thread flox

Changes by flox :


--
keywords: +patch
Added file: http://bugs.python.org/file15523/issue7475_warning.diff

___
Python tracker 

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



[issue7464] circular reference in HTTPResponse by urllib2

2009-12-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

cool.  The mindtrove one in particular seems nice.  I didn't realize 
that one could build boundobjects oneself.
Is there any chance of getting a weakmethod class into the weakref 
module?

--

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Martin v. Löwis wrote:
> 
> Martin v. Löwis  added the comment:
> 
> It's not possible to add these codecs back. Bytes objects (correctly)
> don't have an encode method, and string objects (correctly) don't have a
> decode method. The codec architecture of Python 3.x just doesn't support
> this kind of application; the codec architecture of 2.x was flawed.

Of course it does support these kinds of codecs. The codec
architecture hasn't changed between 2.x and 3.x, just the way
a few methods work.

All we agreed to is that unicode.encode() will only return bytes,
while bytes.decode() will only return unicode. So the methods won't
support same type conversions, because Guido didn't want to
have methods that return different types based on the chosen
parameter (the codec name in this case).

However, you can still use codecs.encode() and codecs.decode()
to work with codecs that return different combinations of
types. I explicitly added that support back to 3.0.

You can't argue that just because two methods don't support
a certain type combination, the whole architecture doesn't
support this anymore.

Also note that codecs allow a much more far-reaching use
than just through the unicode and bytes methods: you can
use them as seamless wrappers for streams, subclass from
them, use their methods directly, etc. etc.

So your argument that just because the two methods don't
support these codecs anymore is just not good enough
to warrant their removal.

--
title: No hint about codecs removed: base64 bz2 hex zlib ... -> codecs missing: 
base64 bz2 hex zlib ...

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-11 Thread Marc-Andre Lemburg

Changes by Marc-Andre Lemburg :


--
resolution: invalid -> 

___
Python tracker 

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



[issue7464] circular reference in HTTPResponse by urllib2

2009-12-11 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

On Fri, Dec 11, 2009 at 09:40:40AM +, Kristján Valur Jónsson wrote:
> Is there any chance of getting a weakmethod class into the weakref 
> module?

This is a separate feature request on weakref module. It may opened
and discussion carried out there?

--

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Benjamin Peterson wrote:
> 
> Benjamin Peterson  added the comment:
> 
> I agree with Martin. gzip and bz2 convert bytes to bytes. Encodings deal
> strictly with unicode -> bytes.

Sorry, Bejamin, but that's simply not true.

Codecs can work with arbitrary types, it's just that the helper
methods on unicode and bytes objects only support one combination
of types in Python 3.x.

codecs.encode()/.decode() provide access to all codecs, regardless
of their supported type combinations and of course, you can use
them directly via the codec registry, subclass from them, etc.

--

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-11 Thread flox

flox  added the comment:

Thinking about it, I am +1 to reimplement the codecs.

We could implement new methods to replace the old one.
(similar to base64.encodebytes and base64.decodebytes)

>>> b'abc'.encodebytes('base64')
b'YWJj\n'
>>> b'abc'.encodebytes('zlib').encodebytes('base64')
b'eJxLTEoGAAJNASc=\n'
>>> b'UHl0aG9u'.decodebytes('base64').decode('utf-8')
'Python'

--
components: +Library (Lib)

___
Python tracker 

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



[issue7452] Invalid mnemonic 'fnstcw'

2009-12-11 Thread Mark Dickinson

Mark Dickinson  added the comment:

Yes, this can be closed as far as I'm concerned.

--

___
Python tracker 

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



[issue7455] cPickle: stack underflow in load_pop()

2009-12-11 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file15487/cpickle_load_pop.patch

___
Python tracker 

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



[issue7455] cPickle: stack underflow in load_pop()

2009-12-11 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file15494/cpickle_load_pop-2.patch

___
Python tracker 

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



[issue7455] cPickle: stack underflow in load_pop()

2009-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

Oops, cpickle_load_pop-2.patch contains an useless variable (picklingError 
= pickle.UnpicklingError). Here is the version 3 of my patch.

--
Added file: http://bugs.python.org/file15524/cpickle_load_pop-3.patch

___
Python tracker 

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



[issue4853] I/O operation on closed socket: improve the error message

2009-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

Well, this issue is not really important. The current behaviour is already 
correct (raising an error if the file is closed).

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

___
Python tracker 

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



[issue7477] kqueue timers don't work properly

2009-12-11 Thread Hasan

New submission from Hasan :

kqueue timers are not working at all on Mac OSX 10.6.1 (probably not 
working on other BSDs as well but haven't tested it).

Here's a simply repro:

from select import *
kq = kqueue()
e = kevent(1, flags=KQ_EV_ENABLE|KQ_EV_ONESHOT, 
filter=KQ_FILTER_TIMER)
e

new_e = f.control([e], 1, 0)

This should block 10s before it returns control with new_e having a timer 
event returned. However, it isn't the case.
control returns immediately returning a busted event:
[]

Am I missing something?

--
components: Library (Lib)
messages: 96247
nosy: hasan
severity: normal
status: open
title: kqueue timers don't work properly
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue7478] _sqlite3 doesn't catch PyDict_SetItem error

2009-12-11 Thread STINNER Victor

New submission from STINNER Victor :

Methods create_function, create_aggregate, set_authorizer, 
set_progress_handler, create_collation of the _sqlite3.Connection class 
doesn't catch PyDict_SetItem/PyDict_DelItem errors. The error will be 
catched by next opcode/function call.

The error occurs if the callback argument is not hashable.

Attached patch adds the missing tests, and add unit tests.

There is not unit test for Connection.create_collation() because I don't 
know how to test it. The call to PyDict_SetItem() is different, because 
the callback is not the dictionary key but the value (so it's not a 
problem if the callback is not hashable).

--
components: Extension Modules
messages: 96248
nosy: haypo
severity: normal
status: open
title: _sqlite3 doesn't catch PyDict_SetItem error
versions: Python 2.7

___
Python tracker 

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



[issue7478] _sqlite3 doesn't catch PyDict_SetItem error

2009-12-11 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +patch
Added file: http://bugs.python.org/file15525/_sqlite3_setdict.patch

___
Python tracker 

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



[issue7479] os.lchmod is not present

2009-12-11 Thread steve

New submission from steve :

Reason for opening this bug:

I am opening a bug because the documentation here:
http://docs.python.org/library/os.html#os.lchmod

Says that in python 2.6 there is a method os.lchmod() for changing the
permissions of unix symbolic links,  

I am running Python 2.6 on several flavors of Linux, and non of them
have os.lchmod().  My understanding is that one can not change the
permissions of a sybolic link on Linux because the symlink basically
'inherits' the permissions of the file if points to.

Is this ment to be used on other flavors of UNIX other than Linux?

I am only really familiar with Linux, and have not played with man y
other flavors on UNIX.  Can other flavor change the permission of
symbolic links?


What I am Looking for from this bug report:
===
I would like to know what is happening with os.lchmod.  If it is not
suppose to be there, I would like it removed from the documentation.  If
it is mena for other flavors of unix, but not linux.  I think it should
be implemented as just a function that passes.

Let me know what you think.

Peace,
Steve

--
assignee: georg.brandl
components: Documentation
messages: 96249
nosy: bluegeek, georg.brandl
severity: normal
status: open
title: os.lchmod is not present
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue7477] kqueue timers don't work properly

2009-12-11 Thread Hasan

Hasan  added the comment:

Typo in the repro.

The statement:
new_e = f.control
should be:
new_e = kq.control

--

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-11 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/12/11 Marc-Andre Lemburg :
> codecs.encode()/.decode() provide access to all codecs, regardless
> of their supported type combinations and of course, you can use
> them directly via the codec registry, subclass from them, etc.

Didn't you have a proposal for bytes.transform/untransform for
operations like this?

--

___
Python tracker 

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



[issue7479] os.lchmod is not present

2009-12-11 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

lchmod seems to be a BSD-specific function.

--
nosy: +pitrou

___
Python tracker 

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



[issue7478] _sqlite3 doesn't catch PyDict_SetItem error

2009-12-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +ghaering
priority:  -> normal
stage:  -> patch review
type:  -> crash
versions: +Python 2.6, Python 3.1, Python 3.2

___
Python tracker 

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




[issue7455] cPickle: stack underflow in load_pop()

2009-12-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +alexandre.vassalotti

___
Python tracker 

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



[issue7394] sqlite3: some OperationalError exceptions should be ProgrammingError (PEP 249)

2009-12-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +ghaering

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Benjamin Peterson wrote:
> 
> Benjamin Peterson  added the comment:
> 
> 2009/12/11 Marc-Andre Lemburg :
>> codecs.encode()/.decode() provide access to all codecs, regardless
>> of their supported type combinations and of course, you can use
>> them directly via the codec registry, subclass from them, etc.
> 
> Didn't you have a proposal for bytes.transform/untransform for
> operations like this?

Yes. At the time it was postponed, since I brought it up late
in the 3.0 release process. Perhaps I should bring it up again.

Note that those methods are just convenient helpers to access
the codecs and as such only provide limited functionality.

The full machinery itself is accessible via the codecs module and
the code in the encodings package. Any decision to include a codec
or not needs to be based on whether it fits the framework in those
modules/packages, not the functionality we expose on unicode and
bytes objects.

--

___
Python tracker 

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



[issue1398] Can't pickle partial functions

2009-12-11 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Indeed. Jack Diederich added support for pickling partial functions in
r70931.

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-12-11 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Mark Dickinson wrote:
> Is there still a need for a separate C function for creating a zero-
> initialized bytes object from a Py_ssize_t or a Python integer?

What C function are you referring to?

> And this check doesn't cover other, similar, cases: for example, list('')
> will still be converted by PyBytes_FromObject, while list('123') won't.

Well, one is a just empty list and the other a list of strings. I don't see
why converting a empty list to bytes should raise an error. Although I agree
the type check is a bit out of place, I think it will help prevents bugs. 

In addition, PyBytes_FromObject() is documented as equivalent to the
built-in
bytes(). Since calling bytes() with any unicode string raises a TypeError
exception, unless an encoding is specified, I believe PyBytes_FromObject()
should also follow this convention.

--

___
Python tracker 

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



[issue2335] Backport set literals

2009-12-11 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

If there are no objections, I will commit this patch later this week.

--

___
Python tracker 

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



[issue2333] Backport set and dict comprehensions

2009-12-11 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

If there are no objections, I will commit this patch later this week
after issue #2335.

--

___
Python tracker 

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



[issue1967] Backport dictviews to 2.7

2009-12-11 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Can someone review the patches? I would like to commit this later this week.

--

___
Python tracker 

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



[issue7473] x84_64 arch Missing from 2.6.4 Mac universal binaries - Cripples building embedded 64-bit

2009-12-11 Thread Paul Nelson

Paul Nelson  added the comment:

Once the binary (ppc, i386) binary is installed it becomes impossible to 
rebuild python from source as 3-way binary on the system, without first 
removing the 2.6.4 dual architecture 
/Library/Frameworks/Python.framework.  
It causes compile failures in _curses and _curses_panel, on x86_64.
(Leopard 10.5.7 intel)

Please distribute it as a 3-way binary. Or warn in big type that the 
current install is really only suitable for Tiger and earlier systems.  
Especially since Apple is really pushing for apps to be 64-bit as well 
as 32.

Thanks
Paul

--
type: behavior -> compile error

___
Python tracker 

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



[issue7473] x84_64 arch Missing from 2.6.4 Mac universal binaries - Cripples building embedded 64-bit

2009-12-11 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

I don't agree that the current binaries are only useful for Tiger and 
earlier, the binaries work just fine on Leopard and Snow Leopard as 
well.

FWIW. I'm planning to provide a 3-way universal binary, or even just 
intel (i386, x86_64) for Python 2.7 and 3.2. That installer will only 
support OSX 10.5 or later.

BTW. I'll gladly review and patches that make it easier to compile a 3-
way univeral build without first removing the existing build. 

The reason that the current installer is not 3-way universal is that it 
is not possibly to have a 3-way universal binary that will run on 10.3.9 
or later unless you use different deployment targets for the various 
architectures and those different deployment targets cause observable 
differences in behavior because Apple fixed a number of Unix API issues 
for deployment target 10.5 (or later).

--

___
Python tracker 

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



[issue7473] Compile error when building a 3-way universal framework when a 2-way universal framework is present

2009-12-11 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
resolution:  -> accepted
stage:  -> needs patch
title: x84_64 arch Missing from 2.6.4 Mac universal binaries - Cripples 
building embedded 64-bit -> Compile error when building a 3-way universal 
framework when a 2-way universal framework is present

___
Python tracker 

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



[issue7452] Invalid mnemonic 'fnstcw'

2009-12-11 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
status: open -> closed

___
Python tracker 

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



[issue7473] Compile error when building a 3-way universal framework when a 2-way universal framework is present

2009-12-11 Thread Paul Nelson

Paul Nelson  added the comment:

I would humbly suggest that it be 3-way, until it is 10.6 (Snow Leopard) 
and above.  In our case as long as we support Leopard, we will be 
supporting all 3 architectures for our software.  

It would be appreciated if the web page indicated that the .dmg is 
currently only (ppc i386),  It would have prevented issues like ours 
where I am working on embedding python into the product which is 32 bit 
and 64 bit intel and 32-bit ppc.  And several developers unwittingly 
installed the 2.6.4 (ppc i386) on their system, and then could no longer 
build the 64-bit version of our application, since XCode tried linking 
with the new 2.6 framework even though the 2.5 Python framework was the 
one specified in the project file.

--

___
Python tracker 

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



[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-11 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

IMO it would be better to call _PyObject_GC_IS_TRACKED() explicitly
rather than rely on a subtle difference between the two APIs as in the
current patch.

--

___
Python tracker 

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



[issue7466] Segmentation fault after about 20 seconds on lenovo T500

2009-12-11 Thread flox

flox  added the comment:

Ok. It is here:
  http://bugs.python.org/file15520/issue7466.diff

--

___
Python tracker 

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



[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-12-11 Thread Mark Dickinson

Mark Dickinson  added the comment:

> What C function are you referring to?

A currently non-existent one!  I was wondering whether the current bytes-
from-integer functionality that PyBytes_FromObject supplies is important 
enough to preserve somehow.  I'd guess not.

--

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-11 Thread flox

flox  added the comment:

I've ported the codecs from Py2:
base64, bytes_escape, bz2, hex, quopri, rot13, uu and zlib

It's not a big deal. Basically:
 - StringIO.StringIO --> io.BytesIO
 - 'string_escape' --> 'bytes_escape'

Will add documentation if we agree on the feature.

--
Added file: http://bugs.python.org/file15526/issue7475_missing_codecs_py3k.diff

___
Python tracker 

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



[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-11 Thread Mark Dickinson

Mark Dickinson  added the comment:

nirinA:  thanks for prodding this issue.  Yes, it is still alive (just). 
:)

About adding the Euler constant:  I agree this should be added.  Do you 
have time to expand your patch to include docs and a test or two?

For expm1, I was planning to use the libm function when it exists (which 
I expect it will on most platforms), and just use a quick hack based on 
the identity

  expm1(x) = sinh(x/2)*exp(x/2)

for platforms where it's missing.

I'll look at the erf and erfc implementations.

Daniel:  re incomplete beta and gamma functions, I'd prefer to limit 
this particular issue to the C99 math functions.  It's difficult to know 
where to draw the line, but it seems to me that these are really the 
domain of numpy/scipy.  And they involve multiple input arguments, which 
makes them *darned hard* to write and test!  Anyway, if you'd like to 
see those added to Python's math module, maybe this could be brought up 
on python-dev to see how much support there is.

--

___
Python tracker 

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



[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-11 Thread Mark Dickinson

Mark Dickinson  added the comment:

> expm1(x) = sinh(x/2)*exp(x/2)

Should be 2*sinh(x/2)*exp(x/2).

--

___
Python tracker 

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



[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-11 Thread Mark Dickinson

Mark Dickinson  added the comment:

lgamma patch committed to trunk (with looser tests) in r76755.

--

___
Python tracker 

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



[issue7380] uuid.UUID.bytes gives a bytearray() instead of bytes

2009-12-11 Thread flox

Changes by flox :


--
versions:  -Python 3.0

___
Python tracker 

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



[issue7480] trite documentation issue.

2009-12-11 Thread David W. Lambert

New submission from David W. Lambert :

http://docs.python.org/dev/py3k/library/stdtypes.html#index-559

Proposal: remove last sentence from

"class.__bases__
The tuple of base classes of a class object. If there are no base 
classes, this will be an empty tuple."


Reason: Sentence is a python 2 relic.  The only case is this---

>>> object.__bases__
()

Point being that documentation should be clear, puzzles left as a 
comprehension test.

--
assignee: georg.brandl
components: Documentation
messages: 96269
nosy: LambertDW, georg.brandl
severity: normal
status: open
title: trite documentation issue.
versions: Python 3.1

___
Python tracker 

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



[issue5716] Overzealous deprecation of BaseException.message

2009-12-11 Thread Alan Isaac

Alan Isaac  added the comment:

FYI a patch has been committed that should fix this. For discussion see
http://bugs.python.org/issue6844

--
nosy: +aisaac

___
Python tracker 

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



[issue7481] Failing to start a thread leaves "zombie" thread in "initial" state

2009-12-11 Thread John Mark Schofield

New submission from John Mark Schofield :

SUMMARY: When you attempt to start a thread, and you're unable to (you
get thread.error) it leaves a thread stuck in an "initial" state that
never exits. (threading.enumerate() shows the threads and lists their
status as "initial.")

REPRODUCTION STEPS: See attached file.

EXPECTED RESULT: Failing to start a thread should not leave the thread
in an un-executable state. I would expect the thread start to either
succeed or result in the thread being closed and GC'd.

VERIFIED ON:
Python 2.5.2 on OS X 10.5.8
Python 2.5.2 on Ubuntu 8.04
Python 2.5.4 on Windows XP Professional (Version 2002) SP3
Python 2.6.1 on OS X 10.6.2

--
files: repro_case.py
messages: 96271
nosy: schof
severity: normal
status: open
title: Failing to start a thread leaves "zombie" thread in "initial" state
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file15527/repro_case.py

___
Python tracker 

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



[issue7466] Segmentation fault with tuple + gc.collect()

2009-12-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
title: Segmentation fault after about 20 seconds on lenovo T500 -> Segmentation 
fault with tuple + gc.collect()

___
Python tracker 

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



[issue7471] GZipFile.readline too slow

2009-12-11 Thread Jack Diederich

Jack Diederich  added the comment:

I tried passing a size to readline to see if increasing the chunk helps
(test file was 120meg with 700k lines).  For values 1k-10k all took
around 30 seconds, with a value of 100 it took 80 seconds, with a value
of 100k it ran for several minutes before I killed it.  The default
starts at 100 and quickly maxes to 512, which seems to be a sweet spot
(thanks whomever figured that out!).

I profiled it and function overhead seems to be the real killer.  30% of
the time is spent in readline().  The next() function does almost
nothing and consumes 1/4th the time of readline().  Ditto for read() and
_unread().  Even lowly len() consumes 1/3rd the time of readline()
because it is called over 2million times.

There doesn't seem to be any way to speed this up without rewriting the
whole thing as a C module.  I'm closing the bug WONTFIX.

--
nosy: +jackdied
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue7455] cPickle: stack underflow in load_pop()

2009-12-11 Thread Jack Diederich

Jack Diederich  added the comment:

This seems to have been introduced in r72930 when the stackUnderflow()
was moved from the top of the function to the bottom.  It used to test
for len > 0.

Question, should cPickle and pickle be raising the same error here? 
UnpicklingError is defined in pickle.py and never used but cPickle.c
uses it frequently.

--
nosy: +collinwinter, jackdied

___
Python tracker 

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



[issue7477] kqueue timers don't work properly

2009-12-11 Thread Hasan

Hasan  added the comment:

Closing it. My mistake. I was passing incorrect arguments. KQ_EV_ONESHOT 
requires KQ_EV_ADD as well, and timer data goes into data.

--
status: open -> closed

___
Python tracker 

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



[issue7482] Improve ZeroDivisionError message for float and complex object

2009-12-11 Thread Ezio Melotti

New submission from Ezio Melotti :

The current error messages for divisions by 0 of float and complex
object say "float/complex division", whereas for int and long is
"integer/long division by zero":
>>> 5/0
ZeroDivisionError: integer division or modulo by zero
>>> 5.0/0
ZeroDivisionError: float division

The attached patch adds "by zero" to the error messages of float and
complex in case of division, modulo or divmod by zero.

(Should I add tests to check the error message too?)

--
assignee: ezio.melotti
components: Interpreter Core
files: issue7482.patch
keywords: needs review, patch, patch
messages: 96275
nosy: ezio.melotti, mark.dickinson
priority: normal
severity: normal
stage: patch review
status: open
title: Improve ZeroDivisionError message for float and complex object
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file15528/issue7482.patch

___
Python tracker 

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



[issue1967] Backport dictviews to 2.7

2009-12-11 Thread Ezio Melotti

Ezio Melotti  added the comment:

The patch (backport_dictviews.diff) doesn't seem to work for me. I
applied it on trunk after a svn up, did "./configure && make" and when I
tried d.view{items|keys|values} Python segfaulted:

Python 2.7a1+ (trunk:76759M, Dec 12 2009, 00:28:52)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> d = dict(a=3, b=5)
>>> d.viewitems()
Segmentation fault

I'm tested it on Ubuntu 9.10.

The docstrings of the three methods are also wrong:

+PyDoc_STRVAR(viewkeys__doc__,
+"D.keys() -> a set-like object providing a view on D's keys");

This should be "D.viewkeys() -> ...", same with the other two.

--
keywords: +needs review -26backport
nosy: +ezio.melotti

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib ...

2009-12-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> codecs.encode()/.decode() provide access to all codecs, regardless
> of their supported type combinations and of course, you can use
> them directly via the codec registry, subclass from them, etc.

I presume that the OP didn't talk about codecs.encode, but about
the methods on string objects. flox, can you clarify what precisely
it is that you miss?

--

___
Python tracker 

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



[issue5716] Overzealous deprecation of BaseException.message

2009-12-11 Thread Ezio Melotti

Ezio Melotti  added the comment:

Closing this as a duplicate of #6844.

--
nosy: +ezio.melotti
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> BaseException DeprecationError raises inappropriately

___
Python tracker 

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



[issue7479] os.lchmod is not present

2009-12-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

All functions in the POSIX/os module are available only on those systems
that support them, and then do exactly what the system says they should
do. So if your system doesn't have lchmod, the os module won't provide
such a function on your system. There are systems which do provide
lchmod, e.g. NetBSD 1.3 and later.

Exposing this as a no-op function on systems which don't implement it
would be incorrect. If you want to wrap it with a no-op function in your
application, go ahead - it's easy enough.

I fail to see a bug in this report, so closing it as invalid.

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

___
Python tracker 

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



[issue1615158] POSIX capabilities support

2009-12-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever
versions: +Python 3.2 -Python 3.1

___
Python tracker 

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



[issue7479] os.lchmod is not present

2009-12-11 Thread R. David Murray

R. David Murray  added the comment:

Perhaps the bug is a small documentation bug, in that it should be
"Availability: BSD-based unix"?  We don't seem to have any other
examples of doing that in the docs, though.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue6108] unicode(exception) and str(exception) should return the same message on Py2.6

2009-12-11 Thread Ezio Melotti

Ezio Melotti  added the comment:

In r64791, BaseException gained a new __unicode__ method that does the
equivalent of the following things:
 * if the number of args is 0, returns u''
 * if it's 1 returns unicode(self.args[0])
 * if it's >1 returns unicode(self.args)

Before this, BaseException only had a __str__ method, so unicode(e)
(with e being an exception derived from BaseException) called:
 * e.__str__().decode(), if e didn't implement __unicode__
 * e.__unicode__(), if e implemented an __unicode__ method

Now, all the derived exceptions that don't implement their own
__unicode__ method inherit the "generic" __unicode__ of BaseException,
and they use that instead of falling back on __str__.
This is generally ok if the numbers of args is 0 or 1, but if there are
more args, there's usually some specific formatting in the __str__
method that is lost when BaseException.__unicode__ returns
unicode(self.args).

Possible solutions:
 1) implement a __unicode__ method that does the equivalent of calling
unicode(str(self)) (i.e. converting to unicode the message returned by
__str__ instead of converting self.args);
 2) implement a __unicode__ method that formats the message as __str__
for all the exceptions with a __str__ that does some specific formatting;

Attached there's a proof of concept (issue6108.diff) where I tried to
implement the first method with UnicodeDecodeError. This method can be
used as long as __str__ always returns only ascii.

The patch seems to work fine for me (note: this is my first attempt to
use the C API). If the approach is correct I can do the same for the
other exceptions too and submit a proper patch.

--
assignee:  -> ezio.melotti
keywords: +patch
Added file: http://bugs.python.org/file15529/issue6108.diff

___
Python tracker 

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



[issue7483] str.format behaviour changed from Python 2.6

2009-12-11 Thread Jeong-Min Lee

New submission from Jeong-Min Lee :

In Python 2.6,

>>> '{0:0<30}'.format(1)
'10'
>>> '{0:-<30}'.format(1)
'1-'


In Python 2.7a / 3.1,

>>> '{0:0<30}'.format(1)
'01'
>>> '{0:-<30}'.format(1)
'1-'

--
components: Interpreter Core
messages: 96282
nosy: falsetru
severity: normal
status: open
title: str.format behaviour changed from Python 2.6
type: behavior
versions: Python 2.7, Python 3.1

___
Python tracker 

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



[issue7483] str.format behaviour changed from Python 2.6

2009-12-11 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee:  -> eric.smith
nosy: +eric.smith

___
Python tracker 

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



[issue7483] str.format behaviour changed from Python 2.6

2009-12-11 Thread Ezio Melotti

Ezio Melotti  added the comment:

The problem seems to be in Objects/stringlib/formatter.h at line 472:
if (format->fill_char == '0')
spec->n_min_width = format->width - n_non_digit_non_padding;
else
spec->n_min_width = 0;

I tried to comment out that part and leave just the "spec->n_min_width =
0;" and '{0:0<30}'.format(1) returned the correct result.
Even if it showed that the problem is there, this is probably the wrong
solution.

--
nosy: +ezio.melotti
priority:  -> high
versions: +Python 3.2

___
Python tracker 

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



[issue1615158] POSIX capabilities support

2009-12-11 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +needs review

___
Python tracker 

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



[issue7484] smtplib: verify breaks with Postfix servers

2009-12-11 Thread Manuel Pégourié-Gonnard

New submission from Manuel Pégourié-Gonnard :

Hi,

The verify method of SMTP objects created with smtplib doesn't work
properly with servers running Postfix, due to quoting problems: the
address is enclosed in pointed brackets by the method, which changes the
way it is interpreted by the server.

The attached demo file uses the mx1.nic.fr server, which runs Postfix
and exhibits the problem at the time of the writing.

RFC 5321 says the argument of VRFY is a string representing a "user
name", without saying much about what a "user name" is, but nothing
suggests it should be quoted in pointed brackets. Moreover, the example
in D.4 doens't use any quoting. 

Anyway, even if Postfix was wrong, I think it would be worth trying to
support it, since it is quite widely used.

Thanks!

--
components: Library (Lib)
files: bsl.py
messages: 96284
nosy: mpg
severity: normal
status: open
title: smtplib: verify breaks with Postfix servers
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file15530/bsl.py

___
Python tracker 

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