[issue4239] Email example should use SMTP.quit() rather than SMTP.close()

2008-10-30 Thread Matt Johnston

Matt Johnston [EMAIL PROTECTED] added the comment:

Another problem with that example - the .connect() isn't required and
causes the SMTP session to fail to send anything and time out.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4239
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4240] parasite form feed character in email.mime.text

2008-10-30 Thread Tarek Ziadé

New submission from Tarek Ziadé [EMAIL PROTECTED]:

Hi, 

There's a parasite form feed character in email/mime/text.py 
(as well in python 2.4 and 2.5)

I caught that under vim (^L), it is located line 12 in the file,
the line before the class definition starts

--
components: Library (Lib)
messages: 75356
nosy: tarek
severity: normal
status: open
title: parasite form feed character in email.mime.text
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4240
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-30 Thread Amaury Forgeot d'Arc

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

'rt' is a valid mode for open() or io.open().
But io.FileIO is the unbuffered raw binary file...

Python 2.6 has exactly the same problem and displays the same
RuntimeWarning.

Christian, the change you propose does not fix another case:
 io.FileIO([])

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4237
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4238] BSD support for multiprocessing.cpu_count

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

I prefer to use the test sys.platform in ('darwin', 'bsd') ;-)

--
nosy: +haypo

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4238
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4240] parasite form feed character in email.mime.text

2008-10-30 Thread Amaury Forgeot d'Arc

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

PEP 8 does not call them parasites:
http://www.python.org/dev/peps/pep-0008/


Python accepts the control-L (i.e. ^L) form feed character as
whitespace; Many tools treat these characters as page separators, so you
may use them to separate pages of related sections of your file.


--
nosy: +amaury.forgeotdarc
resolution:  - invalid
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4240
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4240] parasite form feed character in email.mime.text

2008-10-30 Thread Tarek Ziadé

Tarek Ziadé [EMAIL PROTECTED] added the comment:

so basically, if I open email.py, it is perfectly OK to have is opened
in two pages in an editor ?

How weird ! 


PEP 8 also says that we should be consistent throughout a code base.

If this was the case everywhere in sdtlib, I'd say ok, but imho this
should be removed because this is the first time I see such a FF in there.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4240
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1248] ftplib needs a rewrite to use bytes/buffers

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

 So can we close this?

Yes: retrbinary() and storbinary() can be used to get/send bytes.

Reopen the issue (or open another one) if we miss another problem.

--
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1248
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4240] parasite form feed character in email.mime.text

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

^L is used for a printer to insert a new blank page. But who really 
print a source code on a printer? Or does some editor have a special 
usage of this *control sequence*?

It looks like ^L is used in Lib/smtpd.py as a hack for some editors so 
jump to the different classes, but there are other tools to jump to 
the classes.

--
nosy: +haypo

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4240
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3996] PyOS_CheckStack does not work

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

See also issue #3999: I wrote a new generic handler for stack 
overflow exception.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3996
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4036] Support bytes for subprocess.Popen()

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

@loewis: My patch only changes the behaviour of the POSIX version of 
subprocess, Windows version is unchanged.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4036
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4234] bin missing from documentation

2008-10-30 Thread Mark Dickinson

Mark Dickinson [EMAIL PROTECTED] added the comment:

In addition, the description of binary literals is missing from the 
lexical analysis section of the reference manual, as is the description
of new-style octal literals (i.e. 0o23 instead of 023).

Here's a patch (against the trunk;  2.6 also needs fixing).

--
keywords: +patch
nosy: +marketdickinson
versions: +Python 2.7
Added file: http://bugs.python.org/file11908/issue4234.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4234
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4241] zipfile.py - is_zipfile leaves file open when error

2008-10-30 Thread Eino Mäkitalo

New submission from Eino Mäkitalo [EMAIL PROTECTED]:

Very simple error.
If is_zipfile crashes when checking is_zipfile if zipfile is corrupted
or not at all zip. It leaves file open and prevents later to remove file
etc... Maybe it's corrected in next versions

Old code: zipfile...
  line 86:  endrec = _EndRecData(fpin)
  line 87:  fpin.close


My simple corrections to cope with this
try:
endrec = _EndRecData(fpin)
finally:
fpin.close()

--
components: Library (Lib)
messages: 75368
nosy: eino
severity: normal
status: open
title: zipfile.py - is_zipfile leaves file open when error
type: crash
versions: Python 2.5

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4241
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1069092] segfault on printing nested sequences of None/Ellipsis

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

I propose a generic solution in issue #3999 to catch stack overflow 
(and be able to continue after such exception).

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1069092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4240] parasite form feed character in email.mime.text

2008-10-30 Thread Tarek Ziadé

Tarek Ziadé [EMAIL PROTECTED] added the comment:

ok so it seems there are around 150 occurences, so I guess it is OK in
this particular code base :D

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4240
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4240] parasite form feed character in email.mime.text

2008-10-30 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

Perhaps final comment here.  The email package was authored by Barry
Warsaw.  That's the way he prefers to break his code into sections.
Definitely neither parasitic nor accidental.

Skip

--
nosy: +skip.montanaro

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4240
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-30 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

The new patch fixes the problem and adds a unit test, too.

The bug was caused by a design flaw -- which was partly my fault. Some
elements of the PyFileIOObject struct were initialized in __new__ while
other parts were initialized in __init__. I've moved the initialization
to __new__.

We should add a rule that all struct members must be properly
initialized in __new__. In the past Victor's fuzzying tool has revealed
several crashers related to similar design flaws.

I'm raising the severity of the bug to release blocker because I can't
predict if the problem can be abused to crash the interpreter. We should
also review all __new__ and __init__ methods of objects and extension
modules for similar issues.

--
assignee:  - barry
components: +Interpreter Core
nosy: +barry, haypo
priority: normal - release blocker
type:  - resource usage
versions: +Python 2.7
Added file: http://bugs.python.org/file11909/issue_4237.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4237
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4238] BSD support for multiprocessing.cpu_count

2008-10-30 Thread Eric Gillespie

Eric Gillespie [EMAIL PROTECTED] added the comment:

sys.platform is 'netbsd4', and presumably 'freebsd5' and so on, so that
won't work.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4238
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4238] BSD support for multiprocessing.cpu_count

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

@epg: Ooops, I read sys.platform == 'bsd'.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4238
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4242] Classify language vs. impl-detail tests, step 1

2008-10-30 Thread Armin Rigo

New submission from Armin Rigo [EMAIL PROTECTED]:

This patch contains a first step towards classifying CPython tests into
language tests and implementation-details tests.  The patch is against
the 2.7 trunk's test_descr.py.  It is derived from a similar patch that
we wrote for the 2.5's test_descr.py in order to make it pass on PyPy.

The main new feature introduced here is a couple of helpers in
test_support - see comments and docstrings in the patch.  The main ones
are check_impl_detail, which is a flag which is False on non-CPython
hosts; and impl_detail, a decorator to skip whole functions based on
the check_impl_detail flag.

If this patch is accepted, then we plan to port many more of PyPy's
patches for core tests, as a step towards helping non-CPython
implementations to obtain a good test suite.

--
components: Tests
files: test-impl-details.diff
keywords: patch, patch
messages: 75373
nosy: arigo, cfbolz
severity: normal
status: open
title: Classify language vs. impl-detail tests, step 1
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file11910/test-impl-details.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4242
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4243] has_key doc could be clearer

2008-10-30 Thread Terry J. Reedy

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

2.6 lib ref builtin types, mappings, has_key doc now says
dict.has_key(key) is equivalent to key in d, but deprecated.
Posters on c.l.p found this confusing.  Which is deprecated?
I agree that this could be confusing to a beginner.

D'Arcy J.M. Cain suggests
dict.has_key(key) is deprecated.  Use key in dict instead.
Or Use the replacement ...
Or Use the new version ...

--
assignee: georg.brandl
components: Documentation
messages: 75374
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: has_key doc could be clearer
versions: Python 2.6, Python 2.7

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4243
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-30 Thread Amaury Forgeot d'Arc

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

The patch looks fine to me

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4237
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4243] has_key doc could be clearer

2008-10-30 Thread Martin v. Löwis

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

Out of curiosity: is that really ambiguous in plain English?

--
nosy: +loewis

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4243
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4242] Classify language vs. impl-detail tests, step 1

2008-10-30 Thread Brett Cannon

Changes by Brett Cannon [EMAIL PROTECTED]:


--
nosy: +brett.cannon

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4242
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4242] Classify language vs. impl-detail tests, step 1

2008-10-30 Thread Brett Cannon

Brett Cannon [EMAIL PROTECTED] added the comment:

Based on your experience, Armin, is it worth having a class decorator as
well/instead?

The other comment I have is whether impl_detail is really the best name.
Would something like cpython work out better to be more obvious that the
test is specific for CPython? Otherwise would a naive PyPy use not
understand that the impl_detail tests are not meant for PyPy?

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4242
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4243] has_key doc could be clearer

2008-10-30 Thread Giampaolo Rodola'

Giampaolo Rodola' [EMAIL PROTECTED] added the comment:

English is not my first language but it seems obvious to me that the
suggestion is using:

 key in dict

...instead of:

 dict.has_key(key)


The only thing which may be confusing is the dictionary which is first
called dict and then d, in which case the following modification
should be made:

- dict.has_key(key) is equivalent to key in d, but deprecated.
+ dict.has_key(key) is equivalent to key in dict, but deprecated.

--
nosy: +giampaolo.rodola

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4243
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4238] BSD support for multiprocessing.cpu_count

2008-10-30 Thread Benjamin Peterson

Changes by Benjamin Peterson [EMAIL PROTECTED]:


--
assignee:  - jnoller
nosy: +jnoller

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4238
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4242] Classify language vs. impl-detail tests, step 1

2008-10-30 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

As I mentioned on Python-dev, I have implemented something similar to
this in my testing branch.

[1] http://code.python.org/users/benjamin.peterson/new_testing/main

--
nosy: +benjamin.peterson

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4242
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4170] segfault with defaultdict and pickle

2008-10-30 Thread Amaury Forgeot d'Arc

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

Fixed with r67048.

--
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4170
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4243] has_key doc could be clearer

2008-10-30 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

If I understand English correctly, I don't see an ambiguity.

Probably the poster(s) on c.l.p didn't look properly and read something
like equivalent to key in d, but the latter is deprecated.

The d/dict inconsistency should be fixed.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4243
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-30 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Fixed in r67051 (py3k), r67052 (trunk)

--
assignee: barry - christian.heimes
resolution:  - accepted
versions:  -Python 2.7, Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4237
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-30 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Fixed in r67054

--
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4200
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4213] Lower case file system encoding

2008-10-30 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Fixed in r67055

--
resolution: accepted - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4213
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3723] Py_NewInterpreter does not work

2008-10-30 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Applied in r67057

--
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3723
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4237] io.FileIO('foo', 'rt') prints a RuntimeWarning

2008-10-30 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Merged into the release26 branch, too.

--
resolution: accepted - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4237
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4213] Lower case file system encoding

2008-10-30 Thread Martin v. Löwis

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

 The solution is elegant and works well.

I can't agree with that evaluation. In cases where Python would fail
without this patch (i.e. because the file system encoding cannot be
found during startup), this solution doesn't work well in general - it
only works if the file system encoding happens to be UTF-8. If the file
system encoding is not in the list of builtin codec names, startup
would still fail.

r67057 addresses this case in a somewhat more general manner, by falling
back to ASCII during startup, for encoding file names. This should work
in the usual case where Python is in /usr/bin (say), but it's still
possible to make it fail, e.g. if the codecs are in /home/Питон (say),
on a system that uses koi8-r as the file system encoding, this bug would
persist despite the two patches that have been applied.

--
nosy: +loewis

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4213
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-30 Thread Amaury Forgeot d'Arc

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

Committed r67048 (trunk), r67056 (2.5), r67053 (2.6), r67059 (py3k).

--
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4176
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4225] unicode_literals doesn't work in exec

2008-10-30 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Here's a patch that handles the parser module.

Added file: http://bugs.python.org/file11911/parser_module_fixed_too.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4225
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4225] unicode_literals doesn't work in exec

2008-10-30 Thread Benjamin Peterson

Changes by Benjamin Peterson [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file11911/parser_module_fixed_too.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4225
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4225] unicode_literals doesn't work in exec

2008-10-30 Thread Benjamin Peterson

Changes by Benjamin Peterson [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file11912/parser_module_fixed_too.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4225
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4242] Classify language vs. impl-detail tests, step 1

2008-10-30 Thread Nick Coghlan

Nick Coghlan [EMAIL PROTECTED] added the comment:

I personally wonder if we should be moving towards a more systematic
means of identifying the underlying Python VM than the current fairly ad
hoc use of sys.platform.

By that I mean adding another sys attribute (e.g. sys.vm) which could be
checked explicitly for the Python VM identity, rather than the
underlying platform.

E.g.

CPython: sys.vm == cpython
Jython:  sys.vm == jython
PyPy:  sys.vm == pypy
IronPython:  sys.vm == ironpython

Then instead of relying on a separate flag in test_support the
impl_detail decorator could be written based on the VM names:

def impl_detail(*vm_names):
  if not vm_names:
vm_names = cpython,
  if sys.vm in vm_names:
# Test the implementation detail
  else:
# Skip this test

Depending on how ambitious an implementer of an alternative VM wants to
be, they could either set sys.vm to the same value as one of the
existing interpreters and try to match the implementation details as
well as the language spec, or else use their own name.

--
nosy: +ncoghlan

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4242
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4242] Classify language vs. impl-detail tests, step 1

2008-10-30 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

On Thu, Oct 30, 2008 at 5:33 PM, Nick Coghlan [EMAIL PROTECTED] wrote:

 Nick Coghlan [EMAIL PROTECTED] added the comment:

 I personally wonder if we should be moving towards a more systematic
 means of identifying the underlying Python VM than the current fairly ad
 hoc use of sys.platform.

I use platform.python_implementation().

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4242
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4234] bin missing from documentation

2008-10-30 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Fixed in r67060.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4234
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4213] Lower case file system encoding

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

Le Thursday 30 October 2008 23:14:21 Martin v. Löwis, vous avez écrit :
 I can't agree with that evaluation. In cases where Python would fail
 without this patch (i.e. because the file system encoding cannot be
 found during startup),

My patch doesn't change the way how Python get the file system encoding: it 
just gets the Python charset name (eg. utf-8 instead of UTF8, 
or iso8859-1 instead of latin-1). The goal was to enable the 
optimizations, especially with utf-8. It's not related to #3723.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4213
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3727] poplib module broken by str to unicode conversion

2008-10-30 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

I'm happy with Victor's patch.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3727
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3714] nntplib module broken by str to unicode conversion

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

After testing many different emails servers (POP3, IMAP4 and NNTP), I 
think that the best type is bytes and not str (unicode). Attached 
patch changes nntplib to use bytes:
 - write tests using Gmane NNTP public server
 - use bytes everywhere except for the commands (str), converted to 
bytes using ASCII charset
 - factorizy post() + ihave(): create _post()
 - replace line[-1] == '\n' by line.endswith(b'\n')
 - replace e.response[:3] == '480' by e.response.startswith(b'480')
 - use format() method because str+int is forbidden. Eg. see body() 
method: id can be an integer (or an unicode string).

I like startswith() / endswith() because it's more readable and it 
works with string of 1 byte: line[-1:] == b'\n' vs 
line.endswith(b'\n').

TODO:
 - test authentication
 - test methods marked as TODO in the testcase: 
* Check newgroups(), newnews(), list()
* Check xhdr(), xover(), xgtitle(), xpath()
* Check post(), ihave()
 - does .format() work with bytes? body(b'1') may creates the 
command BODY b'1' which is wrong = should I also use bytes for the 
commands?

I don't know NNTP enough to test all methods, and I don't have any 
account to test the authentication :-/ But most common commands should 
work (see the testcase).

Added file: http://bugs.python.org/file11913/nntp-bytes.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3714
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3714] nntplib module broken by str to unicode conversion

2008-10-30 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

I haven't been able to examine the patch in depth, but one thing I see
is that the test case needs to call test.support.requires(network).

--
nosy: +benjamin.peterson

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3714
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4242] Classify language vs. impl-detail tests, step 1

2008-10-30 Thread Nick Coghlan

Nick Coghlan [EMAIL PROTECTED] added the comment:

Interesting, I hadn't noticed that addition to the platform module for 2.6.

A bit more verbose than sys.vm, but it would certainly do the trick :)

In that case, I would suggest something along the lines of the following:

vm = platform.python_implementation().lower()
reference_vm = cpython

def impl_detail(*vm_names):
  if vm_names:
vm_names = [vm.lower() for vm in vm_names]
  else:
vm_names = [reference_vm]
  if vm in vm_names:
# Test the implementation detail
  else:
# Skip this test

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4242
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3626] python3.0 interpreter on Cygwin ignores all arguments

2008-10-30 Thread Amaury Forgeot d'Arc

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

Committed the %ls fix with r67064.

--
keywords:  -needs review
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3714] nntplib module broken by str to unicode conversion

2008-10-30 Thread STINNER Victor

Changes by STINNER Victor [EMAIL PROTECTED]:


--
keywords: +needs review

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3714
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4225] unicode_literals doesn't work in exec

2008-10-30 Thread Amaury Forgeot d'Arc

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

The patch is good,
except that you removed static before the function err_input (?)

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4225
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4216] subprocess.Popen hangs at communicate() when child exits

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

I'm unable to reproduce your problem with Python 2.4.4 nor Python 
2.5.1. I'm using Ubuntu and the program service doesn't exist. So I 
used the commands pwd, sh -c pwd, sh -c 'echo $$'. All commands 
terminate correctly.

Your problem is specific to the command service cpboot start? You 
can reproduce the problem with another command?

Can you attach the full trace? I mean something like strace -f -o 
trace python test.py.

--
nosy: +haypo

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4216
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-30 Thread Alexandre Vassalotti

Alexandre Vassalotti [EMAIL PROTECTED] added the comment:

Thank you, Amaury, for fixing this. However, you forgot to also patch
the Python implementation of pickle, which makes the following test fail:

==
FAIL: test_reduce_bad_iterator (__main__.PyPicklerTests)
--
Traceback (most recent call last):
  File /home/alex/src/python.org/py3k/Lib/test/pickletester.py, line
892, in test_reduce_bad_iterator
self.assertRaises(pickle.PickleError, self.dumps, C(), proto)
AssertionError: PickleError not raised by dumps


Also, I am not sure if moving the type and length check of the reduce
value into save_reduce() was a good idea. In pickle.py, the check must 
be done before calling save_reduce(), since the method is called with
the star-syntax self.save_reduce(obj=obj, *rv). In _pickle, there's no
such requirement; however I don't like the idea of adding needless
differences.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4176
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

The problem occurs in PyImport_Cleanup() on this line:
  PyDict_SetItemString(dict, _, Py_None);

So the problem is that _ (special variable in the Python 
interpreter) is removed too late, or that a destructor loads a module 
when Python is exiting.

Call trace:

Py_Finalize() - PyImport_Cleanup() - 
builtin___import__(warnings) - builtin___import__(_warnings) - 
_PyWarnings_Init() - PyModule_Create2()

Full backtrace:
(gdb) where
#0  0xe410 in __kernel_vsyscall ()
#1  0xb7d68875 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7d6a201 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0x080ba54b in Py_FatalError (msg=0x8163ad0 Interpreter not 
initialized (version mismatch?)) at Python/pythonrun.c:1922
#4  0x081248e2 in PyModule_Create2 (module=0x8174e20, 
module_api_version=1013) at Objects/moduleobject.c:71
#5  0x080882d7 in _PyWarnings_Init () at Python/_warnings.c:879
#6  0x080abcb0 in init_builtin (name=0xbf8627a3 _warnings) at 
Python/import.c:1867
#7  0x080aba9f in load_module (name=0xbf8627a3 _warnings, fp=0x0, 
buf=0xbf8627a3 _warnings, type=6, loader=0x0) at 
Python/import.c:1795
#8  0x080ad54f in import_submodule (mod=0x81695a4, 
subname=0xbf863833 _warnings, fullname=0xbf863833 _warnings) at 
Python/import.c:2567
#9  0x080acd21 in load_next (mod=0x81695a4, altmod=0x81695a4, 
p_name=0xbf863814, buf=0xbf863833 _warnings, p_buflen=0xbf86381c)
at Python/import.c:2372
#10 0x080ac26e in import_module_level (name=0x0, globals=0xb7b2802c, 
locals=0xb7b2802c, fromlist=0xb7b208fc, level=0) at 
Python/import.c:2089
#11 0x080ac5b2 in PyImport_ImportModuleLevel 
(name=0xb7b2c650 _warnings, globals=0xb7b2802c, locals=0xb7b2802c, 
fromlist=0xb7b208fc,
level=0) at Python/import.c:2140
#12 0x08088b0d in builtin___import__ (self=0xb7be8eac, 
args=0xb7b2098c, kwds=0x0) at Python/bltinmodule.c:173
#13 0x081241c6 in PyCFunction_Call (func=0xb7be8f6c, arg=0xb7b2098c, 
kw=0x0) at Objects/methodobject.c:84
#14 0x080ec5b8 in PyObject_Call (func=0xb7be8f6c, arg=0xb7b2098c, 
kw=0x0) at Objects/abstract.c:2184
#15 0x08094bae in PyEval_CallObjectWithKeywords (func=0xb7be8f6c, 
arg=0xb7b2098c, kw=0x0) at Python/ceval.c:3278
#16 0x080916dd in PyEval_EvalFrameEx (f=0x826661c, throwflag=0) at 
Python/ceval.c:1985
#17 0x08093d64 in PyEval_EvalCodeEx (co=0xb7b25608, 
globals=0xb7b2802c, locals=0xb7b2802c, args=0x0, argcount=0, kws=0x0, 
kwcount=0,
defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at 
Python/ceval.c:2835
#18 0x0808d2b4 in PyEval_EvalCode (co=0xb7b25608, globals=0xb7b2802c, 
locals=0xb7b2802c) at Python/ceval.c:519
#19 0x080a9be8 in PyImport_ExecCodeModuleEx 
(name=0xbf866dd3 warnings, co=0xb7b25608,
pathname=0xbf864ca3 /home/haypo/prog/py3k/Lib/warnings.pyc) at 
Python/import.c:729
#20 0x080aa41e in load_source_module (name=0xbf866dd3 warnings, 
pathname=0xbf864ca3 /home/haypo/prog/py3k/Lib/warnings.pyc, 
fp=0x82650f8)
at Python/import.c:1020
#21 0x080aba14 in load_module (name=0xbf866dd3 warnings, 
fp=0x82650f8, buf=0xbf865d43 /home/haypo/prog/py3k/Lib/warnings.py, 
type=1,
loader=0x0) at Python/import.c:1773
#22 0x080ad54f in import_submodule (mod=0x81695a4, 
subname=0xbf866dd3 warnings, fullname=0xbf866dd3 warnings) at 
Python/import.c:2567
#23 0x080acd21 in load_next (mod=0x81695a4, altmod=0x81695a4, 
p_name=0xbf866db4, buf=0xbf866dd3 warnings, p_buflen=0xbf866dbc)
at Python/import.c:2372
#24 0x080ac26e in import_module_level (name=0x0, globals=0xb7c0402c, 
locals=0x81695a4, fromlist=0x81695a4, level=0) at Python/import.c:2089
#25 0x080ac5b2 in PyImport_ImportModuleLevel 
(name=0xb7b1f850 warnings, globals=0xb7c0402c, locals=0x81695a4, 
fromlist=0x81695a4, level=0)
at Python/import.c:2140
#26 0x08088b0d in builtin___import__ (self=0xb7be8eac, 
args=0xb7b87e6c, kwds=0x0) at Python/bltinmodule.c:173
#27 0x081241c6 in PyCFunction_Call (func=0xb7be8f6c, arg=0xb7b87e6c, 
kw=0x0) at Objects/methodobject.c:84
#28 0x080ec5b8 in PyObject_Call (func=0xb7be8f6c, arg=0xb7b87e6c, 
kw=0x0) at Objects/abstract.c:2184
#29 0x08094bae in PyEval_CallObjectWithKeywords (func=0xb7be8f6c, 
arg=0xb7b87e6c, kw=0x0) at Python/ceval.c:3278
#30 0x080916dd in PyEval_EvalFrameEx (f=0x8264fa4, throwflag=0) at 
Python/ceval.c:1985
#31 0x08093d64 in PyEval_EvalCodeEx (co=0xb7b62c80, 
globals=0xb7c0402c, locals=0x0, args=0xb7b1f4d8, argcount=1, kws=0x0, 
kwcount=0,
defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at 
Python/ceval.c:2835
---Type return to continue, or q return to quit---
#32 0x08111b1e in function_call (func=0xb7b2626c, arg=0xb7b1f4cc, 
kw=0x0) at Objects/funcobject.c:628
#33 0x080ec5b8 in PyObject_Call (func=0xb7b2626c, arg=0xb7b1f4cc, 
kw=0x0) at Objects/abstract.c:2184
#34 0x080fe956 in method_call (func=0xb7b2626c, arg=0xb7b1f4cc, 
kw=0x0) at Objects/classobject.c:323
#35 0x080ec5b8 in PyObject_Call (func=0xb7b1f6cc, arg=0xb7bde02c, 
kw=0x0) at Objects/abstract.c:2184
#36 0x08094bae in PyEval_CallObjectWithKeywords 

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

Here is a patch fixing this issue: set builtins._=None at exit.

The new introduced function, PyRun_InteractiveCleanup(), might also be 
called at the end of other functions like PyRun_InteractiveOne() or 
PyRun_InteractiveOneFlags(). If not, PyRun_InteractiveCleanup() should 
be exported.

--
keywords: +patch
Added file: http://bugs.python.org/file11914/interactive_cleanup.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

Another solution: just remove the initialization test from 
PyModule_Create2(). I don't know if it's a safety test or something 
like that.

Added file: http://bugs.python.org/file11915/pymodule_create2.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-30 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

Python2 is not affected because the bug comes from PyModule_Create2() 
which was introduced in Python3.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4225] unicode_literals doesn't work in exec

2008-10-30 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

The removal of the static was a mistake. Fixed in r67066.

--
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4225
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com