[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread R. David Murray

R. David Murray  added the comment:

This sounds like a reasonable feature request.  If you would like to propose a 
patch against trunk (py3k, what will become 3.3), I will take a look at it.

--
nosy: +r.david.murray
stage:  -> needs patch
type:  -> feature request
versions: +Python 3.3 -Python 2.7

___
Python tracker 

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



[issue10924] Adding salt and Modular Crypt Format to crypt library.

2011-02-22 Thread Ezio Melotti

Ezio Melotti  added the comment:

Some buildbots are failing after the commit.

Also in the crypt.py module I still see things that according to msg126453 
should be fixed already:
 * more statements on the same line (e.g. "if salt == None: salt = mksalt()");
 * the hardcoded salt values instead of string.ascii_letters;

According to the PEP8 there shouldn't be any spaces after the '[' and before 
the ']' (e.g. "method_list = [ METHOD_SHA512, METHOD_SHA256, METHOD_MD5 ]" and 
in the listcomps) and around the = in the function/method declarations/calls 
(e.g. "def crypt(word, salt = None):").

--
keywords: +buildbot
nosy: +ezio.melotti

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

I guess not at all.  Well.

--

___
Python tracker 

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



[issue11280] urllib2 http_error_302 calls undefined "getheaders" method

2011-02-22 Thread Andres Riancho

Andres Riancho  added the comment:

One more comment to be added. Please take a look at the following [0] w3af bug 
report. The interesting part starts at "[ Sun Nov 28 01:25:47 2010 - debug ] 
Traceback (most recent call last):".

In there you'll find that my w3af code had a section of urllib2's code in 
logHandler.py (self.original_http_error_302(req, fp, code, msg, headers)) and 
that the error is very clear (to me at least):

[ Sun Nov 28 01:25:47 2010 - debug ] newurl = headers.getheaders('location')[0]
[ Sun Nov 28 01:25:47 2010 - debug ] AttributeError?: 'dict' object has no 
attribute 'getheaders'

[0] https://sourceforge.net/apps/trac/w3af/ticket/160511

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

test_zlib.py (with my patch but that's somewhat identical in the end, say) does

.s...
--
Ran 37 tests in 1.809s

OK (skipped=1)

This is on Snow Leopard 64 bit, 02b70cb59701 (r88451) -> Python 3.3a0.
Is there a switch i must trigger?  Just pulled 24 changesets, recompiling and 
trying again with r88460.

--

___
Python tracker 

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



[issue10228] Refleak run of test_dbm fails when several dbm modules are available

2011-02-22 Thread Ray.Allen

Ray.Allen  added the comment:

It looks like because before the second time running of 
WhichDBTestCase.test_whichdb(), previous dumb files are not cleaned clearly, so 
the gdbm's open() doesn't create a new gdbm database but open an existing dumb 
database.

In fact during the working of #9523, I found this problem and fix it in the 
patch of #9523. Here I extract the fixing, it is simple:


cat patches/issue10228.diff 
Index: Lib/test/test_dbm.py
===
--- Lib/test/test_dbm.py(revision 88499)
+++ Lib/test/test_dbm.py(working copy)
@@ -123,7 +123,7 @@
 name = module.__name__
 if name == 'dbm.dumb':
 continue   # whichdb can't support dbm.dumb
-test.support.unlink(_fname)
+delete_files()
 f = module.open(_fname, 'c')
 f.close()
 self.assertEqual(name, dbm.whichdb(_fname))

--
nosy: +ysj.ray

___
Python tracker 

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



[issue11285] io.py standart stream setup crash

2011-02-22 Thread Steffen Daode Nurpmeso

New submission from Steffen Daode Nurpmeso :

Just pulled 64380ee4bbc5 (r88500) and compiled, Python's busted:

Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/io.py", line 60, in 
Abort trap

--
components: IO
messages: 129065
nosy: sdaoden
priority: normal
severity: normal
status: open
title: io.py standart stream setup crash
type: crash
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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> This is on Snow Leopard 64 bit, 02b70cb59701 (r88451) -> Python 3.3a0.
> Is there a switch i must trigger?  Just pulled 24 changesets,
> recompiling and trying again with r88460.

Have you tried "./python -m test -v -uall test_zlib" ?

--

___
Python tracker 

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



[issue3783] dbm.sqlite proof of concept

2011-02-22 Thread Ray.Allen

Changes by Ray.Allen :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

No, i've got no idea of this framework... Just did 'python3 test_zlib.py' 
directly.  Thanks for the switch.  But i can't test your thing due to 
issue11285, so this may take a while (others have more knowledge anyway)..

(P.S.: your constant-folding stack patch is a great thing, just wanted to say 
this once..)

--

___
Python tracker 

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



[issue11285] io.py standart stream setup crash

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Can you try to identify which revision introduced the issue?

--
nosy: +haypo, ned.deily, pitrou
priority: normal -> critical

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

So here is this (with my patch, but this is for real: issue11277.2.patch):

== CPython 3.3a0 (py3k, Feb 22 2011, 14:00:52) [GCC 4.2.1 (Apple Inc. build 
5664)]
==   Darwin-10.6.0-i386-64bit little-endian
==   /private/var/folders/Da/DaZX3-k5G8a57zw6MSmjJTM/-Tmp-/test_python_89365
Testing with flags: sys.flags(debug=0, division_warning=0, inspect=0, 
interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, 
ignore_environment=0, verbose=0, bytes_warning=0, quiet=0)
[1/1] test_zlib
test_adler32empty (test.test_zlib.ChecksumTestCase) ... ok
test_adler32start (test.test_zlib.ChecksumTestCase) ... ok
test_crc32_adler32_unsigned (test.test_zlib.ChecksumTestCase) ... ok
test_crc32empty (test.test_zlib.ChecksumTestCase) ... ok
test_crc32start (test.test_zlib.ChecksumTestCase) ... ok
test_penguins (test.test_zlib.ChecksumTestCase) ... ok
test_same_as_binascii_crc32 (test.test_zlib.ChecksumTestCase) ... ok
test_badargs (test.test_zlib.ExceptionTestCase) ... ok
test_badcompressobj (test.test_zlib.ExceptionTestCase) ... ok
test_baddecompressobj (test.test_zlib.ExceptionTestCase) ... ok
test_badlevel (test.test_zlib.ExceptionTestCase) ... ok
test_decompressobj_badflush (test.test_zlib.ExceptionTestCase) ... ok
test_big_compress_buffer (test.test_zlib.CompressTestCase) ... ok
test_big_decompress_buffer (test.test_zlib.CompressTestCase) ... ok
test_incomplete_stream (test.test_zlib.CompressTestCase) ... ok
test_length_overflow (test.test_zlib.CompressTestCase) ... skipped 'not enough 
free memory, need at least 4 GB'
test_speech (test.test_zlib.CompressTestCase) ... ok
test_speech128 (test.test_zlib.CompressTestCase) ... ok
test_badcompresscopy (test.test_zlib.CompressObjectTestCase) ... ok
test_baddecompresscopy (test.test_zlib.CompressObjectTestCase) ... ok
test_big_compress_buffer (test.test_zlib.CompressObjectTestCase) ... ok
test_big_decompress_buffer (test.test_zlib.CompressObjectTestCase) ... ok
test_compresscopy (test.test_zlib.CompressObjectTestCase) ... ok
test_compressincremental (test.test_zlib.CompressObjectTestCase) ... ok
test_compressoptions (test.test_zlib.CompressObjectTestCase) ... ok
test_decompimax (test.test_zlib.CompressObjectTestCase) ... ok
test_decompinc (test.test_zlib.CompressObjectTestCase) ... ok
test_decompincflush (test.test_zlib.CompressObjectTestCase) ... ok
test_decompress_incomplete_stream (test.test_zlib.CompressObjectTestCase) ... ok
test_decompresscopy (test.test_zlib.CompressObjectTestCase) ... ok
test_decompressmaxlen (test.test_zlib.CompressObjectTestCase) ... ok
test_decompressmaxlenflush (test.test_zlib.CompressObjectTestCase) ... ok
test_empty_flush (test.test_zlib.CompressObjectTestCase) ... ok
test_flushes (test.test_zlib.CompressObjectTestCase) ... ok
test_maxlenmisc (test.test_zlib.CompressObjectTestCase) ... ok
test_odd_flush (test.test_zlib.CompressObjectTestCase) ... ok
test_pair (test.test_zlib.CompressObjectTestCase) ... ok

--
Ran 37 tests in 1.789s

OK (skipped=1)
1 test OK.

--
Added file: http://bugs.python.org/file20838/issue11277.2.patch

___
Python tracker 

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



[issue11285] io.py standart stream setup crash

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

Let me see some minutes.

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Changes by Steffen Daode Nurpmeso :


Removed file: http://bugs.python.org/file20837/issue11277.patch

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

(Is not that much help for a >4GB error, huh?)

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

Just stepping ... with c8d1f99f25eb/r88476:

== CPython 3.3a0 (py3k, Feb 22 2011, 14:18:19) [GCC 4.2.1 (Apple Inc. build 
5664)]
==   Darwin-10.6.0-i386-64bit little-endian
==   /private/var/folders/Da/DaZX3-k5G8a57zw6MSmjJTM/-Tmp-/test_python_5126
Testing with flags: sys.flags(debug=0, division_warning=0, inspect=0, 
interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, 
ignore_environment=0, verbose=0, bytes_warning=0, quiet=0)
[1/1] test_zlib
test_adler32empty (test.test_zlib.ChecksumTestCase) ... ok
test_adler32start (test.test_zlib.ChecksumTestCase) ... ok
test_crc32_adler32_unsigned (test.test_zlib.ChecksumTestCase) ... ok
test_crc32empty (test.test_zlib.ChecksumTestCase) ... ok
test_crc32start (test.test_zlib.ChecksumTestCase) ... ok
test_penguins (test.test_zlib.ChecksumTestCase) ... ok
test_same_as_binascii_crc32 (test.test_zlib.ChecksumTestCase) ... ok
test_big_buffer (test.test_zlib.ChecksumBigBufferTestCase) ... 
^C
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
Bus error

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Just stepping ... with c8d1f99f25eb/r88476:

Right, that's what we should investigate :)
Could try to diagnose the crash?

--

___
Python tracker 

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



[issue11285] io.py standart stream setup crash

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

According to adorable but slow Mercurial:

The first bad revision is:
changeset:   9894:fc8a94cc17a4
branch:  py3k
user:raymond.hettinger
date:Tue Feb 22 01:41:50 2011 +0100
summary: [svn r88490] Issue #11085: Moved collections abstract base classes 
into a separate module

--

___
Python tracker 

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



[issue11285] io.py standart stream setup crash

2011-02-22 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +rhettinger

___
Python tracker 

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



[issue2159] dbmmodule inquiry function is performance prohibitive

2011-02-22 Thread Ray.Allen

Changes by Ray.Allen :


--
nosy: +ysj.ray

___
Python tracker 

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



[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-22 Thread Jesús Cea Avión

New submission from Jesús Cea Avión :

I have 10MB pickled structure generated in Python 2.7. I only use basic
types (no clases) like sets, dictionaries, lists, strings, etc.

The pickle stores a lot of strings. Some of them should be "bytes",
while other should be "unicode". My idea is to import ALL the strings as
bytes in Python 3.2 and navigate the data structure to convert the
appropiate values to unicode, in a one-time operation (I version the
structure, so I can know if this conversion is already done, simply
storing a new version value).

But I get this error:

"""
Python 3.2 (r32:88445, Feb 21 2011, 13:34:07)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> f=open("file.pickle", mode="rb").read()
>>> >>> len(f)
9847316
>>> >>> b=pickle.loads(f,encoding="latin1")
Traceback (most recent call last):
  File "", line 1, in 
ValueError: operation forbidden on released memoryview object
"""

I use the encoding "latin1" for transparent byte/unicode conversion (do
not touch the values!).

This seems to be a bug in Python 3.2. Any suggestion?.

The bytestream is protocol 2.


PYTHON 3.1.3 loads the pickle just fine.

Trying to generate a testcase. I can't upload the pickle, because it contains 
propietary information.

--
components: Library (Lib)
messages: 129075
nosy: georg.brandl, jcea
priority: release blocker
severity: normal
stage: test needed
status: open
title: Some "trivial" python 2.x pickles fails to load in Python 3.2
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



[issue11287] Add context manager support to dbm modules

2011-02-22 Thread Ray.Allen

New submission from Ray.Allen :

dbm objects, including gdbm, ndbm, dumb, should support context manager. That 
is, can be used with 'with' keyword, just like regular file objects.

I'm working out a patch for this.

--
components: Extension Modules
messages: 129076
nosy: ysj.ray
priority: normal
severity: normal
status: open
title: Add context manager support to dbm modules
type: feature request
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



[issue10882] Add os.sendfile()

2011-02-22 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

Yes I agree it can go in now. Unless someone wants to do some tests on more 
OS's like FreeBSD 7.2, Solaris, etc. (I've only checked on Linux 2.6, FreeBSD 
8.1, OpenIndiana and OS X 10.5).

--

___
Python tracker 

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



[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I'd support updating to argparse *if* you write a test suite for full coverage 
of the existing cli first.  Once that passes, you'll have more confidence in 
your port.  Modernizing the argument parsing in that case would be a useful 
addition.  Not critical, but on the whole I think a good thing.

--

___
Python tracker 

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



[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-22 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

I got a trivial (41 bytes long) reproductable case:

Pickle the following structure in Python 2.7, and try to unpickle with Python 
3.2, using a "latin1" encoding:

"""
{'ya_volcados': {'comment': ''}}
"""

Load with:

"""
#!/usr/local/bin/python3

import pickle

f=open("z.pickle", "rb").read()

a=pickle.loads(f,encoding="latin1")
"""

(I use "latin1" because my real pickle includes binary data stored as strings. 
Note that the testcase doesn't content binary data).

Python 3.2, 32 bits. Tested under Solaris and Linux.

This worked in Python 3.1.3, so we have a regression.

--
keywords: +3.2regression
stage: test needed -> needs patch
Added file: http://bugs.python.org/file20839/z.pickle

___
Python tracker 

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



[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, so it boils down to:

>>> pickle.loads(b'\x80\x02}q\x00U\x00q\x01h\x01s.')
{'': ''}
>>> pickle.loads(b'\x80\x02}q\x00U\x00q\x01h\x01s.', encoding='latin1')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: operation forbidden on released memoryview object

(this is protocol 2, by the way. Protocol 0 works fine.)

--
nosy: +pitrou

___
Python tracker 

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



[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-22 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Storing the pickle using protocol 0, it works OK.

Using protocol 1 or 2, it fails.

--

___
Python tracker 

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



[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This is because of the buffer pointer passed to the codecs machinery being NULL 
when the empty string is being decoded.

Quick patch follows (needs a test). Also, it is not clear whether it is allowed 
to store a NULL pointer in the "buf" member of a Py_buffer when the length is 
0. Nick, Mark?


Index: Objects/unicodeobject.c
===
--- Objects/unicodeobject.c (révision 88500)
+++ Objects/unicodeobject.c (copie de travail)
@@ -1460,6 +1460,7 @@
 PyObject *buffer = NULL, *unicode;
 Py_buffer info;
 char lower[11];  /* Enough for any encoding shortcut */
+static const char empty[] = "";
 
 if (encoding == NULL)
 encoding = PyUnicode_GetDefaultEncoding();
@@ -1485,6 +1486,8 @@
 
 /* Decode via the codec registry */
 buffer = NULL;
+if (s == NULL)
+s = empty;
 if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_FULL_RO) < 0)
 goto onError;
 buffer = PyMemoryView_FromBuffer(&info);

--
nosy: +mark.dickinson, ncoghlan

___
Python tracker 

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



[issue11280] urllib2 http_error_302 calls undefined "getheaders" method

2011-02-22 Thread R. David Murray

R. David Murray  added the comment:

The traceback you point to seems to indicate the getheaders call is in your 
code.

Can you provide a minimal test case that demonstrates the failure mode you are 
concerned about?

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



[issue11280] urllib2 http_error_302 calls undefined "getheaders" method

2011-02-22 Thread Andres Riancho

Andres Riancho  added the comment:

Yes, the traceback was in my code because as I stated before: "my w3af code had 
a section of urllib2's code in logHandler.py" in other words, I copy+pasted a 
section of urllib2 into my code.

Can't provide a test case now, sorry.

--

___
Python tracker 

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

+1, this has been done for other modules such as ftplib as well and probably 
could be done for others such as httplib and poplib.

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

.. even with a self-compiled 1.2.3, INT_MAX/1000 ... nothing.
The problem is not crc32(), but the buffer itself:

   if (pbuf.len > 1024*5) {
unsigned char *buf = pbuf.buf;
Py_ssize_t len = pbuf.len;
Py_ssize_t i;
fprintf(stderr, "CRC 32 2.1\n");
for(i=0; (size_t)i < (size_t)len;++i)
*buf++ = 1;
fprintf(stderr, "CRC 32 2.2\n");

2.2 is never reached (in fact accessing buf[1] already causes fault).
Thus the problem is not zlib, but PyArg_ParseTuple().
But just don't ask me more on that!

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

(P.S.: of course talking about ChecksumBigBufferTestCase and the 4GB, say.)

--

___
Python tracker 

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



[issue11288] Python installed from MSI doesn't work

2011-02-22 Thread Matthew Funke

New submission from Matthew Funke :

I uninstalled Python 3.1.3 and installed the 32-bit version of Python 3.2 on my 
64-bit Win7 box.  (My favorite IDE requires the 32-bit version.)  trying to run 
IDLE crashes; running C:\python32\python.exe returns this error:

Fatal Python error: Py_Initialize: unable to load the file system codec
LookupError: no codec search functions registered: can't find encoding

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I tried Googling the error, but couldn't find much help for it.  Thoughts?

--
components: IDLE, Windows
messages: 129088
nosy: Matthew.Funke
priority: normal
severity: normal
status: open
title: Python installed from MSI doesn't work
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



[issue10924] Adding salt and Modular Crypt Format to crypt library.

2011-02-22 Thread SilentGhost

SilentGhost  added the comment:

Here is the patch fixing pep-8 compatibility and test. It is against the latest 
commit.

--
nosy: +SilentGhost
status: closed -> open
Added file: http://bugs.python.org/file20840/crypt.py.diff

___
Python tracker 

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



[issue11288] Python installed from MSI doesn't work

2011-02-22 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy: +brian.curtin, loewis

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> .. even with a self-compiled 1.2.3, INT_MAX/1000 ... nothing.
> The problem is not crc32(), but the buffer itself:
> 
>if (pbuf.len > 1024*5) {
> unsigned char *buf = pbuf.buf;
> Py_ssize_t len = pbuf.len;
> Py_ssize_t i;
> fprintf(stderr, "CRC 32 2.1\n");
> for(i=0; (size_t)i < (size_t)len;++i)
> *buf++ = 1;
> fprintf(stderr, "CRC 32 2.2\n");

Thank you! So it's perhaps a bug in mmap on Snow Leopard.
Could you try to debug a bit more precisely and see at which buffer
offset (from the start) the fault occurs?

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

Snippet

if (pbuf.len > 1024*5) {
volatile unsigned char *buf = pbuf.buf;
Py_ssize_t len = pbuf.len;
Py_ssize_t i = 0;
volatile unsigned char au[100];
volatile unsigned char*x = au;
fprintf(stderr, "CRC ENTER, buffer=%p\n", buf);
for (i=0; (size_t)i < (size_t)len; ++i) {
fprintf(stderr, "%ld, buf=%p\n", (signed long)i, buf);
*x = *buf++;
}

results in

test_big_buffer (test.test_zlib.ChecksumBigBufferTestCase) ... CRC ENTER, 
buffer=0x1014ab000
0, buf=0x1014ab000

--

___
Python tracker 

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

> I would like to add source_ip and source_port parameters to 
> smtplib.SMTP, default to '' and 0 respectively.

It would be better to provide a unique source_address parameter defaulting to 
None, for consistency with socket.create_connection() expecting a (addr, port) 
tuple.

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Out of curiosity, could you try the following patch?

Index: Lib/test/test_zlib.py
===
--- Lib/test/test_zlib.py   (révision 88500)
+++ Lib/test/test_zlib.py   (copie de travail)
@@ -70,7 +70,7 @@
 with open(support.TESTFN, "wb+") as f:
 f.seek(_4G)
 f.write(b"asdf")
-f.flush()
+with open(support.TESTFN, "rb") as f:
 self.mapping = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
 
 def tearDown(self):

--

___
Python tracker 

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



[issue6549] ttk.Style not translating some Tcl options

2011-02-22 Thread Clayton Darwin

Clayton Darwin  added the comment:

I have been working with the ttk module (Windows XP, Python 3.1) and have 
encountered some specific issues with ttk.Style() not fully propagating the 
style into the widget.  In my particular case, there seem to be issues with 
setting style in TCombobox and TEntry.  The biggest issue is that you can't 
change the style of the ttk.Combobox popdown.  Style can be set in the top 
window, but not using all methods, but nothing works for the popdown. 

I have included an example script that illustrates the issues I have 
encountered.

Clayton

--
nosy: +claytondarwin
Added file: http://bugs.python.org/file20841/ttk_combobox_test.py

___
Python tracker 

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



[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch with tests.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file20842/null_ptr_buffer.patch

___
Python tracker 

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



[issue11289] smtplib context manager

2011-02-22 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

Patch in attachment provides a context manager for SMTP class so that it can be 
used with the "with" statement.

--
messages: 129096
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: smtplib context manager
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



[issue11290] ttk.Combobox['values'] String Conversion to Tcl

2011-02-22 Thread Clayton Darwin

New submission from Clayton Darwin :

In working with the ttk.Combobox (Windows XP, Python 3.1), I have found that 
setting the values for the popdown using ttk.Combobox['values'] has an problem 
converting the string to the proper Tcl value when (and this is the only 
instance I have found) there is a backslash in the string but no spaces.  In 
this case, the string will translate if it is enclosed in curly brackets 
'{'+mystring+'}', which I believe is the Tcl syntax to not make substitutions.

I have attached a short script that illustrates this issue.

Clayton

--
components: Tkinter
files: tcl_string_test.py
messages: 129097
nosy: claytondarwin
priority: normal
severity: normal
status: open
title: ttk.Combobox['values'] String Conversion to Tcl
type: behavior
versions: Python 3.1
Added file: http://bugs.python.org/file20843/tcl_string_test.py

___
Python tracker 

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine

Paulo Scardine  added the comment:

Seems like the signature of Lib.test.mock_socket.create_connection does not 
match socket.create_connection since 2.7.

I need help with the docs; the last argument is positional and optional, using 
the `[ ]' notation. What is the notation for the new keyword arguments?

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

___
Python tracker 

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



[issue11289] smtplib context manager

2011-02-22 Thread SilentGhost

SilentGhost  added the comment:

you didn't attach anything, Giampaolo.

--
components: +Library (Lib)
nosy: +SilentGhost

___
Python tracker 

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

> Seems like the signature of Lib.test.mock_socket.create_connection does 
> not match socket.create_connection since 2.7.

You can add a fake parameter which does nothing.

> What is the notation for the new keyword arguments?

fun(a, b, c=None, d=None)

--

___
Python tracker 

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine

Paulo Scardine  added the comment:

Also, it is my first patch and I have no clue about what I'm doing, I don't 
expect to get it right in the first try - please point any mistakes.

--

___
Python tracker 

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



[issue11289] smtplib context manager

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Ouch! Here. =)

--
keywords: +patch
Added file: http://bugs.python.org/file20845/smtplib_context_manager.patch

___
Python tracker 

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine

Paulo Scardine  added the comment:

@Giampaolo: should I change the text in Doc/library/smtplib.rst or it is 
infered from the docstrings?

--

___
Python tracker 

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



[issue11289] smtplib context manager

2011-02-22 Thread SilentGhost

SilentGhost  added the comment:

is print really necessary in the test?

Also, I think it would be better to unpack the tuple in test, rather then index 
it.

--

___
Python tracker 

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



[issue11289] smtplib context manager

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

> is print really necessary in the test?

no, my mistake

--

___
Python tracker 

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Yes, you must update  Doc/library/smtplib.rst and write tests.
If you're not the one who's gonna commit the patch you can ignore 
Doc/whatsnew/3.3.srt and Misc/NEWS changes.

Updating the docstring is usually optional but I see smtplib module is already 
well documented so I'd update docstrings as well.

As for how to write a patch see:
http://www.python.org/dev/faq/#patches
...or search in the bug tracker for committed patches, such as:
http://bugs.python.org/issue8807
http://svn.python.org/view?view=revision&revision=84144

--

___
Python tracker 

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



[issue11287] Add context manager support to dbm modules

2011-02-22 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Charles-Francois Natali

Charles-Francois Natali  added the comment:

> .. even with a self-compiled 1.2.3, INT_MAX/1000 ... nothing.
> The problem is not crc32(), but the buffer itself:
> 
>if (pbuf.len > 1024*5) {
> unsigned char *buf = pbuf.buf;
> Py_ssize_t len = pbuf.len;
> Py_ssize_t i;
> fprintf(stderr, "CRC 32 2.1\n");
> for(i=0; (size_t)i < (size_t)len;++i)
> *buf++ = 1;
> fprintf(stderr, "CRC 32 2.2\n");

Unless I'm mistaken, in the test the file is mapped with PROT_READ, so it's 
normal to get SIGSEGV when writting to it:

   def setUp(self): 
with open(support.TESTFN, "wb+") as f: 
f.seek(_4G) 
f.write(b"asdf") 
f.flush() 
self.mapping = mmap.mmap(f.fileno(), 0, 
access=mmap.ACCESS_READ) 

> for(i=0; (size_t)i < (size_t)len;++i)
> *buf++ = 1;

But it seems you're also getting segfaults when only reading it, right ?

I've got a stupid question: how much memory do you have ?
Cause there seems to be some issues with page cache when reading mmaped files 
on OS-X:
http://lists.apple.com/archives/darwin-development/2003/Jun/msg00141.html

On Linux, the page cache won't fill forever, so you don't need to have enough 
free memory to accomodate the whole file (the page cache should grow, but not 
forever). But on OS-X, it seems that the page replacement algorithm seems to 
retain mmaped pages in the page cache much longer, which could potentially 
trigger an OOM later (because of overcommitting, mmap can very well return a 
valid address range which leads to a segfault when accessed later).
I'm not sure why it would segfault on the first page, though.

--
nosy: +neologix

___
Python tracker 

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine

Paulo Scardine  added the comment:

My first idea was to make the argument a tuple to match 
socket.create_connection(), but SMTP uses host and port arguments, for 
consistency it's better havin separate source_ip and source_port arguments. As 
a side effect, it makes easier to specify only source_port. 

The submited patch includes tests and updated docstrings; 

At the smtplib.rst, for example:

SMTP(host='', port=0, local_hostname=None[, timeout])

Would be ok to change it like:

SMTP(host='', port=0, local_hostname=None[, timeout], source_ip='', 
source_port=0)

--

___
Python tracker 

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



[issue11276] 2to3: imports fixer doesn't update references to modules specified without attributes

2011-02-22 Thread Brett Cannon

Brett Cannon  added the comment:

While directly referencing a module on its own is useless, this is an issue if 
the module is used in e.g., an assignment: ``blah = cPickle`` is not changed.

--
nosy: +brett.cannon
stage:  -> needs patch

___
Python tracker 

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



[issue11199] urllib hangs when closing connection

2011-02-22 Thread rg3

rg3  added the comment:

> > I have to correct myself. I applied the patch manually to my Python
> > 2.6 installation. In Python 2.6, the line you moved is number 961,
> > and I did the same change.
> 
> OK. For information, you can apply it using the Unix "patch" command,
> who can most of the time do all the work for you.

Yes, thanks, I already knew about "patch" but decided to apply the 
change manually just in case, as it belonged to a different Python 
branch.

> That's expected, it's a consequence of this point I raised earlier:
> > Note that I'm not sure why we need to wait for a further message on
> > the control channel (maybe it's part of an RFC or something...).

There's no doubt that not hanging is an improvement, but the current 
behavior somewhat defeats the purpose of an early call to "close".

To get a broader view, the test case I provided is actually part of a 
much larger program. In that program, I read lines from the Slackware 
change log, stopping when I read a line that the program already knows 
about (because it caches the change log contents). This prevents the 
program from reading more than a single line if no new entries are 
present in the change log, but having to wait for the full file defeats 
the purpose, specially on slow dial-up connections.

--

___
Python tracker 

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



[issue11200] Addition of abiflags breaks distutils

2011-02-22 Thread Toshio Kuratomi

Toshio Kuratomi  added the comment:

Distribute issue opened and patch based on Antoine's comments attached.

https://bitbucket.org/tarek/distribute/issue/191/distribute-fails-unittests-on-python-32

--

___
Python tracker 

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



[issue11086] add lib2to3/__main__.py

2011-02-22 Thread Brett Cannon

Brett Cannon  added the comment:

r88503 has the patch in 3.3

Didn't both with documenting it since I only expect core devs who are debugging 
something with 2to3 will want to use this approach.

--
assignee:  -> brett.cannon
resolution:  -> fixed
stage: commit 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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

We already have 3 places where a tuple is used:

socket.socket.bind
socket.create_connection
http.client.HTTPConnection

Changing this notation in smtplib for such a rarely used feature is not worth 
the effort, imo.
Also, I would not add two new SMTP attributes. Passing a tuple to 
socket.create_connection() is just fine. If you want to know the source address 
afterwards you can use socket.getsockname().

PS - I modified smtplib.py in meantime. Please update your local copy.

--

___
Python tracker 

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



[issue11291] poplib suppresses exception on QUIT

2011-02-22 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

Unlike ftplib, smtplib and probably others, poplib suppresses error_proto 
exceptions on quit().
I'm not sure in what circumstances a POP3 server can return a negative response 
on QUIT but if this happens poplib should raise an exception.
Users who don't care about QUIT response can use the new close() method.
For backward compatibility patch should only be applied to Python 3.3 .

--
files: poplib_quit.patch
keywords: patch
messages: 129114
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: poplib suppresses exception on QUIT
versions: Python 3.3
Added file: http://bugs.python.org/file20846/poplib_quit.patch

___
Python tracker 

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



[issue11199] urllib hangs when closing connection

2011-02-22 Thread Charles-Francois Natali

Changes by Charles-Francois Natali :


Removed file: http://bugs.python.org/file20815/urllib_ftp_close_27.diff

___
Python tracker 

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



[issue11199] urllib hangs when closing connection

2011-02-22 Thread Charles-Francois Natali

Changes by Charles-Francois Natali :


Added file: http://bugs.python.org/file20847/urllib_ftp_close_27.diff

___
Python tracker 

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



[issue11199] urllib hangs when closing connection

2011-02-22 Thread Charles-Francois Natali

Changes by Charles-Francois Natali :


Removed file: http://bugs.python.org/file20814/urllib_ftp_close.diff

___
Python tracker 

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



[issue11199] urllib hangs when closing connection

2011-02-22 Thread Charles-Francois Natali

Charles-Francois Natali  added the comment:

Attached are two new versions which don't wait for the end of transfer.

--
Added file: http://bugs.python.org/file20848/urllib_ftp_close.diff

___
Python tracker 

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



[issue11199] urllib hangs when closing connection

2011-02-22 Thread rg3

rg3  added the comment:

Charles-Francois Natali, Tuesday, February 22, 2011 20:57:
> Attached are two new versions which don't wait for the end of
> transfer.

I tested the one for Python 2.7 applied to Python 2.6 and it appears to 
work perfectly. Thanks for the quick fix!

--

___
Python tracker 

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



[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Xavier Morel

Xavier Morel  added the comment:

Barry, do I correctly understand your comment to mean I should write end-to-end 
tests of the CLI (until reaching the already tested "meat" of smtpd), not just 
the CLI options parsing?

--

___
Python tracker 

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



[issue11284] slow close file descriptors in subprocess, popen2, os.pepen*

2011-02-22 Thread Charles-Francois Natali

Charles-Francois Natali  added the comment:

To elaborate on this, to my knowledge, there's no portable and reliable way to 
close all open file descriptors.
Even with the current code, it's still possible that some FD aren't properly 
closed, since getconf(SC_OPEN_MAX) often returns RLIMIT_NOFILE soft limit, 
which might have been lowered by the application after having opened a whole 
bunch of files.
Anyway, if the performance hit is too high, I think you only have two options:
- set your FD as CLOEXEC (note that it's already the case for FD used by popen 
and friends), and don't pass close_fds argument
- if you don't need many FD, you could explicitely set RLIMIT_NOFILE to a low 
value so that close_fds doesn't need to try too many FD, e.g.:
import resource
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, 1024))

--

___
Python tracker 

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



[issue8914] Run clang's static analyzer

2011-02-22 Thread Brett Cannon

Brett Cannon  added the comment:

applied in r88506

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

I have a MacBook with 2 GB RAM.  Of course i'm a little bit messy, so an entry 
is half written before it comes to an ... end.  msg129091 is real life, though.

Antoine, your msg129093 patch of test_zlib.py does it (with and without 
fprintf(3)s).  CRC ok etc., it just works.
(Seems mmap(2) has a problem here, i would say; the mentioned bug report is 
from 2003, so the golden sunset watchers may need some more additional time, if 
you allow me that comment.)

--

___
Python tracker 

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



[issue11292] Curses - add A_REVERSE to attributes table

2011-02-22 Thread Sandro Tosi

New submission from Sandro Tosi :

Following up http://mail.python.org/pipermail/docs/2011-February/003142.html 
here's a patch to add A_REVERSE attribute to attribs table.

--
assignee: sandro.tosi
components: Documentation
files: add-a_reverse-py3k.patch
keywords: patch
messages: 129121
nosy: sandro.tosi
priority: low
severity: normal
stage: patch review
status: open
title: Curses - add A_REVERSE to attributes table
versions: Python 3.3
Added file: http://bugs.python.org/file20849/add-a_reverse-py3k.patch

___
Python tracker 

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



[issue11049] add tests for test.support

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Can we commit this patch?

--

___
Python tracker 

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



[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Feb 22, 2011, at 08:15 PM, Xavier Morel wrote:

>Barry, do I correctly understand your comment to mean I should write
>end-to-end tests of the CLI (until reaching the already tested "meat" of
>smtpd), not just the CLI options parsing?

Given the way the __main__ is written, that's probably more thorough.  Testing
just the parsing alone would be uninteresting I think.

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

(That is to say: i think it's better not to assume that these boys plan to 
*ever* fix it.  (Though mmap(2) is not CoreAudio/AudioUnit.))

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

(neologix: SIGBUS is not the same as SIGSEGV.  You know.  Thanks for this nice 
bug report.  Eight years is a .. time in computer programming - unbelievable, 
thinking of all these nervous wrecks who ever reported a bug to Apple!  Man!!!)

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

neologix: even with 2 GB RAM top(1) shows more than 600 MB free memory with the 
4 GB test up and running ... in an Mac OS X environment ...  Lucky me, i don't 
believe them a single word...

--

___
Python tracker 

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



[issue11293] Distutils - read the file when using it in long_description

2011-02-22 Thread Sandro Tosi

New submission from Sandro Tosi :

Following up http://mail.python.org/pipermail/docs/2011-February/003087.html 
here's a patch to read the contents of the file for long_description.

--
assignee: sandro.tosi
components: Documentation
files: distutils-read-longdescr-file-py3k.patch
keywords: patch
messages: 129127
nosy: sandro.tosi
priority: low
severity: normal
stage: patch review
status: open
title: Distutils - read the file when using it in long_description
versions: Python 3.3
Added file: 
http://bugs.python.org/file20850/distutils-read-longdescr-file-py3k.patch

___
Python tracker 

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



[issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec

2011-02-22 Thread dholth

dholth  added the comment:

What should this option be called?

connect(strict=True) ?

--
nosy: +dholth

___
Python tracker 

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



[issue11288] Python installed from MSI doesn't work

2011-02-22 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Can anybody reproduce this?

--

___
Python tracker 

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



[issue11288] Python installed from MSI doesn't work

2011-02-22 Thread Brian Curtin

Brian Curtin  added the comment:

It works fine for me. Just did a 32-bit Python 3.2 install on a Windows 7 
64-bit machine and IDLE works.

--

___
Python tracker 

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



[issue10924] Adding salt and Modular Crypt Format to crypt library.

2011-02-22 Thread Brett Cannon

Brett Cannon  added the comment:

I will look at the patch.

--
assignee: jafo -> brett.cannon
nosy: +brett.cannon
stage: committed/rejected -> patch review

___
Python tracker 

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



[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2011-02-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> As I said, my only intention here is be to document 
> (and argparsify/formalize) what is already there.

In a handful of cases, that would be useful; however,
for the most part, these APIs were undocumented for
a reason.  Some of the command-line interfaces were
slapped together without much of a design effort; some
were little more than quick-and-dirty ad-hoc tests.
It would be a mistake to "document and formalize"
accidental mini-apps.

There's no harm in adding --help or a usage example,
but please avoid making behavior guarantees that we
really don't want to have to live with.

Only "document and formalize" the parts that are well
thought out.

--

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Antoine, your msg129093 patch of test_zlib.py does it (with and
> without fprintf(3)s).  CRC ok etc., it just works.

Indeed, and it also seems to work on the buildbot. I will commit the
patch soon. Thanks for your help!

> (Seems mmap(2) has a problem here, i would say; the mentioned bug
> report is from 2003, so the golden sunset watchers may need some more
> additional time, if you allow me that comment.)

--

___
Python tracker 

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



[issue11288] Python installed from MSI doesn't work

2011-02-22 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Matthew: please run "python -v", and attach any output it makes to this report.

--

___
Python tracker 

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



[issue10924] Adding salt and Modular Crypt Format to crypt library.

2011-02-22 Thread Brett Cannon

Brett Cannon  added the comment:

The patch didn't even import as-is or past the tests, but I tweaked it so it 
did (and made method() just an attribute on the module).

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



[issue11288] Python installed from MSI doesn't work

2011-02-22 Thread Matthew Funke

Matthew Funke  added the comment:

Here's the output, in its entirety:

-

C:\Python32>python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
Fatal Python error: Py_Initialize: unable to load the file system codec
LookupError: no codec search functions registered: can't find encoding

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

--

___
Python tracker 

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



[issue11288] Python installed from MSI doesn't work

2011-02-22 Thread Matthew Funke

Matthew Funke  added the comment:

I also tried uninstalling, re-downloading the MSI, and re-installing, but no 
joy.  Thank you for any insight you can lend.

--

___
Python tracker 

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



[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Antoine's patch looks good to me.

Given the assumptions in the memoryview code, disallowing NULL for the buf 
pointer sounds like the right thing to do, even for zero-length buffers.

--

___
Python tracker 

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



[issue11294] Locale - update & uniform ERA_*_FMT doc

2011-02-22 Thread Sandro Tosi

New submission from Sandro Tosi :

Following up http://mail.python.org/pipermail/docs/2011-February/003004.html 
here's a patch to:

- clarify ERA_D_FMT is for date
- uniform the way {ERA_} descriptions are written (are not a native to 
know if it's better 'a date' or 'dates' (same goes for 'time'))
- add ERA_T_FMT

--
assignee: sandro.tosi
components: Documentation
files: locale_era_dt-py3k.patch
keywords: patch
messages: 129139
nosy: sandro.tosi
priority: low
severity: normal
stage: patch review
status: open
title: Locale - update & uniform ERA_*_FMT doc
versions: Python 3.3
Added file: http://bugs.python.org/file20851/locale_era_dt-py3k.patch

___
Python tracker 

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



[issue11277] test_zlib crashes under Snow Leopard buildbot

2011-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed in r88511 (3.3) and r88514 (3.2).

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



[issue11283] incorrect pattern in the re module docs for conditional regex

2011-02-22 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue11282] unittest document not keep consist with code

2011-02-22 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue11282] unittest document not keep consist with code

2011-02-22 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +michael.foord

___
Python tracker 

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



[issue3080] Full unicode import system

2011-02-22 Thread STINNER Victor

STINNER Victor  added the comment:

I started to commit some parts of the huge patch:

r88515: Mark PyWin_FindRegisteredModule() as private
r88516: Remove unused argument of _PyImport_GetDynLoadFunc()
r88517 (3.3), r88518 (3.2): document encoding used by import functions

--

___
Python tracker 

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



[issue11295] On Windows, Python crashes on ANSI / Windows-formatted source files

2011-02-22 Thread Jonathan Hayward

New submission from Jonathan Hayward :

So far as I can tell, Python 2.7 crashes on at least some ANSI / Windows 
\r\n-delimited source files. More specifically, as invoked by Apache as a CGI 
script, the source file line:

import cgi

generated an error logged by Apache, complaining that the module "cgi\r" 
couldn't be imported.

Email sent as follows:

--

Today I was visiting with a friend and installing OSS on his computer. On an 
x86_64 Windows 7 box, he had already installed Apache, and I installed Python 
with a python.org installer. I opened up Notepad and created a "Hello world" 
Python CGI script, put it in the cgi-bin directory, saw it crash, and looked in 
the logs.

The log message complained that I had tried to "import cgi\r": in other words, 
Python on Windows was choking because the file I made in Notepad used "\r\n" 
for line breaks. (The equivalent script made with vim, and presumably "\n" for 
line breaks worked predictably.)

Isn't it a defect/design flaw for Python on Windows to choke on 
"\r\n"-separated files? Should I file a bug, or is this a side effect of 
decisions that are now non-negotiable? (I wasn't thrilled, after trying to sell 
my friend on the idea that Python is a good language with a low barrier to 
entry, to find that it choked on a Notepad-edited "Hello world!" CGI script.)

--
components: Interpreter Core
messages: 129142
nosy: JonathanHayward
priority: normal
severity: normal
status: open
title: On Windows, Python crashes on ANSI / Windows-formatted source files
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



[issue3080] Full unicode import system

2011-02-22 Thread STINNER Victor

STINNER Victor  added the comment:

r88519: Mark _PyImport_FindBuiltin() argument as constant
r88520: Add PyModule_GetNameObject()

--

___
Python tracker 

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



[issue11272] input() has trailing carriage return on windows

2011-02-22 Thread STINNER Victor

STINNER Victor  added the comment:

Here is a patch to fix input() on Windows: strip also \r.

--
keywords: +patch
Added file: http://bugs.python.org/file20852/input_rn.patch

___
Python tracker 

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



[issue11272] input() has trailing carriage return on windows

2011-02-22 Thread Ezio Melotti

Ezio Melotti  added the comment:

Is it possible to add some tests for input()?

Also the patch uses tabs instead of spaces.

--

___
Python tracker 

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



[issue11296] Possible error in What's new in Python 3.2 : duplication of rsplit() mention

2011-02-22 Thread Carl Chenet

New submission from Carl Chenet :

Hi,

Could the rsplit() method be mentioned mistakenly two times in the following 
sentence of the current What's new in Python 3.2 ?

"The fast-search algorithm in stringlib is now used by the split(), rsplit(), 
splitlines() and replace() methods on bytes, bytearray and str objects. 
Likewise, the algorithm is also used by rfind(), rindex(), rsplit() and 
rpartition()."

Regards,
Carl Chenet

--
assignee: docs@python
components: Documentation
messages: 129146
nosy: chaica_, docs@python
priority: normal
severity: normal
status: open
title: Possible error in What's new in Python 3.2 : duplication of rsplit() 
mention
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



  1   2   >