[issue3811] Update Unicode database to 5.1.0

2008-09-11 Thread Martin v. Löwis

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

 The control characters?

Indeed, also the private-use characters. test_unicode explicitly
comments that the test is about unassigned characters, although
I don't understand the purpose of that test (it then also tests
a surrogate character, which is also guaranteed to remain
unprintable).

One of the characters that is guaranteed to remain unassigned is
U+FFFE (and its mirrors in other planes, e.g. U+1FFFE, ...).
This guarantee is made to support the BOM. Along with U+,
these are non-characters. #765036 once suggested that Python should
refuse to represent them at all, but that proposal was rejected.

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



[issue3832] add force_shared Library option to create shared lib even with use_stub=False

2008-09-11 Thread Martin v. Löwis

Changes by Martin v. Löwis [EMAIL PROTECTED]:


--
resolution:  - invalid
status: open - closed
versions: +3rd party

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2008-09-11 Thread Heikki Toivonen

Heikki Toivonen [EMAIL PROTECTED] added the comment:

Ok, thank you for clarifications. Now I understand why the hostname
checking isn't the solution that fits every problem. I am still not
completely clear how you'd do the checking otherwise, for example to
verify the service you are talking to is what you think it is.

But still, I think dealing with email servers is another common use case
where hostname check is adequate most of the time. I am sure there are
other cases like this. Therefore I am still of the opinion that the
default should be to do the hostname check. Yes, make it overridable,
but doing the check is safer than not doing any checking IMO because
even if the check is incorrect for a certain purpose the developer is
likely to notice an error quickly and inclined to do some other security
check instead of not doing anything and thinking they have a secure system.

If you want to continue the discussion, we should maybe take this to
some other forum, like comp.lang.python.

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



[issue3642] Objects/obmalloc.c:529: warning: comparison is always false due to limited range of data type

2008-09-11 Thread Martin v. Löwis

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

I have now committed the new patch as r66383 and r66384

--
resolution:  - fixed
status: open - closed

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



[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2008-09-11 Thread Brett Cannon

Changes by Brett Cannon [EMAIL PROTECTED]:


--
keywords: +patch -needs review

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



[issue3640] test_cpickle crash on AMD64 Windows build

2008-09-11 Thread Martin v. Löwis

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

The patch is fine, please apply. My only question is why the 3.0 patch
integrates the find_recursionlimit change, whereas the 2.6 patch does not.

--
assignee: mhammond - amaury.forgeotdarc
nosy: +loewis
resolution:  - accepted

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



[issue3830] Tarfile has incorrect USTAR VERSION field (should be 00; is 0 NUL)

2008-09-11 Thread Lars Gustäbel

Lars Gustäbel [EMAIL PROTECTED] added the comment:

This problem existed only in the first 2.5 release.

--
resolution:  - works for me
status: open - closed

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



[issue3531] file read preallocs 'size' bytes which can cause memory problems

2008-09-11 Thread Anthon van der Neut

Anthon van der Neut [EMAIL PROTECTED] added the comment:

FWIW:
I have performance problems on Windows XP (SP2) with Python 2.5.1 that
could be caused by this behaviour.
My code regularily calculates the sha1 sum of 10.000 files and because
in another reuse of the code had to deal with files too big to fit in memory
I set a limit of 256Mb. It looks like that is now allocated and
deallocated for every one of the 10.000 files, making things *very* slow.

--
nosy: +anthon

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



[issue3110] Multiprocessing package build problem on Solaris 10

2008-09-11 Thread Martin v. Löwis

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

According to POSIX, if no determinate value for SEM_VALUE_MAX can be
given, the actual value should be queried with
sysconf(_SC_SEM_VALUE_MAX), and SEM_VALUE_MAX should not be defined;
this is in particular the case when the value depends on the system
configuration (such as available memory). _POSIX_SEM_VALUE_MAX specifies
the minimum value guaranteed by POSIX.

Now, it is not plausible why SEM_VALUE_MAX should vary by installation,
as it just depends on what integer type is used to represent the
counter. So more likely, Sun wrote its header files at a time when the
spec was not finished, so they didn't want to clutter the global namespace.

IOW, I think the patch is fine as it stands. If you are over-cautious,
you should test whether _SC_SEM_VALUE_MAX is defined, and use sysconf in
that case, and only fall back to _SEM_VALUE_MAX, then
_POSIX_SEM_VALUE_MAX, then fail, if sysconf isn't available.

If you do make this change, please stop using Py_BuildValue to convert a
C int to a Python int; use PyInt_FromLong instead.

--
keywords:  -needs review
nosy: +loewis

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3110
___
___
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

2008-09-11 Thread Gerhard Häring

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

I like Skip's version better, because it's closer to the dbm
specification instead of trying to mimic bsddb (first, last, etc.).
I'd like to keep such things out.

I've made a few changes to the sandbox project which I will check in
later today. The most important change is support for a fast mode,
which doesn't commit changes until you call the synch() method. synch()
is also called on close().

Perhaps we should do automatic commits every n (like 1000) changes, too?

What's all this ORDER BY in both your implementations about? The dbm
spec says nothing about keys being ordered AFAIC. Can we get rid of these?

--
nosy: +ghaering

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3783
___
___
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

2008-09-11 Thread Gerhard Häring

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

One question about Josiah's _check_value(). SQLite is less crippled than
other simplistic databases and also supports integers, reals and blobs
in addition to strings.

Shouldn't we make this accessible to users? Or is compatibility with
other dbm implementations more important?

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



[issue3640] test_cpickle crash on AMD64 Windows build

2008-09-11 Thread Amaury Forgeot d'Arc

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

- cpickle.patch and find_recursion_limit.patch are for 2.6
- cpickle.patch-3.0.patch groups the two previous patches, adapted to 3.0.

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



[issue3640] test_cpickle crash on AMD64 Windows build

2008-09-11 Thread Martin v. Löwis

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

Ah, ok. It's all fine, then.

--
keywords:  -needs review

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



[issue3834] wsgiref.validator.InputWrapper readline method has wrong signature

2008-09-11 Thread Christopher Arndt

New submission from Christopher Arndt [EMAIL PROTECTED]:

The readline method in the InputWrapper class in wsgiref.validate does
not  accept any arguments and therefore is not compatible with the
file-like interface, where the readline method accepts an optional
size argument. 

This breaks code that wraps file objects with their own wrapper class
and tries to call the readline method of the wrapped object with a
size argument.

Current code::

def readline(self):
v = self.input.readline()
assert_(type(v) is type())
return v


Should be::

def readline(self, *args):
v = self.input.readline(*args)
assert_(type(v) is type())
return v

--
components: Library (Lib)
messages: 73016
nosy: strogon14
severity: normal
status: open
title: wsgiref.validator.InputWrapper readline method has wrong signature
versions: Python 2.5

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



[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2008-09-11 Thread Nick Coghlan

Nick Coghlan [EMAIL PROTECTED] added the comment:

Applied to trunk for 2.6 in r66386.

--
priority: release blocker - deferred blocker

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3781
___
___
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

2008-09-11 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

Gerhard What's all this ORDER BY in both your implementations about?
Gerhard The dbm spec says nothing about keys being ordered AFAIC. Can
Gerhard we get rid of these?

I'd like to guarantee that zip(db.keys(), db.values() == db.items().

Skip

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



[issue3831] Multiprocessing: Expose underlying pipe in queues

2008-09-11 Thread Jesse Noller

Jesse Noller [EMAIL PROTECTED] added the comment:

Steve, I'm a little nervous about exposing the underlying Queue pipes in 
an official API simply due to the fact that it is an advanced use case, 
and we do want to keep the API simple, and relatively close to the core 
Queue implementation.

Do you have an example use-case/code? This will not be making it into 
python 2.6/3.0 - it will need to wait until 2.7 and 3.1 at very least.

--
nosy: +roudkerk
versions: +Python 2.7, Python 3.1 -Python 2.6

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



[issue3835] tkinter goes into an infinite loop (pydoc.gui)

2008-09-11 Thread Helmut Jarausch

New submission from Helmut Jarausch [EMAIL PROTECTED]:

With version 3.0 (SVN 66386)

import pydoc
pydoc.gui()

gives

 Exception in thread Thread-1:
Traceback (most recent call last):
  File /usr/local/lib/python3.0/threading.py, line 507, in 
_bootstrap_inner
self.run()
  File /usr/local/lib/python3.0/threading.py, line 462, in run
self._target(*self._args, **self._kwargs)
  File /usr/local/lib/python3.0/pydoc.py, line 1989, in serve
DocServer(port, callback).serve_until_quit()
  File /usr/local/lib/python3.0/pydoc.py, line 1971, in __init__
self.base.__init__(self, self.address, self.handler)
  File /usr/local/lib/python3.0/socketserver.py, line 401, in __init__
self.server_activate()
  File /usr/local/lib/python3.0/pydoc.py, line 1982, in 
server_activate
if self.callback: self.callback(self)
  File /usr/local/lib/python3.0/pydoc.py, line 2072, in ready
text='Python documentation server at\n' + server.url)
  File /usr/local/lib/python3.0/tkinter/__init__.py, line 1199, in 
configure
return self._configure('configure', cnf, kw)
  File /usr/local/lib/python3.0/tkinter/__init__.py, line 1190, in 
_configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: out of stack space (infinite loop?)

--
components: Extension Modules
messages: 73021
nosy: HWJ
severity: normal
status: open
title: tkinter goes into an infinite loop (pydoc.gui)
type: crash
versions: Python 3.0

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



[issue3531] file read preallocs 'size' bytes which can cause memory problems

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

 My code regularily calculates the sha1 sum of 10.000 files and because
 in another reuse of the code had to deal with files too big to fit in
 memory I set a limit of 256Mb.

Why don't you use a sensible buffer size, e.g. 1MB? Reading data in
256MB chunks sounds foolish in any case.

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



[issue3531] file read preallocs 'size' bytes which can cause memory problems

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

Andrew, as for memory reallocation issues, you may take a look at #3526
where someone has similar problems on SunOS.

If nobody objects, I will close the present bug as invalid.

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



[issue3640] test_cpickle crash on AMD64 Windows build

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

By the way, this isn't caused by the present issue, but you'll notice
that in the latest trunk, some tests in find_recursion_limit.py fail
with an AttributeError instead of RuntimeError. This is likely caused by
a PyDict_GetItem() call discarding the RuntimeError somewhere and
returning NULL, which in turn raises an AttributeError (as I explained
on the mailing-list).

A quick way to fix it would be to use except (AttributeError,
RuntimeError) in the testing func of find_recursion_limit.py.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3640
___
___
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

2008-09-11 Thread Gerhard Häring

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

 I'd like to guarantee that zip(db.keys(), db.values() == db.items().

Ok. If that isn't guaranteed elsewhere just drop it here?

FWIW that will also work without the ORDER BY, because you're getting
the rows back in the same ORDER. Something cheaper would also be ORDER
BY ROWID. I still propose to just do without the ORDER BY.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3783
___
___
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

2008-09-11 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

 I'd like to guarantee that zip(db.keys(), db.values() == db.items().

Antoine It doesn't sound very useful, and it may hurt performance on
Antoine big tables.

Actually, I think Python guarantees (for dicts at least - other mappings
should probably follow suit) that if you call keys() then call values()
without making any changes to the dict that their orders match, e.g., that

zip(d.keys(), d.values()) == d.items()

Skip

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3783
___
___
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

2008-09-11 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

Gerhard FWIW that will also work without the ORDER BY, because you're
Gerhard getting the rows back in the same ORDER. Something cheaper
Gerhard would also be ORDER BY ROWID. I still propose to just do
Gerhard without the ORDER BY.

As long as SQLite guarantees that the ordering is identical, then sure, dump
the ORDER BY clause.

Skip

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3783
___
___
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

2008-09-11 Thread Gerhard Häring

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

Skip Montanaro wrote:
 Skip Montanaro [EMAIL PROTECTED] added the comment:
 
 Gerhard FWIW that will also work without the ORDER BY, because you're
 Gerhard getting the rows back in the same ORDER. Something cheaper
 Gerhard would also be ORDER BY ROWID. I still propose to just do
 Gerhard without the ORDER BY.
 
 As long as SQLite guarantees that the ordering is identical, then sure, dump
 the ORDER BY clause.

It doesn't guarantee it, but the implementation behaves like this.

-- Gerhard

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



[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2008-09-11 Thread Nick Coghlan

Nick Coghlan [EMAIL PROTECTED] added the comment:

Blocked merge in the py3k branch since it requires some fiddling to
handle the change from test.test_support to test.support. I'll post a
new patch here for the py3k forward port when I can (I may not make it
before 3.0b4 though, so unassigning for the moment).

--
assignee: ncoghlan - 
versions:  -Python 2.6

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



[issue3531] file read preallocs 'size' bytes which can cause memory problems

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

Le jeudi 11 septembre 2008 à 16:01 +0200, Anthon van der Neut a écrit :
 The thing however was resolved by reading multiple smaller chunks indeed
 1Mb if the filesize exceeds 1Mb (in the latter case the original read()
 is done.

It's too complicated. Just use chunks in all cases (even small files)
and you are done. There should be no visible performance downside to
doing so.

Using fixed-size chunks to read binary data from a file of an unknown
size isn't a Python-specific idiom, really. It's the same in C, C++,
PHP, etc.

--
title: file read preallocs 'size' bytes which can cause memory problems - file 
read preallocs 'size' bytes which can cause memory  problems

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



[issue3103] sqlite defines a few global symbols.

2008-09-11 Thread Gerhard Häring

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

I've fixed that in the externally maintained pysqlite. I suppose it's
too late to bring this into 2.6 or 3.0, right?

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3103
___
___
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

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

Le jeudi 11 septembre 2008 à 13:48 +, Skip Montanaro a écrit :
 Actually, I think Python guarantees (for dicts at least - other mappings
 should probably follow suit) that if you call keys() then call values()
 without making any changes to the dict that their orders match, e.g., that
 
 zip(d.keys(), d.values()) == d.items()

Perhaps. I've never written any code that relies this, though, and it
doesn't sound like an useful guarantee since you can just use the
items() method anyway. It probably dates back to an era when list
comprehensions didn't exist, and extracting keys or values from the
items list required several lines of code and costly method calls.

Also, the point is that Python dicts can make that guarantee without
being any slower. It may not be the same for an RDBMS backend. Why?
Because, depending on the backend, index and data can be stored in
separate areas with different storage layouts (e.g. keys are in a B tree
while values are just dumped sequentially). If you only ask for
unordered keys, they will be read in optimal (sequential) index order,
and if you only ask for unordered values, they will be read in optimal
(sequential) data order, which is not the same. This is true for e.g.
MySQL.

(also, IMO this discussion proves that the module shouldn't be included
in Python 3.0. It's too young, its API hasn't even settled down)

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



[issue3103] sqlite defines a few global symbols.

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

If they aren't part of a public API I think it's ok to fix them in
2.6/3.0. It is a bug fix, not a feature change.

--
nosy: +pitrou

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3103
___
___
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

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

I might add that calling keys() then values() is suboptimal, because it
will issue two SQL queries while calling items() will issue just one.

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



[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' [EMAIL PROTECTED]:


--
nosy: +giampaolo.rodola

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



[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

Thorben, is the problem still there if you use fork() rather than
launching a separate thread for the server?

The implementation of the recv() method is straightforward and I don't
see anything that could cause a huge latency there, it's just a simple
wrapper over the C library's recv() function. The waiting certainly
occurs inside the OS rather than inside the Python interpreter.

--
nosy: +pitrou

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2008-09-11 Thread Bill Janssen

Bill Janssen [EMAIL PROTECTED] added the comment:

I think that, where it's appropriate, you can do that.  Just don't put it in
the SSL module.

Bill

On Wed, Sep 10, 2008 at 11:24 PM, Heikki Toivonen [EMAIL PROTECTED]wrote:


 Heikki Toivonen [EMAIL PROTECTED] added the comment:

 Ok, thank you for clarifications. Now I understand why the hostname
 checking isn't the solution that fits every problem. I am still not
 completely clear how you'd do the checking otherwise, for example to
 verify the service you are talking to is what you think it is.

 But still, I think dealing with email servers is another common use case
 where hostname check is adequate most of the time. I am sure there are
 other cases like this. Therefore I am still of the opinion that the
 default should be to do the hostname check. Yes, make it overridable,
 but doing the check is safer than not doing any checking IMO because
 even if the check is incorrect for a certain purpose the developer is
 likely to notice an error quickly and inclined to do some other security
 check instead of not doing anything and thinking they have a secure system.

 If you want to continue the discussion, we should maybe take this to
 some other forum, like comp.lang.python.

 ___
 Python tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1589
 ___


Added file: http://bugs.python.org/file11463/unnamed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1589
___div dir=ltrI think that, where it#39;s appropriate, you can do that.nbsp; 
Just don#39;t put it in the SSL module.brbrBillbrbrdiv 
class=gmail_quoteOn Wed, Sep 10, 2008 at 11:24 PM, Heikki Toivonen span 
dir=ltrlt;a href=mailto:[EMAIL PROTECTED][EMAIL 
PROTECTED]/agt;/span wrote:br
blockquote class=gmail_quote style=border-left: 1px solid rgb(204, 204, 
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;div class=Ih2E3dbr
Heikki Toivonen lt;a href=mailto:[EMAIL PROTECTED][EMAIL 
PROTECTED]/agt; added the comment:br
br
/divOk, thank you for clarifications. Now I understand why the hostnamebr
checking isn#39;t the solution that fits every problem. I am still notbr
completely clear how you#39;d do the checking otherwise, for example tobr
verify the service you are talking to is what you think it is.br
br
But still, I think dealing with email servers is another common use casebr
where hostname check is adequate most of the time. I am sure there arebr
other cases like this. Therefore I am still of the opinion that thebr
default should be to do the hostname check. Yes, make it overridable,br
but doing the check is safer than not doing any checking IMO becausebr
even if the check is incorrect for a certain purpose the developer isbr
likely to notice an error quickly and inclined to do some other securitybr
check instead of not doing anything and thinking they have a secure system.br
br
If you want to continue the discussion, we should maybe take this tobr
some other forum, like comp.lang.python.br
divdiv/divdiv class=Wj3C7cbr
___br
Python tracker lt;a href=mailto:[EMAIL PROTECTED][EMAIL 
PROTECTED]/agt;br
lt;a href=http://bugs.python.org/issue1589; 
target=_blankhttp://bugs.python.org/issue1589/agt;br
___br
/div/div/blockquote/divbr/div
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3836] 2to3 broken due to mixed 2.5 and 3.0 syntax

2008-09-11 Thread Haoyu Bai

New submission from Haoyu Bai [EMAIL PROTECTED]:

In the py3k SVN head(r66389) of lib2to3, the main.py used Python 2.x's
print syntax, and the refactor.py used Python 3.0's exception syntax. So
the 2to3 finally broken on both Python 2.5 and 3.0.

Well, it able to run with Python 2.6, but also have a lot of errors like
this:

Traceback (most recent call last):
  File /usr/bin/2to3, line 6, in module
sys.exit(main(lib2to3.fixes))
  File /home/kid/python-site/lib2to3/main.py, line 71, in main
rt = refactor.RefactoringTool(fixer_names, rt_opts, explicit=explicit)
  File /home/kid/python-site/lib2to3/refactor.py, line 119, in __init__
self.pre_order, self.post_order = self.get_fixers()
  File /home/kid/python-site/lib2to3/refactor.py, line 138, in get_fixers
mod = __import__(fix_mod_path, {}, {}, [*])
  File /home/kid/python-site/lib2to3/fixes/fix_dict.py, line 38, in
module
class FixDict(fixer_base.BaseFix):
  File /home/kid/python-site/lib2to3/fixes/fix_dict.py, line 76, in
FixDict
p1 = patcomp.compile_pattern(P1)
  File /home/kid/python-site/lib2to3/patcomp.py, line 186, in
compile_pattern
return PatternCompiler().compile_pattern(pattern)
  File /home/kid/python-site/lib2to3/patcomp.py, line 57, in
compile_pattern
root = self.driver.parse_tokens(tokens, debug=debug)
  File /home/kid/python-site/lib2to3/pgen2/driver.py, line 45, in
parse_tokens
for quintuple in tokens:
  File /home/kid/python-site/lib2to3/patcomp.py, line 34, in
tokenize_wrapper
tokens = tokenize.generate_tokens(driver.generate_lines(input).__next__)
AttributeError: 'generator' object has no attribute '__next__'

--
assignee: collinwinter
components: 2to3 (2.x to 3.0 conversion tool)
messages: 73037
nosy: bhy, collinwinter
severity: normal
status: open
title: 2to3 broken due to mixed 2.5 and 3.0 syntax
type: crash

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



[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Thorben

Thorben [EMAIL PROTECTED] added the comment:

The problem exists even if the server part is replaced by a server
written in C. I only wrote up the dummy server in python to be able to
provide a testcase.

The C server works with reasonable speed when connected to a client
written in perl by the way. My employer is quite disappointed with
Python's performance... (He provided the profiler data for the Mac by
the way) I almost wish that I did something wrong, but this does not
seem to be the case.

Nevertheless, I will try out your suggestion.

Thanks for replying,

Thorben

2008/9/11 Antoine Pitrou [EMAIL PROTECTED]:

 Antoine Pitrou [EMAIL PROTECTED] added the comment:

 Thorben, is the problem still there if you use fork() rather than
 launching a separate thread for the server?

 The implementation of the recv() method is straightforward and I don't
 see anything that could cause a huge latency there, it's just a simple
 wrapper over the C library's recv() function. The waiting certainly
 occurs inside the OS rather than inside the Python interpreter.

 --
 nosy: +pitrou

 ___
 Python tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue3766
 ___


--
nosy: +Thorben

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



[issue3837] Comment for html_logo setting is out of date

2008-09-11 Thread Janet Swisher

New submission from Janet Swisher [EMAIL PROTECTED]:

In Sphinx 0.4.2, the handling of the html_logo setting was changed to
use a relative path, like latex_logo, rather than the static path.
However, the comment for html_logo in the quickstart template was not
changed. This caused me confusion because Sphinx did not copy my logo
file from the static path.

Current::

  # The name of an image file (within the static path) to place at the
top of
  # the sidebar.
  #html_logo = None

Revised::

  # The name of an image file (relative to this directory) to place at
the top of
  # the sidebar.
  #html_logo = None

--
assignee: georg.brandl
components: Documentation tools (Sphinx)
messages: 73041
nosy: georg.brandl, jmswisher
severity: normal
status: open
title: Comment for html_logo setting is out of date

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



[issue3836] 2to3 broken due to mixed 2.5 and 3.0 syntax

2008-09-11 Thread Haoyu Bai

Haoyu Bai [EMAIL PROTECTED] added the comment:

A patch on main.py to fix this.

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

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



[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

You can use setsockopt() to set the TCP_NODELAY flag and see if that
improves things; sending thousands of 4-bytes packets isn't exactly the
expected utilization of TCP.

As I said, socket.recv() is just a thin wrapper above the same-named C
library function. Your code expects the kernel's TCP stack to send
things as soon as you ask it to, but TCP is a high-level stream protocol
and implementations usually have sophisticated algorithms in order to
minimize the number of individual packets sent over the wire.

By the way, if you want to build network applications (clients and
servers), I suggest you take a look at the Twisted framework. It will
free you from many low-level issues, although it won't prevent you from
shooting yourself in the foot :-)

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



[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Thorben

Thorben [EMAIL PROTECTED] added the comment:

2008/9/11 Antoine Pitrou [EMAIL PROTECTED]:

 Antoine Pitrou [EMAIL PROTECTED] added the comment:

 You can use setsockopt() to set the TCP_NODELAY flag and see if that
 improves things; sending thousands of 4-bytes packets isn't exactly the
 expected utilization of TCP.

You are obviously right, but IIRC, I mentioned that this is simply a
dummy testcase...

now thats interesting:
adding the line sock.setsockopt(SOL_TCP, TCP_NODELAY, 1)  decreased
the delay by half. It still is extremely high but it's a start.

Do you think I could get that value down much further? I don't know
much about TCP...

 As I said, socket.recv() is just a thin wrapper above the same-named C
 library function. Your code expects the kernel's TCP stack to send
 things as soon as you ask it to, but TCP is a high-level stream protocol
 and implementations usually have sophisticated algorithms in order to
 minimize the number of individual packets sent over the wire.

Would be interesting to examine the differences between the Perl
wrapper and the Python wrapper to figure out why Perl does the right
thing in this case and Python doesn't.

 By the way, if you want to build network applications (clients and
 servers), I suggest you take a look at the Twisted framework. It will
 free you from many low-level issues, although it won't prevent you from
 shooting yourself in the foot :-)

Thanks, I'll make sure to try it out.

 ___
 Python tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue3766
 ___


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



[issue3838] test_tarfile error on cygwin (Directory not empty)

2008-09-11 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto [EMAIL PROTECTED]:

This differs from issue3824. test_tarfile claims following error at the
end of test.

Traceback (most recent call last):
  File test_tarfile.py, line 1210, in module
test_main()
  File test_tarfile.py, line 1207, in test_main
shutil.rmtree(TEMPDIR)
  File /home/WhiteRabbit/python-dev/trunk/Lib/shutil.py, line 225, in
rmtree
onerror(os.rmdir, path, sys.exc_info())
  File /home/WhiteRabbit/python-dev/trunk/Lib/shutil.py, line 223, in
rmtree
os.rmdir(path)
OSError: [Errno 90] Directory not empty:
'/cygdrive/c/DOCUME~1/WHITER~1/LOCALS~1
/Temp/test_tarfile_tmp'

I've attached patch.

--
files: test_tarfile.patch
keywords: easy, patch
messages: 73044
nosy: ocean-city
severity: normal
status: open
title: test_tarfile error on cygwin (Directory not empty)
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file11465/test_tarfile.patch

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



[issue3839] wsgi.simple_server resets 'Content-Length' header on empty content even if app defined it.

2008-09-11 Thread Clovis Fabricio

New submission from Clovis Fabricio [EMAIL PROTECTED]:

The finish_content method in wsgiref.handlers.BaseHandler class resets
Content-Length to 0 if there was no content returned by the
application, even if the application has set it already.

That makes impossible to implement things like HEAD requests in the
application, which should return the Content-Length without returning
actual content.

The desired behavior would be to respect the header set by the wsgi
application, using 0 as a default value instead.

--
components: Library (Lib)
files: wsgiref.handlers.py.patch
keywords: patch
messages: 73045
nosy: nosklo
severity: normal
status: open
title: wsgi.simple_server resets 'Content-Length' header on empty content even 
if app defined it.
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file11466/wsgiref.handlers.py.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3839
___
___
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

2008-09-11 Thread Josiah Carlson

Changes by Josiah Carlson [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file11412/sq_dict.py

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3783
___
___
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

2008-09-11 Thread Josiah Carlson

Josiah Carlson [EMAIL PROTECTED] added the comment:

 I like Skip's version better, because it's closer to the dbm
 specification instead of trying to mimic bsddb (first, last, etc.).
 I'd like to keep such things out.

dbm.sqlite is meant as a potential replacement of dbm.bsddb.  Since 
people do use the extra methods (.first(), .last(), etc.), not having 
them could lead to breakage.

Separating them out into a subclass (regular open doesn't have it, but 
btopen does), along with all of the other order guarantees (the ORDER BY 
clauses in the SQL statements), could keep it fast for people who don't 
care about ordering, and keep it consistent for those who do care about 
ordering.

Attached you will find an updated version.

Added file: http://bugs.python.org/file11467/sq_dict.py

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



[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

 now thats interesting:
 adding the line sock.setsockopt(SOL_TCP, TCP_NODELAY, 1)  decreased
 the delay by half. It still is extremely high but it's a start.

Did you do it on both the client and server sockets?

 Would be interesting to examine the differences between the Perl
 wrapper and the Python wrapper to figure out why Perl does the right
 thing in this case and Python doesn't.

Perhaps the Perl wrapper is less thin as the Python one. In any case,
it's by design if the Python socket wrapper doesn't try to be smart:
the intent is to provide an access to the C API and let people do what
they want with it. Smart things are relegated to higher-level modules or
libraries.

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



[issue3841] IDLE: quirky behavior when displaying strings longer than 4093 characters

2008-09-11 Thread Stephen McInerney

New submission from Stephen McInerney [EMAIL PROTECTED]:

IDLE exhibits quirky behavior when displaying strings longer than 4093 
characters

Python versions: believed to be all. I found this on Python 2.5 / IDLE 
1.2.2
OS: Windows Vista; let me know if it repros on others.

Testcase attached has a length-4094 string.
IDLE will not display this unless your cursor is inside the string.
If you delete characters so length = 4093, IDLE displays it ok again.

--
components: IDLE
messages: 73049
nosy: spmcinerney
severity: normal
status: open
title: IDLE: quirky behavior when displaying strings longer than 4093 characters
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7

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



[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Thorben

Thorben [EMAIL PROTECTED] added the comment:

2008/9/11 Antoine Pitrou [EMAIL PROTECTED]:

 Antoine Pitrou [EMAIL PROTECTED] added the comment:

 now thats interesting:
 adding the line sock.setsockopt(SOL_TCP, TCP_NODELAY, 1)  decreased
 the delay by half. It still is extremely high but it's a start.

 Did you do it on both the client and server sockets?

Yes, obviously. Although adding it to the client socket did make no
difference after I had already done so for the server. Still
communication is too slow by orders of magnitude. (Sorry for pointing
this out again)

 Would be interesting to examine the differences between the Perl
 wrapper and the Python wrapper to figure out why Perl does the right
 thing in this case and Python doesn't.

 Perhaps the Perl wrapper is less thin as the Python one. In any case,
 it's by design if the Python socket wrapper doesn't try to be smart:
 the intent is to provide an access to the C API and let people do what
 they want with it. Smart things are relegated to higher-level modules or
 libraries.

I would greatly appreciate any help on the subject. How do *BSD
sockets differ from Linux sockets and what do I do to make things
faster. I think this might be where the real issue is. Low level
networking voodoo. Do you think twisted might help me there?

 ___
 Python tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue3766
 ___


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



[issue3840] test_urllib fails on cygwin

2008-09-11 Thread Hirokazu Yamamoto

Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:

I cannot create patch now, but test_site error comes from same reason.
test_support.TESTFN is /tmp/@test on cygwin

After I applied following adhok patch, test passed.

Index: Lib/test/test_site.py
===
--- Lib/test/test_site.py   (revision 66385)
+++ Lib/test/test_site.py   (working copy)
@@ -126,7 +126,7 @@
 class PthFile(object):
 Helper class for handling testing of .pth files

-def __init__(self, filename_base=TESTFN, imported=time,
+def __init__(self, filename_base=@test, imported=time,
 good_dirname=__testdir__, bad_dirname=__bad):
 Initialize instance variables
 self.filename = filename_base + .pth

site.py's addpackage() is doing

fullname = os.path.join(sitedir, name)

and on my cygwin, this equals to

os.path.join(
/home/WhiteRabbit/python-dev/trunk/lib/test,
/tmp/@test.pth) #= /tmp/@test.pth

probably this is not good. (I cannot figure out what site.py is doing
though)

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



[issue3842] can't run close through itertools.chain on inner generator

2008-09-11 Thread Bruce Frederiksen

New submission from Bruce Frederiksen [EMAIL PROTECTED]:

There is no way to get generators to clean up (run their 'finally'
clause) when used as an inner iterable to chain:

 def gen(n):
... try:
... # do stuff yielding values
... finally:
... # clean up
 c = chain.from_iterable(map(gen, (1,2,3)))
 next(c)
0
 # done with c, but can't clean up inner gen!

Could you add a 'close' method to itertools.chain that would call close
(if present) on both the inner and other iterable?  Then clean up could
be done as:

 with closing(chain.from_iterable(map(gen, (1,2,3 as c:
...next(c)
 # generator finalized by with closing!

--
components: Extension Modules
messages: 73052
nosy: dangyogi
severity: normal
status: open
title: can't run close through itertools.chain on inner generator
type: feature request
versions: Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3842
___
___
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

2008-09-11 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

 As long as SQLite guarantees that the ordering is identical, then
 sure, dump the ORDER BY clause.

Gerhard It doesn't guarantee it, but the implementation behaves like
Gerhard this.

If the behavior isn't guaranteed, I think you need to retain ORDER BY.

Skip

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3783
___
___
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

2008-09-11 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

Antoine I might add that calling keys() then values() is suboptimal,
Antoine because it will issue two SQL queries while calling items()
Antoine will issue just one.

Well, sure, but heaven only knows what an application programmer will do...

S

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



[issue3840] if TESTFN == /tmp/@test, some tests fail

2008-09-11 Thread Hirokazu Yamamoto

Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:

Same happend in test_import.py too.

test_support.TESTFN is /tmp/@test on cygwin
This was false information. There was a directry named @test, so
open(TESTFN, w+) in test_support.py failed, /tmp/@test was used instead.

Several tests seem to assume TESTFN is relative path (filename?), so
maybe should we use @test2 as TESTFN if @test is not writable and vise
versa? (Or simply test fails if @test is not writable)

--
title: test_urllib fails on cygwin - if TESTFN == /tmp/@test, some tests fail
versions:  -Python 2.5, Python 3.0

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



[issue3836] 2to3 broken due to mixed 2.5 and 3.0 syntax

2008-09-11 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

main.py is really not a public interface, but it should be fixed.

--
assignee: collinwinter - benjamin.peterson
nosy: +benjamin.peterson
priority:  - high

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



[issue3781] warnings.catch_warnings fails gracelessly when recording warnings but no warnings are emitted

2008-09-11 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

On Thu, Sep 11, 2008 at 9:03 AM, Nick Coghlan [EMAIL PROTECTED] wrote:

 Nick Coghlan [EMAIL PROTECTED] added the comment:

 Blocked merge in the py3k branch since it requires some fiddling to
 handle the change from test.test_support to test.support. I'll post a
 new patch here for the py3k forward port when I can (I may not make it
 before 3.0b4 though, so unassigning for the moment).

The best way to do that is:

(trunk) $ svn diff -c mergerevision Lib/test/test_support.py  diff.patch
(py3k) $ patch Lib/test/support.py  diff.patch


 --
 assignee: ncoghlan -
 versions:  -Python 2.6

 ___
 Python tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue3781
 ___


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



[issue3640] test_cpickle crash on AMD64 Windows build

2008-09-11 Thread Amaury Forgeot d'Arc

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

Committed as r66390 and r66391.

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

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



[issue3836] 2to3 broken due to mixed 2.5 and 3.0 syntax

2008-09-11 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Fixed in r66392.

--
resolution:  - fixed
status: open - closed

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



[issue3842] can't run close through itertools.chain on inner generator

2008-09-11 Thread Benjamin Peterson

Changes by Benjamin Peterson [EMAIL PROTECTED]:


--
assignee:  - rhettinger
nosy: +rhettinger
versions: +Python 2.7, Python 3.1 -Python 3.0

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



[issue3843] hexadecimal, not decimal

2008-09-11 Thread maix

New submission from maix [EMAIL PROTECTED]:

On http://docs.python.org/dev/library/string.html, at the format string
documentation, it says:

 The '#' option is only valid for integers, and only for binary, octal,
or *decimal* output. If present, it specifies that the output will be
prefixed by '0b', '0o', or '0x', respectively.

The decimal is wrong, hexadecimal is meant there.

--
assignee: georg.brandl
components: Documentation
messages: 73060
nosy: georg.brandl, maix
severity: normal
status: open
title: hexadecimal, not decimal
versions: Python 2.6

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



[issue3834] wsgiref.validator.InputWrapper readline method has wrong signature

2008-09-11 Thread Benjamin Peterson

Changes by Benjamin Peterson [EMAIL PROTECTED]:


--
assignee:  - pje
nosy: +pje

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



[issue3657] pickle can pickle the wrong function

2008-09-11 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

I can reproduce this on 2.6.

--
nosy: +benjamin.peterson

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



[issue3843] hexadecimal, not decimal

2008-09-11 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Thanks! Fixed in r66394.

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

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



[issue586680] -S hides standard dynamic modules

2008-09-11 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Note that this does cause incompatibility between development copies and
installed copies:

$ python -S -c import itertools; print itertools
module 'itertools' from ...

$ ./python -S -c import itertools; print itertools
Traceback (most recent call last):
  File string, line 1, in module
ImportError: No module named itertools

--
nosy: +benjamin.peterson

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



[issue3834] wsgiref.validator.InputWrapper readline method has wrong signature

2008-09-11 Thread Phillip J. Eby

Phillip J. Eby [EMAIL PROTECTED] added the comment:

Per PEP 333:

The optional size argument to readline() is not supported, as it
may be complex for server authors to implement, and is not often used in
practice.

The whole point of this code is to catch broken programs that pass an
argument to readline() -- they are not WSGI-compliant.

--
resolution:  - invalid
status: open - closed

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



[issue3837] Comment for html_logo setting is out of date

2008-09-11 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Thanks, fixed in r66397.

--
resolution:  - fixed
status: open - closed

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



[issue3531] file read preallocs 'size' bytes which can cause memory problems

2008-09-11 Thread Andrew Dalke

Andrew Dalke [EMAIL PROTECTED] added the comment:

I'm still undecided on if this is a bug or not.  The problem occurs even 
when I'm not reading data from a file of an unknown size.  My example 
causes a MemoryError on my machine even though the file I'm reading 
contains 0 bytes.

The problem is Python's implementation is alloc the requested bytes and 
truncate if needed vs what I expected read chunks at a time up to the 
requested number of bytes.  There's nothing in the documentation which 
states the implementation, although Note that this method may call the 
underlying C function fread more than once in an effort to acquire as 
close to size bytes as possible. leans slightly towards my 
interpretation.

I looked a little for real-world cases that could cause a denial-of-
service attack but didn't find one.

If there is a problem, it will occur very rarely.  Go ahead an mark it 
as will not fix or something similar.  I don't think the change in the 
code is justifiable.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3531
___
___
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

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

 Well, sure, but heaven only knows what an application programmer will do...

If the docs clearly explain that there is no guarantee, we don't need
heaven.
I would find it strange to potentially ruin performance just for a
guarantee which has no useful purpose.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3783
___
___
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

2008-09-11 Thread Josiah Carlson

Josiah Carlson [EMAIL PROTECTED] added the comment:

 I would find it strange to potentially ruin performance just for a
 guarantee which has no useful purpose.

Benchmarks to prove or disprove performance changes?  Subclasses to 
offer different order by semantics (see the version I uploaded for an 
example)?  Consistent behavior wrt dictionaries?

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



[issue3831] Multiprocessing: Expose underlying pipe in queues

2008-09-11 Thread Steve Smith

Steve Smith [EMAIL PROTECTED] added the comment:

Hi Jesse,

The use-case I had is mind is enabling asyncronous (i.e. select() style)
notification of data being available on the queue, which is more elegant
(and efficient) than polling with get().  Example code showing how this
works with GTK is available here:

http://haltcondition.net/?p=2319

I understand wanting to keep the API simple, however the underlying
posix-level file-descriptors for pipes and connections are already
exposed via fileno(); the actual API change would just be a matter of
changing '_reader' and '_writer' to 'reader' and 'writer' (implicitly
guaranteeing their consistency).

Would it help if I attached a patch showing the proposed change to the
module?  I realise the API is frozen now but it would be nice to have
this further down the line.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3831
___
___
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

2008-09-11 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

 Benchmarks to prove or disprove performance changes?

Agreed, benchmarks should be run.

 Subclasses to 
 offer different order by semantics (see the version I uploaded for an
 example)?

If you like, but ordering semantics is something which is just as
easily done in Python, so I don't understand the point of integrating it
in the dbm layer...

 Consistent behavior wrt dictionaries?

It sounds like an example of foolish consistency to me. The performance
characteristics are certainly too different to consider dbm.anything a
transparent replacement for standard dicts. And dbm.sqlite only accepts
strings, not the wide range of datatypes that dicts accept as keys and
values... so, given the big picture, I don't see why you care about such
a mostly pointless detail.

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



[issue1441530] socket read() can cause MemoryError in Windows

2008-09-11 Thread Anthony Lenton

Anthony Lenton [EMAIL PROTECTED] added the comment:

It's probably just a typo from copying from an editor, but there is a
bug in the workaround.  It should be:

maxRead = 100
class MySSL (imaplib.IMAP4_SSL):
  def read (self, n):
#print ..Attempting to read %d bytes % n
  if n = maxRead:
return imaplib.IMAP4_SSL.read (self, n)
  else:
soFar = 0
result = 
while soFar  n:
  thisFragmentSize = min(maxRead, n-soFar)
  #print ..Reading fragment size %s % thisFragmentSize
  fragment =\
imaplib.IMAP4_SSL.read (self, thisFragmentSize)
  result += fragment
  soFar += thisFragmentSize # only a few, so not a tragic o/head
return result

(With one less level of indentation in the last line).
Apart from that, the fix works wonderfully.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1441530
___
___
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

2008-09-11 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

 Well, sure, but heaven only knows what an application programmer will
 do...

Antoine If the docs clearly explain that there is no guarantee, we
Antoine don't need heaven.  I would find it strange to potentially ruin
Antoine performance just for a guarantee which has no useful purpose.

From http://docs.python.org/lib/typesmapping.html:

If items(), keys(), values(), iteritems(), iterkeys(), and itervalues()
are called with no intervening modifications to the dictionary, the
lists will directly correspond. This allows the creation of (value, key)
pairs using zip(): pairs = zip(a.values(), a.keys()). The same
relationship holds for the iterkeys() and itervalues() methods: pairs =
zip(a.itervalues(), a.iterkeys()) provides the same value for
pairs. Another way to create the same list is pairs = [(v, k) for (k,
v) in a.iteritems()].

While the emphasis is on dictionaries, it seems to me that page describes
the notation and properties of mappings in general, not specifically
dictionaries.

I think it might be worthwhile to get a verdict from Guido on this one.

Skip

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



[issue3844] Script: find untested C functions

2008-09-11 Thread Daniel Diniz

New submission from Daniel Diniz [EMAIL PROTECTED]:

The attached script reports C functions not flexed by unittests. It
needs a 'coverage' build and a run of the tests. Coverage data is then
passed to gcov and those functions with zero calls written to a text
file, grouped by source file.

It's also pretty ugly.

Reviews/suggestions are most welcome :)

I'm finishing a related script that patches the source with 'printf's,
so any false positives are easy to spot and it's clear when some action
or test exercises a previously untested C function. It already works,
but is much uglier then this one ;)

--
components: Tests
files: ccoverage.py
messages: 73073
nosy: ajaksu2
severity: normal
status: open
title: Script: find untested C functions
type: feature request
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file11469/ccoverage.py

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3844
___
___
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

2008-09-11 Thread Josiah Carlson

Josiah Carlson [EMAIL PROTECTED] added the comment:

 If you like, but ordering semantics is something which is just as
 easily done in Python, so I don't understand the point of integrating
 it in the dbm layer...

Actually, the db layer is *exactly* where it should be implemented, 
especially when an index can already exist (as is the case with the 
implementation I provided), especially when the total size of keys can 
easily overflow memory.  Implementing ordering semantics in Python would 
be a waste of what the db is good at: storing and ordering data.

 It sounds like an example of foolish consistency to me. The 
 performance characteristics are certainly too different to consider 
 dbm.anything a transparent replacement for standard dicts. And 
 dbm.sqlite only accepts strings, not the wide range of datatypes that 
 dicts accept as keys and values... so, given the big picture, I don't 
 see why you care about such a mostly pointless detail.

No one here has ever claimed that dbm should be a replacement for dicts, 
even if shelve attempts to do so.  This module should provide a shelve 
interface that mirrors bsddb's interface.  One of the things that was 
offered earlier was that since sqlite can store ints, floats, etc., as 
keys, maybe we should offer that ability.  I think that the base should 
act like a regular dbm object.  I think that a key-ordering should be 
available.  And if we are to offer arbitrary keys (ints, floats, unicode 
strings, byte strings, or None), it should be unordered like the base 
version.

I've uploaded a new copy of sq_dict that offers unordered shelve and 
arbitrary keys in a shelve db.

Added file: http://bugs.python.org/file11470/sq_dict.py

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3783
___
___
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

2008-09-11 Thread Josiah Carlson

Changes by Josiah Carlson [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file11467/sq_dict.py

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



[issue3844] Script: find untested C functions

2008-09-11 Thread Daniel Diniz

Daniel Diniz [EMAIL PROTECTED] added the comment:

Here's example output of a run against 3.0. The number after a function
name is its length in lines (as gcov counts them :).

False positives include:
./Objects/weakrefobject.c gc_clear
./Modules/readline.c on_completion_display_matches_hook

Added file: http://bugs.python.org/file11471/uncovered.txt

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



[issue3766] socket.socket.recv broken (unbearably slow)

2008-09-11 Thread Gabriel Genellina

Gabriel Genellina [EMAIL PROTECTED] added the comment:

I've tested it on Windows XP. MSG_WAITALL is not supported, but I 
replaced it using a while loop. I didn't notice any extraneous delay.

500 packets @ 2 tokens each (500 very short lists)
0.140999794006
 16008 function calls in 0.146 CPU seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
 15000.0360.0000.0360.000 {method 'recv' of 
'_socket.socket'
 objects}
 15000.0330.0000.0330.000 string:1(sendall)
 15000.0160.0000.0650.000 Client.py:15(read_int)
 15000.0150.0000.0530.000 Client.py:7(send_int)
  5000.0090.0000.0770.000 
Client.py:22(read_int_list)
  5000.0070.0000.0600.000 
Client.py:10(send_int_list)
 15000.0070.0000.0100.000 struct.py:77(unpack)
 15000.0050.0000.0050.000 struct.py:54(pack)
  5000.0040.0000.1410.000 Client.py:31(spam)
 20010.0040.0000.0040.000 {len}
10.0030.0030.1460.146 runme.py:11(bench)
 15000.0030.0000.0030.000 {method 'unpack' of 
'Struct' objec
ts}
 10010.0030.0000.0030.000 {range}
 10000.0020.0000.0020.000 {method 'append' of 
'list' objects
}
10.0000.0000.0000.000 struct.py:35(_compile)
20.0000.0000.0000.000 {time.time}
10.0000.0000.1460.146 string:1(module)
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Prof
iler' objects}


None



1 packet @ 5 tokens (1 very long list)
4.8913242
 450019 function calls in 4.893 CPU seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
500011.2120.0001.2120.000 string:1(sendall)
500011.0620.0001.0620.000 {method 'recv' of 
'_socket.socket'
 objects}
500010.5940.0002.2820.000 Client.py:15(read_int)
500010.5170.0001.9820.000 Client.py:7(send_int)
10.3540.3542.7322.732 
Client.py:22(read_int_list)
500010.3350.0000.5240.000 struct.py:77(unpack)
500010.2530.0000.2530.000 struct.py:54(pack)
500010.1890.0000.1890.000 {method 'unpack' of 
'Struct' objec
ts}
10.1760.1762.1582.158 
Client.py:10(send_int_list)
500020.1020.0000.1020.000 {len}
50.0970.0000.0970.000 {method 'append' of 
'list' objects
}
20.0020.0010.0020.001 {range}
10.0020.0024.8934.893 runme.py:19(bench2)
10.0000.0004.8904.890 Client.py:31(spam)
20.0000.0000.0000.000 {time.time}
10.0000.0004.8934.893 string:1(module)
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Prof
iler' objects}

--
nosy: +gagenellina

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3766
___
___
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

2008-09-11 Thread Josiah Carlson

Changes by Josiah Carlson [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file11470/sq_dict.py

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3783
___
___
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

2008-09-11 Thread Josiah Carlson

Josiah Carlson [EMAIL PROTECTED] added the comment:

Here's a version with views from Python 3.0 for keys, values, and items 
:) .  I know that no one hear likes my particular implementation (though 
it offers more or less the full interface), but the Keys, Values, and 
Items classes in the following version are quite generic (they only 
require that the base class implement __iter__, _itervalues, and 
_iteritems), and reasonably optimized.  They could probably be moved 
into the generic dbm stuff and used by everyone.

Added file: http://bugs.python.org/file11472/sq_dict.py

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