[issue7994] object.__format__ should reject format strings

2010-03-30 Thread Eric Smith

Eric Smith  added the comment:

Meador: Your patch (-3) looks identical to mine (-2), unless I'm making some 
mistake. Could you check? I'd like to get this applied in the next few days, 
before 2.7b1.

Thanks!

--

___
Python tracker 

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



[issue8193] test_zlib fails with zlib 1.2.4

2010-03-30 Thread Valerio

Valerio  added the comment:

Now i make patches for other versions of Python. 
How i try if the patched test still work with the older zlib?

--

___
Python tracker 

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



[issue8193] test_zlib fails with zlib 1.2.4

2010-03-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'm not sure simply changing the value is the right thing to do - with older 
zlib versions (which do the wrong thing with 0), we definitely want that 
exception to be triggered.

For newer versions, we want to check that passing in 0 worked as specified in 
the zlib patch note and that -1 still raises the exception.

Changing the test behaviour based on zlib.ZLIB_VERSION is likely the best 
option.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue8193] test_zlib fails with zlib 1.2.4

2010-03-30 Thread Valerio

Valerio  added the comment:

Seems that from Python 2.6 to 3.2 the test work fine. With -1 still raises the 
exception. By the way, the original problem of Arkadiusz was with Python 2.5.

--

___
Python tracker 

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



[issue8193] test_zlib fails with zlib 1.2.4

2010-03-30 Thread Valerio

Valerio  added the comment:

The original test, with 0, pass in all versions of Python, from 2.6 to 3.2.

--

___
Python tracker 

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



[issue8263] regrtest stops prematurately on FreeBSD buildbot, with "success" result.

2010-03-30 Thread Florent Xicluna

New submission from Florent Xicluna :

The regrtest returns "success", even if the test suite is not run completely.
The last running test is "test_unittest".


http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%20trunk/builds/171
...
51 tests OK.
2 tests skipped:
test_ascii_formatd test_py3kwarn
1 skip unexpected on freebsd6:
test_ascii_formatd
[294584 refs]
program finished with exit code 0
elapsedTime=1082.949696

http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%20trunk/builds/168
...
37 tests OK.
5 tests skipped:
test_bsddb185 test_macostools test_py3kwarn test_startfile
test_winreg
1 skip unexpected on freebsd6:
test_bsddb185
[184731 refs]
program finished with exit code 0
elapsedTime=507.756584

--
components: Tests
keywords: buildbot
messages: 101926
nosy: flox, michael.foord
priority: normal
severity: normal
stage: test needed
status: open
title: regrtest stops prematurately on FreeBSD buildbot, with "success" result.
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue8263] regrtest stops prematurately on FreeBSD buildbot, with "success" result.

2010-03-30 Thread Michael Foord

Michael Foord  added the comment:

I wonder if unittest.test.test_break runs and the signals.SIGINT it sends 
terminates a process early? Do you have access to this platform to try it 
Florent?

--

___
Python tracker 

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



[issue8264] hasattr doensn't show private (double underscore) attributes exist

2010-03-30 Thread Nick Craig-Wood

New submission from Nick Craig-Wood :

I just spend a while tracking down a bug in my code which turned out to be an 
unexpected behaviour of hasattr.

Running this

class Test(object):
def __init__(self):
self.__private = "Hello"
def test(self):
print(self.__private)
print(hasattr(self, "__private"))
print(getattr(self, "__private"))


t = Test()
t.test()

Prints

>>> t.test()
Hello
False
Traceback (most recent call last):
  File "private_test.py", line 10, in 
t.test()
  File "private_test.py", line 7, in test
print(getattr(self, "__private"))
AttributeError: 'Test' object has no attribute '__private'
>>>

Indicating that even though we just printed self.__private hasattr() can't find 
it nor getattr().

I think this is probably the intended behaviour, but it does seem inconsistent.

Probably all that is required is a documentation patch...

Maybe something add something like this to the end of

  http://docs.python.org/library/functions.html#hasattr

Note that hasattr won't find private (double underscore) attributes unless the 
mangled name is used.

--
components: Interpreter Core
messages: 101928
nosy: ncw
severity: normal
status: open
title: hasattr doensn't show private (double underscore) attributes exist
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue8265] test_float fails on ARM Linux EABI

2010-03-30 Thread Florent Xicluna

New submission from Florent Xicluna :

All the ARM Linux EABI buildbots fail on the same test.

http://www.python.org/dev/buildbot/all/builders/ARM%20Linux%20EABI%202.6/builds/5

test_float
test test_float failed -- Traceback (most recent call last):
  File 
"/home/pybot/buildarea-armeabi/2.6.klose-linux-armeabi/build/Lib/test/test_float.py",
 line 665, in test_from_hex
self.identical(fromHex('0x0.d6p-1022'), MIN-3*TINY)
  File 
"/home/pybot/buildarea-armeabi/2.6.klose-linux-armeabi/build/Lib/test/test_float.py",
 line 375, in identical
self.fail('%r not identical to %r' % (x, y))
AssertionError: 2.2250738585071999e-308 not identical to 2.2250738585071984e-308

--
components: Interpreter Core
keywords: buildbot
messages: 101929
nosy: flox, mark.dickinson
priority: normal
severity: normal
stage: needs patch
status: open
title: test_float fails on ARM Linux EABI
type: behavior
versions: Python 2.6, Python 2.7, 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



[issue3409] ElementPath.Path.findall problem with unicode input

2010-03-30 Thread Neil Muller

Neil Muller  added the comment:

With the recent ElementTree changes on trunk, this bug no longer applies, 
AFAICS.

--
nosy: +Neil Muller, flox

___
Python tracker 

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



[issue8265] test_float fails on ARM Linux EABI

2010-03-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Same failure on trunk:
http://www.python.org/dev/buildbot/all/builders/ARM%20Linux%20EABI%20trunk/builds/12

--

___
Python tracker 

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



[issue3409] ElementPath.Path.findall problem with unicode input

2010-03-30 Thread Florent Xicluna

Changes by Florent Xicluna :


--
priority:  -> normal
resolution:  -> out of date
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



[issue8264] hasattr doensn't show private (double underscore) attributes exist

2010-03-30 Thread R. David Murray

R. David Murray  added the comment:

You are correct, this is the expected behavior.  Name mangling happens only at 
compilation time (see 
http://docs.python.org/reference/expressions.html#atom-identifiers).  A doc 
note for get/setattr would probably be useful.

(I removed 3.3; that version doesn't exist yet and should only be set on issues 
that can only be dealt with in 3.3, such as removing something deprecated in 
3.2.)

--
assignee:  -> georg.brandl
components: +Documentation -Interpreter Core
nosy: +georg.brandl, r.david.murray
priority:  -> normal
stage:  -> needs patch
versions:  -Python 3.3

___
Python tracker 

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



[issue8193] test_zlib fails with zlib 1.2.4

2010-03-30 Thread Valerio

Valerio  added the comment:

I try again and ValueError not raised. The test pass without problem, both 
Python 2.6 and next.

--

___
Python tracker 

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



[issue8193] test_zlib fails with zlib 1.2.4

2010-03-30 Thread Valerio

Valerio  added the comment:

P.S: the value it's default, 0.

--

___
Python tracker 

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



[issue1028432] Specify a source baseurl for bdist_rpm.

2010-03-30 Thread Neil Muller

Neil Muller  added the comment:

> Is it preferable to specify a URL for the "Source"
> field in a .spec file (rather than just a filename)?

Fedora (see for example http://fedoraproject.org/wiki/Packaging/SourceURL ) 
encourages using a full url when available, so having some way of specifying 
the url looks like a useful addition to me.

--
nosy: +Neil Muller

___
Python tracker 

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



[issue8263] regrtest stops prematurately on FreeBSD buildbot, with "success" result.

2010-03-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Sorry, but I don't have such environment.

Proposed patch will add a notice if the regrtest is interrupted (Ctrl+C).
And the exitcode is set to 1, meaning test failed for the buildbot.

--
keywords: +patch
Added file: http://bugs.python.org/file16697/issue8263_regtest_SIGINT.diff

___
Python tracker 

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



[issue8263] regrtest stops prematurately on FreeBSD buildbot, with "success" result.

2010-03-30 Thread Michael Foord

Michael Foord  added the comment:

That sounds very useful from a diagnostic point of view. If it does turn out to 
be the problem then we will have to disable the test for that platform. At the 
moment test_break runs on all platforms that have os.kill(...).

--

___
Python tracker 

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



[issue8263] regrtest stops prematurately on FreeBSD buildbot, with "success" result.

2010-03-30 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file16697/issue8263_regtest_SIGINT.diff

___
Python tracker 

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



[issue8263] regrtest stops prematurately on FreeBSD buildbot, with "success" result.

2010-03-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Slightly different, with a count of omitted tests
And removed "All .. tests OK" is there's some tests omitted.

--
Added file: http://bugs.python.org/file16698/issue8263_regtest_SIGINT_v2.diff

___
Python tracker 

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



[issue8266] tarfile library should support xz compression

2010-03-30 Thread tdjacr

Changes by tdjacr :


--
nosy: thedjatclubrock
severity: normal
status: open
title: tarfile library should support xz compression
type: feature request
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue8266] tarfile library should support xz compression

2010-03-30 Thread tdjacr

New submission from tdjacr :

See http://bugs.python.org/issue6715 for more info regarding support of .xz in 
general

--

___
Python tracker 

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



[issue8266] tarfile library should support xz compression

2010-03-30 Thread tdjacr

tdjacr  added the comment:

https://launchpad.net/pyliblzma may help?

--
components: +Library (Lib)
versions:  -Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 
3.3

___
Python tracker 

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



[issue6715] xz compressor support

2010-03-30 Thread tdjacr

tdjacr  added the comment:

Once xz is implemented, xz compatibility should be added to the tarfile library.

--
nosy: +thedjatclubrock

___
Python tracker 

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



[issue8266] tarfile library should support xz compression

2010-03-30 Thread Brian Curtin

Brian Curtin  added the comment:

Duplicate of #5689.

--
nosy: +brian.curtin
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue7994] object.__format__ should reject format strings

2010-03-30 Thread Meador Inge

Meador Inge  added the comment:

Hi Eric,

(-2) and (-3) are different.  The changes that I made, however, are pretty 
minor.  Also, they are all in 'test_builtin.py'.

--

___
Python tracker 

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-30 Thread Cyril

Cyril  added the comment:

> Hmm, indeed. What you can do, very simply, is cache the getvalue()
> result once you have generated it.

After some thoughts, it's not really an option: my cStringIO.StringIO buffer 
is, well a buffer. To append data to the buffer, I call buffer.write(). When 
I've got a chance to send data over the socket (remember, it's async, so I 
don't really know when it's going to happen), I call buffer.getvalue().

If socket.write() returns zero byte written, I'll have to wait until I get 
another chance to send my buffer. But in the meantime, some more data might get 
appended to the buffer, and the string returned by getvalue() will be different 
from the first call (and thus, I can't really cache it).

I could find some tricks (like using multiple buffers), but it would be ugly.

--

___
Python tracker 

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



[issue7643] What is a Unicode line break character?

2010-03-30 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Which functions are affected by this change?
Py_UNICODE_ISLINEBREAK()? unicode.splitlines()?

--
assignee:  -> flox
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> If socket.write() returns zero byte written, I'll have to wait until I
> get another chance to send my buffer. But in the meantime, some more
> data might get appended to the buffer, and the string returned by
> getvalue() will be different from the first call (and thus, I can't
> really cache it).
> 
> I could find some tricks (like using multiple buffers), but it would
> be ugly.

Right. I think we should somehow support your use case, but I'm not sure
whether it should be the default.

--

___
Python tracker 

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



[issue8263] regrtest stops prematurately on FreeBSD buildbot, with "success" result.

2010-03-30 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file16698/issue8263_regtest_SIGINT_v2.diff

___
Python tracker 

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



[issue8263] regrtest stops prematurately on FreeBSD buildbot, with "success" result.

2010-03-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Regrtest.py fixed with r79497 to report keyboard interrupt as a "failure".

--

___
Python tracker 

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



[issue7643] What is a Unicode line break character?

2010-03-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Committed to trunk: r79494 and r79496.

Afaict, it changes Py_UNICODE_ISLINEBREAK, _PyUnicode_IsLinebreak and the 
Unicode functions which depend on it (splitlines(), _sre module).

--

___
Python tracker 

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



[issue8265] test_float fails on ARM Linux EABI

2010-03-30 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Matthias, can you please take a look?

--
nosy: +doko, loewis

___
Python tracker 

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



[issue3326] py3k shouldn't use -fno-strict-aliasing anymore

2010-03-30 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Thanks for the patch. Applied in r79499.

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



[issue1553375] Add traceback.print_full_exception()

2010-03-30 Thread Pascal Chambon

Changes by Pascal Chambon :


--
nosy: +pakal

___
Python tracker 

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



[issue3135] inspect.getcallargs()

2010-03-30 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Applied in r79500. Note I removed the error checking that a bound method 
received an instance of the class as the first argument because that error 
checking is a function of the calling of the function, not the binding of the 
arguments.

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

___
Python tracker 

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



[issue8248] Add test cases for bool

2010-03-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed in r79502, r79504 (trunk) and r79503 (py3k). Thank you!

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



[issue8267] Tutorial secion on dictionary keys recommends sort instead of sorted

2010-03-30 Thread Kent Engström

New submission from Kent Engström :

The 2.[567] documentation recommends the use of the sort() method
to get a sorted list of dictionary keys. If would be less confusing
to new users if we recommended the sorted() functions instead.

The corresponding piece of Python 3 documentation already uses
the sorted() function.

--
assignee: georg.brandl
components: Documentation
files: dict.patch
keywords: patch
messages: 101953
nosy: georg.brandl, kent
severity: normal
status: open
title: Tutorial secion on dictionary keys recommends sort instead of sorted
versions: Python 2.5, Python 2.6, Python 2.7
Added file: http://bugs.python.org/file16699/dict.patch

___
Python tracker 

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



[issue8267] Tutorial section on dictionary keys recommends sort instead of sorted

2010-03-30 Thread Kent Engström

Changes by Kent Engström :


--
title: Tutorial secion on dictionary keys recommends sort instead of sorted -> 
Tutorial section on dictionary keys recommends sort instead of sorted

___
Python tracker 

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



[issue8265] test_float fails on ARM Linux EABI with soft floating point

2010-03-30 Thread Matthias Klose

Matthias Klose  added the comment:

the buildbot labeled "ARM Linux 3.x" is an ARM EABI as well, compiler defaults 
-march=armv7 -math=vfp -float-abi=softfp.

The failing test_float test is an ARM EABI, armv4, ARM mode, soft floating 
point. I never did see the test_float test suceed on this 
platform/configuration.

--
title: test_float fails on ARM Linux EABI -> test_float fails on ARM Linux EABI 
with soft floating point

___
Python tracker 

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



[issue7643] What is a Unicode line break character?

2010-03-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Ported to 3.x with r79506

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



[issue8256] TypeError: bad argument type for built-in operation

2010-03-30 Thread Filip Gruszczyński

Filip Gruszczyński  added the comment:

I have read, that I shouldn't directly use Py_FileSystemDefaultEncoding and 
rather use PyUnicode_GetDefaultEncoding, so I have changed the code a little.

--
Added file: http://bugs.python.org/file16700/8256_3.patch

___
Python tracker 

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



[issue8256] TypeError: bad argument type for built-in operation

2010-03-30 Thread Filip Gruszczyński

Changes by Filip Gruszczyński :


Removed file: http://bugs.python.org/file16688/8256_1.patch

___
Python tracker 

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



[issue8256] TypeError: bad argument type for built-in operation

2010-03-30 Thread Filip Gruszczyński

Changes by Filip Gruszczyński :


Removed file: http://bugs.python.org/file16689/8256_2.patch

___
Python tracker 

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



[issue8268] Make old-style classes weak referenceable

2010-03-30 Thread Antoine Pitrou

New submission from Antoine Pitrou :

New-style classes are weak referenceable, but old-style classes are not.
For a proper implementation of ABC caches without any memory leaks (see 
issue2521), this limitation should be raised.

--
components: Interpreter Core
messages: 101957
nosy: pitrou, stutzbach
priority: normal
severity: normal
stage: needs patch
status: open
title: Make old-style classes weak referenceable
type: feature request
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



[issue2521] ABC caches should use weak refs

2010-03-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
dependencies: +Make old-style classes weak referenceable

___
Python tracker 

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



[issue8268] Make old-style classes weak referenceable

2010-03-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch.

--
keywords: +patch
nosy: +amaury.forgeotdarc
stage: needs patch -> patch review
Added file: http://bugs.python.org/file16701/weakref-classobj.patch

___
Python tracker 

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



[issue8268] Make old-style classes weak referenceable

2010-03-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file16701/weakref-classobj.patch

___
Python tracker 

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



[issue8268] Make old-style classes weak referenceable

2010-03-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file16702/weakref-classobj.patch

___
Python tracker 

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



[issue8269] Missing return values for PyUnicode C/API functions

2010-03-30 Thread Arnaud Fontaine

New submission from Arnaud Fontaine :

For example, PyUnicode_FromFormat() does not specify the return value but it 
does not seem to be only one. I only have a basic knowledge of Python C/API, so 
I am not sure whether it is meaningful.

--
assignee: georg.brandl
components: Documentation
messages: 101959
nosy: arnau, georg.brandl
severity: normal
status: open
title: Missing return values for PyUnicode C/API functions
type: feature request
versions: Python 2.6, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue2521] ABC caches should use weak refs

2010-03-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hmm, Benjamin pointed out that ABCs only support new-style classes, so 
old-style classes could be detected early instead of being added to the 
_abc_negative_cache.

--

___
Python tracker 

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



[issue2521] ABC caches should use weak refs

2010-03-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

By the way, Daniel, your patch doesn't look right.
First, you shouldn't need all the sortedlist/sortedset hierarchy.
Second, len(gc.get_objects()) is a truly horrible way of checking the classes 
have been destroyed. Just take a weakref to the class before deleting it, and 
check that calling the weakref returns None.
(besides, we also have a refleak-detection run (regrtest -R) which can detect 
leaks even if you don't check them explicitly in your tests)

--

___
Python tracker 

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



[issue2521] ABC caches should use weak refs

2010-03-30 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

I hadn't realized that old style classes didn't support ABCs.  That certainly 
simplifies things!  I'm working on a new patch.

--

___
Python tracker 

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



[issue2521] ABC caches should use weak refs

2010-03-30 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

Are you sure the old-style classes don't support ABCs?

ABCTestCase.validate_isinstance in Lib/test/test_collection.py specifically 
tests that both new-style and old-style classes work, unless I'm reading it 
wrong.

(and those tests fail if I make ABCMeta.__instancecheck__ and 
ABCMeta.__subclasscheck__ always return False for old-style classes)

--

___
Python tracker 

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



[issue2521] ABC caches should use weak refs

2010-03-30 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

In those cases, it's because __subclasscheck__ is overridden. You can't 
register a old-style class.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue2521] ABC caches should use weak refs

2010-03-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

> ABCTestCase.validate_isinstance ... specifically tests that
> both new-style and old-style classes work...

I fixed some parts with issue #7624, and changeset r78800.

--

___
Python tracker 

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



[issue8270] Should socket.PF_PACKET be removed, in favor of socket.AF_PACKET?

2010-03-30 Thread Denilson Figueiredo de Sá

New submission from Denilson Figueiredo de Sá :

If you look at socket module, there are around 29 AF_* constants (like AF_INET).

On the other hand, there is only one PF_ constant: PF_PACKET. This constant is 
also defined as AF_PACKET.

Following the "There should be one-- and preferably only one --obvious way to 
do it." advice, Python 3 removed the <> operator.  I know it's a bit late to 
change things in Python 3, but should socket.PF_PACKET be removed, in favor of 
socket.AF_PACKET? (of course, before being removed, it would be left as 
deprecated for quite some time)

--
messages: 101966
nosy: denilsonsa
severity: normal
status: open
title: Should socket.PF_PACKET be removed, in favor of socket.AF_PACKET?

___
Python tracker 

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



[issue8270] Should socket.PF_PACKET be removed, in favor of socket.AF_PACKET?

2010-03-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: +Library (Lib)
nosy: +loewis
priority:  -> low
type:  -> behavior
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



[issue8269] Missing return values for PyUnicode C/API functions

2010-03-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +lemburg

___
Python tracker 

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



[issue2521] ABC caches should use weak refs

2010-03-30 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

You can't register an old-style class, but many ABCs support duck-typing by 
implementing __subclasshook__.  ABCMeta caches those results and stores a 
reference to old-style classes, sometimes in _abc_cache and sometimes in 
_abc_negative_cache.  It can't simply return False.

I guess that leaves two options:

1) Make old-style classes weak-referenceable and cache the results of 
__subclasshook__.
2) Refuse to cache old-style classes and call __subclasshook__ every time for 
old-style classes.

Python 2.7a4+ (trunk:79493, Mar 30 2010, 19:19:13)
>>> class old_iterable_class:
...   def __iter__(self):
... pass
...
>>> import collections
>>> issubclass(old_iterable_class, collections.Iterable)
True

--

___
Python tracker 

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



[issue8208] test_issue7820 fails: "name '?' is not defined"

2010-03-30 Thread Shashwat Anand

Shashwat Anand  added the comment:

I did not find any issue here.

Trunk running on OS X 10.6.2:

06:25:00 l0nwlf-MBP:test $ python2.7 -V
Python 2.7a4+
06:25:05 l0nwlf-MBP:test $ python2.7 test_pep263.py 
test_compilestring (__main__.PEP263Test) ... ok
test_issue3297 (__main__.PEP263Test) ... ok
test_issue7820 (__main__.PEP263Test) ... ok
test_pep263 (__main__.PEP263Test) ... ok

--
Ran 4 tests in 0.003s

OK

--
nosy: +l0nwlf

___
Python tracker 

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



[issue1083] Confusing error message when dividing timedelta using /

2010-03-30 Thread Shashwat Anand

Shashwat Anand  added the comment:

I do not understand why python2.7 is marked in Version tag ?

I reproduced the error on 3.1 but no isues on 2.7

06:39:30 l0nwlf-MBP:data $ python2.7
Python 2.7a4+ (trunk:78750, Mar  7 2010, 08:09:00) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> d = datetime.timedelta(1)
>>> d / 2
datetime.timedelta(0, 43200)
>>> d // 2
datetime.timedelta(0, 43200)
>>> 

06:41:13 l0nwlf-MBP:data $ python3.1
Python 3.1.1 (r311:74480, Mar 21 2010, 20:21:46) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> d = datetime.timedelta(1)
>>> d / 2
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for /: 'datetime.timedelta' and 'int'
>>> d // 2
datetime.timedelta(0, 43200)
>>>

--
nosy: +l0nwlf

___
Python tracker 

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



[issue7040] test_smtplib fails on os x 10.6

2010-03-30 Thread Shashwat Anand

Changes by Shashwat Anand :


--
nosy: +l0nwlf

___
Python tracker 

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



[issue1693050] \w not helpful for non-Roman scripts

2010-03-30 Thread Shashwat Anand

Changes by Shashwat Anand :


--
nosy: +l0nwlf

___
Python tracker 

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



[issue1220212] os.kill on windows

2010-03-30 Thread Brian Curtin

Brian Curtin  added the comment:

Here is a patch with some tests and doc changes.

I'm having trouble coming up with tests which will work with CTRL_C_EVENT and 
CTRL_BREAK_EVENT. Based on my understanding of GenerateConsoleCtrlEvent, I 
figured this example 
(http://msdn.microsoft.com/en-us/library/ms685049%28v=VS.85%29.aspx) would be 
receptive to CTRL+C when started as a subprocess, but it doesn't work. I also 
figured "python -c "input()"" started as a subprocess could be killed with 
CTRL_C_EVENT, but it doesn't work either.

--
Added file: http://bugs.python.org/file16703/issue1220212.patch

___
Python tracker 

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



[issue7245] better Ctrl-C support in pdb (program can be resumed) (issue216067)

2010-03-30 Thread Ilya Sandler

Ilya Sandler  added the comment:

Is there anything else I can do for this patch?

--

___
Python tracker 

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



[issue8271] str.decode('utf8', 'replace') -- conformance with Unicode 5.2.0

2010-03-30 Thread John Machin

New submission from John Machin :

Unicode 5.2.0 chapter 3 (Conformance) has a new section (headed "Constraints on 
Conversion Processes) after requirement D93. Recent Pythons e.g. 3.1.2 don't 
comply. Using the Unicode example:

 >>> print(ascii(b"\xc2\x41\x42".decode('utf8', 'replace')))
 '\ufffdB'
 # should produce u'\ufffdAB'

Resynchronisation currently starts at a position derived by considering the 
length implied by the start byte:

 >>> print(ascii(b"\xf1ABCD".decode('utf8', 'replace')))
 '\ufffdD'
 # should produce u'\ufffdABCD'; resync should start from the *failing* byte.

Notes: This applies to the 'ignore' option as well as the 'replace' option. The 
Unicode discussion mentions "security exploits".

--
messages: 101972
nosy: sjmachin
severity: normal
status: open
title: str.decode('utf8', 'replace') -- conformance with Unicode 5.2.0
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



[issue1220212] os.kill on windows

2010-03-30 Thread Brian Curtin

Changes by Brian Curtin :


Removed file: http://bugs.python.org/file16703/issue1220212.patch

___
Python tracker 

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



[issue1220212] os.kill on windows

2010-03-30 Thread Brian Curtin

Brian Curtin  added the comment:

Removed an unnecessary goto and fixed a few tab/space inconsistencies (ugh).

--
Added file: http://bugs.python.org/file16704/issue1220212.patch

___
Python tracker 

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



[issue8225] Wrong link in xml.etree documentation

2010-03-30 Thread Brian Curtin

Brian Curtin  added the comment:

Fixed in trunk (r79518), release26-maint (r79519), py3k (r79520), and 
release31-maint (r79521).

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions: +Python 2.7, 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



[issue1578269] Add os.symlink() and os.path.islink() support for Windows

2010-03-30 Thread Brian Curtin

Brian Curtin  added the comment:

Anyone opposed to this being checked in? Other than some style issues which 
I'll fix on checkin, I believe this is ready to go. I'd like to get it in so I 
can backport it to 2.7 before the beta on Saturday.

--
assignee: eric.smith -> brian.curtin

___
Python tracker 

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



[issue1578269] Add os.symlink() and os.path.islink() support for Windows

2010-03-30 Thread Eric Smith

Eric Smith  added the comment:

I had some style issues at one point, but I haven't looked at it closely 
recently. I won't have time to look at this before next week, so proceed 
without me.

--

___
Python tracker 

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



[issue1578269] Add os.symlink() and os.path.islink() support for Windows

2010-03-30 Thread sorin

sorin  added the comment:

For me the patch worked. It would be really nice to have it in 2.7 - I really 
hate Python functions that are not working on Windows.

--

___
Python tracker 

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



[issue8272] Odd exception messages when using cStringIO.StringIO instances as callables.

2010-03-30 Thread workshed

New submission from workshed :

Just a minor nit (or I'm missing something), but the results of trying to use a 
cStringIO.StringIO instance as a callable look wrong to me.  It should of 
course raise an exception, but shouldn't the 'cStringIO.StringO' and 
'cStringIO.StringI' strings reported in the errors below both read 
'cStringIO.StringIO'?


wins...@eee:~/Python-2.6.5$ ./python
Python 2.6.5 (r265:79063, Mar 30 2010, 22:38:30)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cStringIO
>>> cStringIO.StringIO()()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'cStringIO.StringO' object is not callable
>>> cStringIO.StringIO('')()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'cStringIO.StringI' object is not callable

I get the same results on my Ubuntu 9.10 system with a new build of 2.6.5 and 
the built in 2.6.4, as well as the 2.5.4 and 2.4.6 versions available in the 
repos.

Workshed

--
components: Library (Lib)
messages: 101978
nosy: workshed
severity: normal
status: open
title: Odd exception messages when using cStringIO.StringIO instances as 
callables.
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



[issue8272] Odd exception messages when using cStringIO.StringIO instances as callables.

2010-03-30 Thread Eric Smith

Eric Smith  added the comment:

cStringIO.StringIO is a factory function, so those messages are correct. This 
is mentioned in http://docs.python.org/library/stringio.html#module-cStringIO .

--
nosy: +eric.smith
resolution:  -> 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



[issue8260] When I use codecs.open(...) and f.readline() follow up by f.read() return bad result

2010-03-30 Thread Daniel Diniz

Daniel Diniz  added the comment:

Hi Stephane,

I think you're seeing different buffering behavior, which I suspect is correct 
according to docs.

codecs.open should default to line buffering[1], while open uses the system 
default[2].

The read() where the assert fails is returning the remaining buffer from the 
readline (which read 72 chars).

Asserting e.g. "f.read(1024) == ..." will give you the expected result.

[1] http://docs.python.org/library/codecs.html#codecs.open
[2] http://docs.python.org/library/functions.html#open

--
nosy: +ajaksu2
priority:  -> normal
stage:  -> test needed

___
Python tracker 

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



[issue8198] Importing pydoc and overwriting sys.stdout, causes one char to be sent to the console when calling help()

2010-03-30 Thread Daniel Diniz

Daniel Diniz  added the comment:

Nice buglet, please take a look at Lib/pydoc.py to follow :)

As you point out, this is issue 1700304.
 
'plainpager', which outputs the help in these cases, uses 
'sys.stdout.write(plain(text))', but Helper.help has a 
"self.output.write('\n')" line that causes the behavior you see.

We could change "self.output.write('\n')" to "pager('\n')", but the real bug is 
that self.output is bound early to sys.stdout. So 'help()' is still redirecting 
to the old sys.stdout with your test.

I see a solution by turning Helper.output into a property, but it smells of 
over-engineering :) Passing all output to pagers should work too, unless we 
need Helper.output as a sort of sys.stderr.

The patch below shows that importing pydoc sets self.output prematurely and 
includes the "self.output.write('\n')" line.

Index: pydoc.py
===
--- pydoc.py(revision 79447)
+++ pydoc.py(working copy)
@@ -1765,6 +1765,7 @@
 elif isinstance(request, Helper): self()
 else: doc(request, 'Help on %s:')
 self.output.write('\n')
+print >> sys.stderr, repr(self.output)

 def intro(self):
 self.output.write('''

--
dependencies: +pydoc.help samples sys.stdout and sys.stdin at import time
keywords: +easy
nosy: +ajaksu2
priority:  -> low
stage:  -> test needed
type:  -> behavior

___
Python tracker 

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



[issue1700304] pydoc.help samples sys.stdout and sys.stdin at import time

2010-03-30 Thread Daniel Diniz

Daniel Diniz  added the comment:

>From #8198:

I see a solution by turning Helper.output into a property, but it smells of 
over-engineering :) Passing all output to pagers should work too, unless we 
need Helper.output as a sort of sys.stderr.

--
keywords: +easy
nosy: +ajaksu2

___
Python tracker 

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



[issue8271] str.decode('utf8', 'replace') -- conformance with Unicode 5.2.0

2010-03-30 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Unicode
nosy: +ezio.melotti
priority:  -> normal
stage:  -> test needed
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



[issue8269] Missing return values for PyUnicode C/API functions

2010-03-30 Thread Ezio Melotti

Ezio Melotti  added the comment:

if you are referring to 
http://docs.python.org/dev/py3k/c-api/unicode.html#PyUnicode_FromFormat the 
return type is a PyObject.

See also http://docs.python.org/dev/py3k/c-api/structures.html#PyObject

--
nosy: +ezio.melotti
priority:  -> normal

___
Python tracker 

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