[issue8797] urllib2 basicauth broken in 2.6.5: RuntimeError: maximum recursion depth exceeded in cmp

2010-05-24 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Is the behavior you posted observable on trunk?

--
assignee:  -> orsenthil
nosy: +orsenthil

___
Python tracker 

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



[issue8797] urllib2 basicauth broken in 2.6.5: RuntimeError: maximum recursion depth exceeded in cmp

2010-05-24 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Okay, I see you have mentioned 2.6.5 in the Title.
I will try the following to reproduce this.
1) Try a Basis Auth which is working.
2) Pass an Invalid username/password and see the behavior.

--

___
Python tracker 

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



[issue8798] tkinter build variants on OSX

2010-05-24 Thread Ronald Oussoren

New submission from Ronald Oussoren :

It would be nice if the binary installer supported both Tk 8.4 and Tk 8.5: the 
former is present on all current versions of OSX as part of the system, the 
latter is the only one that is supported in 64-bit code on OSX  10.6.

A number of Tkinter users have also mentioned that they would much prefer to 
target Tk 8.5 due to a large number of bugfixes in that version (on OSX).

What I'm thinking of is:

have _tkinter.py that does:

try:
   from _tkinter85 import *
except ImportError:
   from _tkinter84 import *

Then patch setup.py to build _tkinter84.so and _tkinter85.so from _tkinter.c 
while linking to the right version of Tk. This should only be done when a 
special configure argument is present, if it isn't setup.py should default to 
building _tkinter.so like it currently does. 

I don't have time to work on a patch myself.

Workaround for this request: build your own copy of _tkinter when you want to 
use Tk 8.5 (or later) and use sys.path manipulation to ensure that that copy is 
used.

--
assignee: ronaldoussoren
components: Macintosh
messages: 106347
nosy: ronaldoussoren
priority: low
severity: normal
stage: needs patch
status: open
title: tkinter build variants on OSX
type: feature request
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue8798] tkinter build variants on OSX

2010-05-24 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
assignee: ronaldoussoren -> 

___
Python tracker 

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



[issue8795] Error sending utf8 strings over syslog udp protocol

2010-05-24 Thread Vinay Sajip

Vinay Sajip  added the comment:

The message is a misleading one which seems to happen because a Unicode object 
is passed to the socket.

This was fixed in trunk in r75586 (21 October 2009). I've now backported it to 
release26-maint (r81494).

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

___
Python tracker 

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



[issue8799] Hang in lib/test/test_threading.py

2010-05-24 Thread Kristján Valur Jónsson

New submission from Kristján Valur Jónsson :

The tests for the ConditionVariable a fragile.  On a slow computer, or when 
running a DEBUG build, the main thread can issue a condition.notify() call, 
even though the worker threads have not settled in on a wait() call.  This 
causes the test to stall.
The provided patch "fixes" this by adding a short _wait() before the notify.

--
components: Library (Lib)
files: locktest.patch
keywords: easy, patch, patch
messages: 106349
nosy: krisvale
priority: normal
severity: normal
status: open
title: Hang in lib/test/test_threading.py
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file17447/locktest.patch

___
Python tracker 

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



[issue8800] add threading.RWLock

2010-05-24 Thread Kristján Valur Jónsson

New submission from Kristján Valur Jónsson :

Provided is a patch, implementing a RWLock using a ConditionVariable and Lock.
It has rdlock() and wrlock() methods, and an unlock() method, similar to the 
rwlock API in pthreads.
It has context managers rdlocked() and wrlocked().
In addition, it conforms to the RLock interface, with acquire() and release() 
being aliases to wrlock() and unlock() respectively and when used as a context 
manager, it gets a wrlock()
There is no documentation yet, since this is just a proposal, but there are 
unit tests.

See also issue 8777 for another locking primitive, the Barrier.

--
components: Library (Lib)
files: rwlock.patch
keywords: needs review, patch, patch
messages: 106350
nosy: krisvale
priority: normal
severity: normal
status: open
title: add threading.RWLock
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file17448/rwlock.patch

___
Python tracker 

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



[issue8801] Inconsistency in behaviour of urllib and urllib2 with file:// URLs

2010-05-24 Thread Vinay Sajip

New submission from Vinay Sajip :

I encountered what seems like an incompatibility between urllib and urllib2 in 
the way they handle file:// URLs. Here's a console session to illustrate:

vinay  eta-karmic:/tmp$ echo Hello, world! >hello.txt
vinay  eta-karmic:/tmp$ cat hello.txt 
Hello, world!
vinay  eta-karmic:/tmp$ python
Python 2.6.4 (r264:75706, Dec  7 2009, 18:45:15) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib,urllib2
>>> s = 'file:tmp/hello.txt'
>>> f1 = urllib.urlopen(s)
>>> f1.read()
'Hello, world!\n'
>>> f2 = urllib2.urlopen(s)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/urllib2.py", line 124, in urlopen
return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 389, in open
response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 407, in _open
'_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain
result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 1240, in file_open
return self.parent.open(req)
  File "/usr/lib/python2.6/urllib2.py", line 389, in open
response = self._open(req, data)
  File "/usr/lib/python2.6/urllib2.py", line 407, in _open
'_open', req)
  File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain
result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 1287, in ftp_open
raise URLError('ftp error: no host given')
urllib2.URLError: 
>>> 

The problem appears to be that urllib allows a badly-formed file URL (with 
file: rather than file:///) when it shouldn't (errors should not pass 
silently).

--
messages: 106351
nosy: vinay.sajip
priority: low
severity: normal
status: open
title: Inconsistency in behaviour of urllib and urllib2 with file:// URLs
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue8801] Inconsistency in behaviour of urllib and urllib2 with file:// URLs

2010-05-24 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil
nosy: +orsenthil
resolution:  -> accepted

___
Python tracker 

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



[issue8795] Error sending utf8 strings over syslog udp protocol

2010-05-24 Thread Arie Skliarouk

Arie Skliarouk  added the comment:

How come the fix from October 21 have not got into Python 2.6.5 that is 
packaged into ubuntu 10.04?

I overwrote the handlers.py from existing python 2.6.5 installation with the 
patched version and verified that utf8-encoded logs pass properly now.

Thank you!

--

___
Python tracker 

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



[issue8802] about oa module

2010-05-24 Thread sivaramakrishna uddanti

New submission from sivaramakrishna uddanti :

i want to know about the oa module in python .. i searched in google but it was 
to no avail .. please provide me with the details of the mentioned module ..

--
components: Extension Modules
messages: 106353
nosy: sudanti
priority: normal
severity: normal
status: open
title: about oa module
versions: Python 2.6

___
Python tracker 

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



[issue8800] add threading.RWLock

2010-05-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +jyasskin
stage:  -> patch review
versions: +Python 3.2 -Python 2.7

___
Python tracker 

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



[issue8803] about oa module

2010-05-24 Thread sivaramakrishna uddanti

New submission from sivaramakrishna uddanti :

i want to know about the oa module in python.. i searched in the google but it 
was to no avail . please provide me with the details of mentioned module..

--
components: Extension Modules
messages: 106354
nosy: sudanti
priority: normal
severity: normal
status: open
title: about oa module
versions: Python 2.6

___
Python tracker 

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



[issue8799] Hang in lib/test/test_threading.py

2010-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Strange, I have never noticed this (even on the buildbots).

--
nosy: +jyasskin, pitrou
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



[issue8802] about oa module

2010-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

This tracker is for reporting and fixing bugs in Python;  it isn't the right 
place for your question.  You could try asking on the comp.lang.python 
newsgroup (also available as a mailing list:  
http://mail.python.org/pipermail/python-list/ ).

[AFAIK, no such Python module exists; at least, not as part of the standard 
distribution.]

--
nosy: +mark.dickinson
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue8803] about oa module

2010-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Duplicate of issue 8802.

--
nosy: +mark.dickinson
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue8802] about oa module

2010-05-24 Thread sivaramakrishna uddanti

sivaramakrishna uddanti  added the comment:

if it is (oa module) not existing , how are functions like oa.oaString()
,oa.oaWaferInit() working in the script i have .

On Mon, May 24, 2010 at 5:17 PM, Mark Dickinson wrote:

>
> Mark Dickinson  added the comment:
>
> This tracker is for reporting and fixing bugs in Python;  it isn't the
> right place for your question.  You could try asking on the comp.lang.python
> newsgroup (also available as a mailing list:
> http://mail.python.org/pipermail/python-list/ ).
>
> [AFAIK, no such Python module exists; at least, not as part of the standard
> distribution.]
>
> --
> nosy: +mark.dickinson
> resolution:  -> invalid
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: http://bugs.python.org/file17449/unnamed

___
Python tracker 

___if it is (oa module) not existing , how are functions like oa.oaString() 
,oa.oaWaferInit() working in the script i have .
On Mon, May 24, 2010 at 5:17 PM, Mark Dickinson rep...@bugs.python.org> 
wrote:
Mark Dickinson dicki...@gmail.com> added the 
comment:
This tracker is for reporting and fixing bugs in Python;  it isn't the 
right place for your question.  You could try asking on the comp.lang.python 
newsgroup (also available as a mailing list:  http://mail.python.org/pipermail/python-list/"; 
target="_blank">http://mail.python.org/pipermail/python-list/ ).
[AFAIK, no such Python module exists; at least, not as part of the standard 
distribution.]--nosy: +mark.dickinsonresolution: 
 -> invalidstatus: open -> closed


___Python tracker 
rep...@bugs.python.org>http://bugs.python.org/issue8802>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8802] about oa module

2010-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

To repeat:  this is the wrong forum for these questions;  please take them 
elsewhere.

--

___
Python tracker 

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



[issue8799] Hang in lib/test/test_threading.py

2010-05-24 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Well, I saw this occasionally on my dual core laptop when working on the 
RWLock.  A notify() before a target does a wait() is ineffective and it would 
wait indefinitely after the notify(5) call.  This isn't a "proper" fix (I had 
another, more complex, where we would keep a counter for the number of 
successful "waiters" and wait for that to reach the target value) but it is in 
the spirit of many of these tests, where we rely on _wait() to be sufficient to 
reach a certain state.

--

___
Python tracker 

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



[issue8795] Error sending utf8 strings over syslog udp protocol

2010-05-24 Thread Vinay Sajip

Vinay Sajip  added the comment:

- Original Message 

> From: Arie Skliarouk 
> How come the fix from October 21 have not got into Python 2.6.5 
> that is packaged into ubuntu 10.04?

Not all bug-fixes are automatically backported from trunk to release26-maint 
branch, which is where 2.6.x releases come from. If someone reports a problem, 
then I would certainly look to see if a backport is feasible, and this time it 
was :-)

--

___
Python tracker 

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



[issue8804] http.client should support SSL contexts

2010-05-24 Thread Antoine Pitrou

New submission from Antoine Pitrou :

3.2 introduces SSL contexts, which allow bundling SSL configuration options, 
certificates and private keys into a single (potentially long-lived) structure.
http://docs.python.org/dev/py3k/library/http.client.html

http.client.HTTPSConnection should allow passing an SSL context object instead 
of a cert/key pair.

--
components: Library (Lib)
messages: 106362
nosy: giampaolo.rodola, orsenthil, pitrou
priority: normal
severity: normal
status: open
title: http.client should support SSL contexts
type: feature request
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



[issue8805] urllib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

New submission from Antoine Pitrou :

3.2 introduces SSL contexts, which allow bundling SSL configuration options, 
certificates and private keys into a single (potentially long-lived) structure.
http://docs.python.org/dev/py3k/library/http.client.html

urllib.request.*URLOpener should allow passing an SSL context object, if not 
already possible.

(I hope you don't mind the multiple similar issues, but I think one separate 
issue per stdlib module is more manageable)

--
components: Library (Lib)
messages: 106363
nosy: pitrou
priority: normal
severity: normal
status: open
title: urllib should support SSL contexts
type: feature request
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



[issue8804] http.client should support SSL contexts

2010-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ah, sorry for the bad URL:
http://docs.python.org/dev/py3k/library/ssl.html#ssl.SSLContext

--

___
Python tracker 

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



[issue8805] urllib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Actual URL for SSL contexts (sorry):
http://docs.python.org/dev/py3k/library/ssl.html#ssl.SSLContext

--

___
Python tracker 

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



[issue8805] urllib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +giampaolo.rodola, orsenthil

___
Python tracker 

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



[issue8806] ftplib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

New submission from Antoine Pitrou :

3.2 introduces SSL contexts, which allow bundling SSL configuration options, 
certificates and private keys into a single (potentially long-lived) structure.
http://docs.python.org/dev/py3k/library/ssl.html#ssl.SSLContext

The FTP_TLS constructor should allow passing an SSL context object instead of a 
key/cert pair.

--
messages: 106366
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: ftplib should support SSL contexts
type: feature request
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



[issue8807] poplib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

New submission from Antoine Pitrou :

3.2 introduces SSL contexts, which allow bundling SSL configuration options, 
certificates and private keys into a single (potentially long-lived) structure.
http://docs.python.org/dev/py3k/library/ssl.html#ssl.SSLContext

The POP3_SSL constructor should allow passing an SSL context object instead of 
a key/cert pair.

--
components: Library (Lib)
messages: 106367
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: poplib should support SSL contexts
type: feature request
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



[issue8808] imaplib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

New submission from Antoine Pitrou :

3.2 introduces SSL contexts, which allow bundling SSL configuration options, 
certificates and private keys into a single (potentially long-lived) structure.
http://docs.python.org/dev/py3k/library/ssl.html#ssl.SSLContext

The IMAP4_SSL constructor should allow passing an SSL context object instead of 
a key/cert pair.

--
components: Library (Lib)
messages: 106368
nosy: pitrou
priority: normal
severity: normal
status: open
title: imaplib should support SSL contexts
type: feature request
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



[issue8808] imaplib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue8809] smptlib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

New submission from Antoine Pitrou :

3.2 introduces SSL contexts, which allow bundling SSL configuration options, 
certificates and private keys into a single (potentially long-lived) structure.
http://docs.python.org/dev/py3k/library/ssl.html#ssl.SSLContext

The SMTP_SSL constructor should allow passing an SSL context object instead of 
a key/cert pair.

--
components: Library (Lib)
messages: 106369
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: smptlib should support SSL contexts
type: feature request
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



[issue5639] Support TLS SNI extension in ssl module

2010-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Python's main job is to make it *possible* to do things.  It's the
> application developer's job to decide what things should be done.

> It would be entirely appropriate, though, for a higher-level interface 
> (for example, the httplib module) to take care of this itself and not 
> require users to explicitly specify things separately.

Ok, I find this argument rather convincing. Also, enabling implicit SNI with 
the connect() argument could make user code stop working if he decides to pass 
the IP instead, without him being able to diagnose precisly what happens.

As you said, httplib/urllib should probably enable client-side SNI by default.

--

___
Python tracker 

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



[issue8810] TZ offset description is unclear in docs

2010-05-24 Thread Alexander Belopolsky

New submission from Alexander Belopolsky :

>From 
>:

"""
tzinfo.utcoffset(self, dt)

Return offset of local time from UTC, in minutes east of UTC. 
"""

This suggests that the return value is an integer representing the number of 
minutes.  It is later explained that in fact "the value returned must be a 
timedelta object specifying a whole number of minutes", but many users won't 
read past the first sentence.

I suggest s/in minutes east of UTC/as a timedelta object/.  I think "east of 
UTC" is redundant given the next sentence, "If local time is west of UTC, this 
should be negative", but that can also be reworded for clarity as "The offset 
for timezones west of UTC is negative, and for those east of UTC is positive."

--
assignee: d...@python
components: Documentation
keywords: easy
messages: 106371
nosy: belopolsky, d...@python
priority: normal
severity: normal
status: open
title: TZ offset description is unclear in docs
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue8800] add threading.RWLock

2010-05-24 Thread Jeffrey Yasskin

Jeffrey Yasskin  added the comment:

This patch doesn't apply cleanly against the py3k tree. Since Python 2.7 is in 
beta, and there's no 2.8, this can only go into python 3, so you should work 
against that tree.

It's a bit annoying that the R in RWLock stands for a different word from in 
RLock. But I can't think of a better name.

Hm, the test for RWLock should use a Barrier to check for multiple readers.

I wonder if it makes sense to add a DeadlockError as a subclass of RuntimeError 
and throw that from trying to upgrade a read-lock to a write-lock.

The docs should describe why upgrading a read-lock to a write-lock is banned, 
or else people will try to add the feature.


test_wrrecursion should also check pure writer recursion. Oh, no, that's tested 
by RLockTests. Comment that please. The name of the test should probably 
mention write_then_read_recursion to distinguish it from write-then-write or 
read-then-write.

test_readers_writers doesn't quite test enough. (Feel free to add another test 
rather than changing this one.) You want to test that readers can't starve 
writers. For example, say we have:
  lock = RWLock()
  done = False
  def r():
with lock.rdlocked():
  if done:
return
  _wait()
  def w():
nonlocal done
with lock.wrlocked():
  done = True
  readers = Bunch(r, 50)
  _wait()
  writers = Bunch(w, 1)
  readers.wait_for_finished()
  writers.wait_for_finished()

In a naive implementation, there may never be a point where no reader has the 
lock held, and so the writer may never get in to tell them all to exit. I 
believe your implementation will already pass this test.

spelling: mathced

I'm not sure that "#threads will be few" is true for a read-lock, but I don't 
mind for the first implementation.

Generally put a space after # when it introduces a comment, start comments with 
a capital letter, and end them with punctuation so we know you didn't stop 
typing early.

In _rdlock could you flip the "not self.nw" condition? That way the else won't 
be a double-negative.

Can self.rcond.wait() ever throw an exception? I suspect you should use 
try:finally: to guard the "self.nr -= 1"

Why must the user hold a write lock to use Condition.wait? Semantically, a 
waiting on a read-lock would release the current thread's recursive read-locks, 
and all should be well.

It looks like self.owning holds one copy of each thread's id for each re-entry 
by that thread. That wasn't obvious so deserves a comment.

General API questions: 
 1. Given that the other locking APIs use "acquire" and "release" instead of 
"lock" and "unlock", perhaps this class should use "rdacquire" and "wracquire"?
 2. I wonder if it helps actual code to be able to just call "unlock" instead 
of "rdunlock" and "wrunlock". Code releasing the lock should always know which 
kind of lock it holds.

Otherwise, this looks basically correct. Thanks!

--

___
Python tracker 

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



[issue8800] add threading.RWLock

2010-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'm not sure it's a good idea to have a default context manager, and default 
acquire/release methods. "In the face of ambiguity, refuse the temptation to 
guess".

Is there any use in being able to use a RWLock inside a condition variable?

Docstrings should be polished (e.g. typo "must be mathced with an release"). I 
think wrlocked() and rdlocked() deserve a docstring too.

A style nit: generally, comments should be on their own line, before the code 
they comment. Also, there should be a space just after the "#" (see PEP 8 :-)).

--
nosy: +pitrou

___
Python tracker 

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



[issue8777] Add threading.Barrier

2010-05-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +jyasskin

___
Python tracker 

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



[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2010-05-24 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

As far as I can tell, the TZ offset code can be simplified by eliminating 
conversion from timedelta to int and back in utcoffset() and dst() methods of 
time and datetime objects.

The only reason for the restriction that I can think of is that some text 
representation of datetime only provide 4 digits for timezone. The behavior of 
formatting functions, can be preserved while allowing fractional minute offsets 
elsewhere.

On the other hand, given that this issue did not see a single response in more 
than a year, it seems that there is little interest in fixing it.

--

___
Python tracker 

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



[issue8777] Add threading.Barrier

2010-05-24 Thread Jeffrey Yasskin

Jeffrey Yasskin  added the comment:

You should probably mention that pthread_barrier and 
java.util.concurrent.CyclicBarrier are prior art for this. I'm thinking about 
them when looking at the API to see whether your differences make sense.

"enter" seems to be the wrong term for this, since there's no matching "exit" 
call. "wait" or "block" seem better.

Both pthread_barrier and CyclicBarrier provide a way to identify a unique 
thread from each group. pthread_barrier_wait returns true in exactly one 
thread, while CyclicBarrier runs a callback while all other threads are still 
paused. I'd be inclined to use CyclicBarrier's interface here, although then 
you have to define what happens when the action raises an exception.

_release should notify_all after its loop.

adjust_count makes me nervous. Is there a context manager interface that would 
make this cleaner/safer?

--

___
Python tracker 

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



[issue8800] add threading.RWLock

2010-05-24 Thread Jeffrey Yasskin

Jeffrey Yasskin  added the comment:

In this case, "acquire" isn't ambiguous. All the other lock types actually 
acquire a write lock, so it makes sense to have the operation with the same 
name they use also acquire a write lock on this object.

I realized that read/write locks are actually shared/exclusive locks, which 
might form the basis for a name that doesn't collide with RLock. Boost 
(http://www.boost.org/doc/libs/1_43_0/doc/html/thread/synchronization.html#thread.synchronization.mutex_types.shared_mutex)
 uses shared_mutex for the concept, so SLock or SELock? There are some 
algorithms that write while the lock is acquired non-exclusive, so "shared" is 
actually a better name for the concept, even though posix and Java used 
read/write.

The possibility of lock downgrading (turning an exclusive lock into a shared 
lock, without allowing any other exclusive acquisitions in the mean time) might 
inform your decision about how to name "unlock".

--

___
Python tracker 

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



[issue8800] add threading.RWLock

2010-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> In this case, "acquire" isn't ambiguous. All the other lock types
> actually acquire a write lock, so it makes sense to have the operation
> with the same name they use also acquire a write lock on this object.

Well, it looks like a strange kind of "consistency" to me, since other
lock types are not dual. Both posix and Java APIs don't seem to imply
that the write lock is the "default" lock in a RW lock. However, I'm not
a synchronization specialist.

> I realized that read/write locks are actually shared/exclusive locks,
> which might form the basis for a name that doesn't collide with RLock.
> Boost
> (http://www.boost.org/doc/libs/1_43_0/doc/html/thread/synchronization.html#thread.synchronization.mutex_types.shared_mutex)
>  uses shared_mutex for the concept, so SLock or SELock?

SELock looks ok, but I have to say that RWLock is more obvious (I don't
need to do a search to guess that RW means "read/write").

--

___
Python tracker 

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



[issue8809] smptlib should support SSL contexts

2010-05-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +janssen

___
Python tracker 

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



[issue8808] imaplib should support SSL contexts

2010-05-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +janssen

___
Python tracker 

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



[issue8807] poplib should support SSL contexts

2010-05-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +janssen

___
Python tracker 

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



[issue8806] ftplib should support SSL contexts

2010-05-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +janssen

___
Python tracker 

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



[issue8805] urllib should support SSL contexts

2010-05-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +janssen

___
Python tracker 

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



[issue8804] http.client should support SSL contexts

2010-05-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +janssen

___
Python tracker 

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



[issue8142] libffi update to 3.0.9

2010-05-24 Thread Andrej Krpic

Changes by Andrej Krpic :


--
nosy: +akrpic77
status: pending -> open

___
Python tracker 

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



[issue1289118] timedelta multiply and divide by floating point

2010-05-24 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I am attaching a patch that implements Mark's timedelta_arith.py algorithms in 
C.

With rounding well defined, I am close to withdrawing my opposition to 
supporting mixed timedelta with float operations.  There is still one issue 
that I believe is worth discussing before this feature is accepted.  Time, 
unlike most other physical quantities has a non-arbitrary notion of direction.  
Therefore, in many applications, rounding towards past or towards future may be 
preferable to rounding to nearest.

For example, one of the likely applications of floating point division would be 
to construct time series from continuous or differently sampled functions.  If 
such series are used to measure correlations between cause and effect, it is 
important that effect is measured at a time following the cause and not at an 
early or the same moment.

As Mark noted in private correspondence, this issue is mitigated by the fact 
that "with correct rounding, for timedeltas t and s, and a positive float x, it 
is guaranteed that t <= s implies t op x <= s op x" (where op is either * or 
/).  It is still possible however, that even the case of t < s and t op x == s 
op x present a problem in some applications.

Despite this issue, I would support round to nearest even choice over round to 
past or to future mainly because it is less likely to lead to surprises where 
(d1/d2) * d2 != d1.  This choice also conforms with the round() builtin 
definition and is somewhat more difficult to implement right using existing 
means.

Daniel, would you like to chime in on the questions of how the results of these 
operations should be rounded?

If I don't hear principle objections from the "nosy" list, I'll add a 
documentation patch.

--
Added file: http://bugs.python.org/file17450/issue1289118-nodoc.diff

___
Python tracker 

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



[issue8806] ftplib should support SSL contexts

2010-05-24 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I'm assigning this one to me.
Btw, before writing anything I think it would be better to decide what to do 
first, possibly by adopting the same approach everywhere (smtplib, imaplib, 
poplib, urllib and http.client).

My proposal: 

- the user should still be able to use keyfile and certfile if desired, they're 
quicker to use and backward compatibility must be maintained.

- SSL context can be provided by passing a new "context" argument to the 
constructor.

- if context arg is passed FTP_TLS.ssl_version should be ignored and 
SSLContext.protocol used instead

- keyfile/certfile and context arguments should be mutually exclusive 
(ValueError)


Makes sense?

--
assignee:  -> giampaolo.rodola

___
Python tracker 

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



[issue8806] ftplib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> My proposal: 
> 
> - the user should still be able to use keyfile and certfile if desired, 
> they're quicker to use and backward compatibility must be maintained.
> 
> - SSL context can be provided by passing a new "context" argument to the 
> constructor.
> 
> - if context arg is passed FTP_TLS.ssl_version should be ignored and 
> SSLContext.protocol used instead
> 
> - keyfile/certfile and context arguments should be mutually exclusive 
> (ValueError)
> 
> 
> Makes sense?

Entirely sense to me :)

--

___
Python tracker 

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



[issue1289118] timedelta multiply and divide by floating point

2010-05-24 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

I don't have a strong feeling about the method of rounding.  My thinking is: If 
my application is sensitive to how the last microsecond is rounded, then I 
shouldn't be using a type that only gives me 1-microsecond precision.

(Likewise, if my application is sensitive to how the last binary digital of the 
floating point mantissa is rounded ... I'm in trouble)

That said, round-to-nearest strikes me as the least-surprising approach.

--

___
Python tracker 

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



[issue8811] fixing sqlite3 docs for py3k

2010-05-24 Thread Shashwat Anand

New submission from Shashwat Anand :

The docs of sqlite3 for python 3.0 and 3.1 seems to be written for python 2.6 
and hence wrong at many places.
like, 
>>> for member in r: print member 

However the docs for sqlite3 in py3k trunk seems fine. The sqlite3 doc in py3k 
trunk should be used in these places.

http://docs.python.org/release/3.0.1/library/sqlite3.html
http://docs.python.org/release/3.1/library/sqlite3.html

--
assignee: d...@python
components: Documentation
files: sqlite.rst.patch
keywords: patch
messages: 106382
nosy: d...@python, georg.brandl, ghaering, l0nwlf
priority: normal
severity: normal
status: open
title: fixing sqlite3 docs for py3k
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file17451/sqlite.rst.patch

___
Python tracker 

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



[issue1289118] timedelta multiply and divide by floating point

2010-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Re rounding:  I'll just note that timedelta / timedelta -> float currently does 
round to nearest;  I'd find it quite surprising if float * timedelta -> 
timedelta didn't round to nearest.

--

___
Python tracker 

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



[issue1168427] Possible windows+python bug

2010-05-24 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> invalid

___
Python tracker 

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



[issue8806] ftplib should support SSL contexts

2010-05-24 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Patch in attachment.

--
keywords: +patch
Added file: http://bugs.python.org/file17452/ftplib.patch

___
Python tracker 

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



[issue8016] Support for cp858

2010-05-24 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

A new codec is quite self-contained, so that's ok.

--

___
Python tracker 

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



[issue8800] add threading.RWLock

2010-05-24 Thread Jeffrey Yasskin

Jeffrey Yasskin  added the comment:

You're definitely right that posix and java don't make these usable from the 
normal lock API. And I don't think it's essential that they be usable as 
RLocks, although it's nice for Conditions. I think what I'm actually saying is 
that, if you have an acquire() operation on RWLock, then it has to forward to 
the write lock. Forwarding to the read lock would have different semantics from 
RLock.acquire (2 threads could get in at once) and so would be incorrect.

I agree that RWLock is more obvious. As long as the docs mention that it's 
equivalent to a shared/exclusive lock, I don't care that much about the name. 
Just throwing out ideas.

--

___
Python tracker 

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



[issue1289118] timedelta multiply and divide by floating point

2010-05-24 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

It looks like we have a consensus on the rounding mode.  Note, however
that timedelta constructor rounds away from zero at least on
Intel/MacOS X:

[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Should this be considered a bug?

For comparison,

[-10, -8, -8, -6, -6, -4, -4, -2, -2, 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10]

[-10, -8, -8, -6, -6, -4, -4, -2, -2, 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10]

--

___
Python tracker 

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



[issue1289118] timedelta multiply and divide by floating point

2010-05-24 Thread Mark Dickinson

Mark Dickinson  added the comment:

Alexander, it looks like Roundup ate some of your message there. :)

Yes, ideally I'd say that the constructor should be doing round-half-to-even.  
Though last time I looked, the constructor looked quite complicated (especially 
for float inputs);  it may not be feasible to fix this easily.

At any rate, we should open a separate issue for this.

--

___
Python tracker 

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



[issue1289118] timedelta multiply and divide by floating point

2010-05-24 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Indeed.  Here is what I intended:

"""
>>> from datetime import timedelta as d
>>> [d(microseconds=i + .5)//d.resolution for i in range(-10,10)]
[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Should this be considered a bug?

For comparison,

>>> [d.resolution*(i+0.5)//d.resolution for i in range(-10,10)]
[-10, -8, -8, -6, -6, -4, -4, -2, -2, 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10]

and
>>> [round(i+0.5) for i in range(-10,10)]
[-10, -8, -8, -6, -6, -4, -4, -2, -2, 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10]
"""

I checked the documentation and while it says: "If any argument is a float and 
there are fractional microseconds, the fractional microseconds left over from 
all arguments are combined and their sum is rounded to the nearest 
microsecond." it does not specify how half-integers should be handled.

While it may not be a bug in strict sense, it looks like the code in question 
can be improved.  I'll open a separate issue for this.

--

___
Python tracker 

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



[issue8806] ftplib should support SSL contexts

2010-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Patch in attachment.

You could add checks for:

self.assertIs(self.client.sock.context, ctx)
[...]
self.assertIs(sock.context, ctx)

(I know, the "context" attribute isn't documented, I'm going to fix
this)

--

___
Python tracker 

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



[issue8812] Show package path in repr string for packages installed to user site

2010-05-24 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar :

I see this in Python 2.7. No idea if this is a regression, mere future request, 
but doesn't it make sense to print the value `__path__` in the repr string?

>>> import paste
>>> paste

>>> paste.__path__
['/home/sridharr/.local/lib/python2.7/site-packages/paste']

It does for stdlib packages/modules:

>>> import xml
>>> xml


Happens on Windows, Linux and Mac using Python 2.7 hg hash eaeebf8cda33.0.

--
components: Library (Lib)
messages: 106391
nosy: srid
priority: normal
severity: normal
status: open
title: Show package path in repr string for packages installed to user site
type: feature request
versions: Python 2.7

___
Python tracker 

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



[issue3143] Make the left sidebar in the doc collapsible

2010-05-24 Thread Georg Brandl

Georg Brandl  added the comment:

Committed the sidebar.js to Sphinx trunk.  When Python switches to 1.0, we can 
activate the option to use it.  Thanks Ezio!

--
resolution:  -> remind

___
Python tracker 

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



[issue8813] SSLContext doesn't support loading a CRL

2010-05-24 Thread STINNER Victor

New submission from STINNER Victor :

SSL Context should support loading a CRL. See M2Crypto patches:
https://bugzilla.osafoundation.org/show_bug.cgi?id=12954
https://bugzilla.osafoundation.org/show_bug.cgi?id=11694

Or PyOpenSSL branch supporting CRL:
https://launchpad.net/~rick-fdd/pyopenssl/crl_and_revoked

--
components: Library (Lib)
messages: 106393
nosy: haypo
priority: normal
severity: normal
status: open
title: SSLContext doesn't support loading a CRL
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



[issue8813] SSLContext doesn't support loading a CRL

2010-05-24 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +pitrou

___
Python tracker 

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



[issue8814] functools.WRAPPER_ASSIGNMENTS should include __annotations__

2010-05-24 Thread Terrence Cole

New submission from Terrence Cole :

__annotations__ should be included in the set of attributes copied by default 
to a wrapped method.

An example of the problem:
>>> from functools import wraps
>>> def mydecorator(fn):
... @wraps(fn)
... def inner(*args, **kwargs):
... return fn(*args, **kwargs)
... return inner
...
>>> @mydecorator
... def foo(a:int, b:str):
... pass
... 
>>> foo.__annotations__
{}

With the included fix:
>>> foo.__annotations__
{'a': , 'b': }

--
components: Library (Lib)
files: functools-wrapper-assign-annotations.diff
keywords: patch
messages: 106394
nosy: terrence
priority: normal
severity: normal
status: open
title: functools.WRAPPER_ASSIGNMENTS should include __annotations__
type: behavior
versions: Python 3.1, Python 3.2, Python 3.3
Added file: 
http://bugs.python.org/file17453/functools-wrapper-assign-annotations.diff

___
Python tracker 

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



[issue6662] HTMLParser.HTMLParser doesn't handle malformed charrefs

2010-05-24 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +merwok

___
Python tracker 

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



[issue8813] SSLContext doesn't support loading a CRL

2010-05-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
type:  -> feature request

___
Python tracker 

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



[issue8016] Support for cp858

2010-05-24 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks all, committed in r81499.

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

___
Python tracker 

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



[issue8814] functools.WRAPPER_ASSIGNMENTS should include __annotations__

2010-05-24 Thread Éric Araujo

Éric Araujo  added the comment:

The patch is fine. Can you check if some doc has to be updated to mention that? 
(files under Doc and docstrings in functools.py).

Removing 3.1 since this is a new feature, and 3.3 since 3.2 is not frozen.

--
nosy: +merwok
versions:  -Python 3.1, Python 3.3

___
Python tracker 

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



[issue8616] Changes to content of Demo/turtle

2010-05-24 Thread Georg Brandl

Georg Brandl  added the comment:

Hmm, it seems that round_dance and scribble don't work with the 2.7 turtle 
version?  I played a round of nim, but although I took the last stick, it said 
the computer won...

--

___
Python tracker 

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



[issue8616] Changes to content of Demo/turtle

2010-05-24 Thread Georg Brandl

Georg Brandl  added the comment:

Committed the turtleDemo_27b1_to_turtleDemo.diff in r81502.

--

___
Python tracker 

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



[issue8812] Show package path in repr string for packages installed to user site

2010-05-24 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

You are mistaken. It doesn't include __path__ into repr, but __file__. It 
prints "(built-in)" if the filename is not set for some reason.

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

___
Python tracker 

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



[issue8324] add a distutils test command

2010-05-24 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue8812] Show package path in repr string for packages installed to user site

2010-05-24 Thread Sridhar Ratnakumar

Sridhar Ratnakumar  added the comment:

On 2010-05-24, at 2:44 PM, Martin v. Löwis wrote:

> You are mistaken. It doesn't include __path__ into repr, but __file__. It 
> prints "(built-in)" if the filename is not set for some reason.

Ok. Why is __file__ not set for modules/packages installed to user site 
(~/.local/), but not stdlib? Is this a bug?

Ah, I see that a "__init__.py" is missing in these packages.   Strange; gotta 
see how that happened in first place ..  (even stranger that I can actually 
import these directories...)

--
status: pending -> open

___
Python tracker 

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



[issue6662] HTMLParser.HTMLParser doesn't handle malformed charrefs

2010-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

Commited: 2.7 (r81500, r81501), 2.6 (r81503), 3.2 (r81504), 3.1 (r81505).

--
nosy: +haypo
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue8814] functools.WRAPPER_ASSIGNMENTS should include __annotations__

2010-05-24 Thread Terrence Cole

Terrence Cole  added the comment:

Thank you for looking it over!  The updated patch adds __annotations__ to the 
documentation where the value of WRAPPER_ASSIGNMENTS is given.  I think it 
would be nice if the documentation showed WRAPPER_ASSIGNMENTS and 
WRAPPER_UPDATES in their own section, but that would probably merit a separate 
issue to fix, if it is even worth bothering with.

--
versions: +Python 3.3
Added file: 
http://bugs.python.org/file17454/functools-wrapper-assign-annotations.diff

___
Python tracker 

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



[issue8142] libffi update to 3.0.9

2010-05-24 Thread Florent Xicluna

Changes by Florent Xicluna :


--
status: open -> closed

___
Python tracker 

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



[issue8813] SSLContext doesn't support loading a CRL

2010-05-24 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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-24 Thread Brett Cannon

Brett Cannon  added the comment:

Attaching a new patch by Rafe against Python 2.7. Unfortunately with 2.7 
striving for an RC next, this should only target Python 3.2 and not 2.7.

--
versions: +Python 3.2 -Python 2.7, Python 3.1
Added file: http://bugs.python.org/file17455/next-patch.txt

___
Python tracker 

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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-24 Thread Brett Cannon

Changes by Brett Cannon :


Removed file: http://bugs.python.org/file13023/datetime-utc.patch

___
Python tracker 

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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-24 Thread Brett Cannon

Changes by Brett Cannon :


Removed file: http://bugs.python.org/file13029/datetime-utc-doc.patch

___
Python tracker 

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



[issue8815] 65001

2010-05-24 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: haypo
priority: normal
severity: normal
status: open
title: 65001

___
Python tracker 

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



[issue8815] 65001

2010-05-24 Thread STINNER Victor

New submission from STINNER Victor :

oops, sorry.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue8812] Show package path in repr string for packages installed to user site

2010-05-24 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Can you please provide a reproducible bug report? I have no idea what "paste" 
is or how it got into your .local folder. Please structure the bug report as 
follows:

1. this is what you did
2. this is what happened
3. this is what you expected to happen instead

Installing http://pypi.python.org/pypi/Paste through distribute's setup.py 
install --user, I get

py> paste


--

___
Python tracker 

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



[issue8812] Show package path in repr string for packages installed to user site

2010-05-24 Thread Sridhar Ratnakumar

Sridhar Ratnakumar  added the comment:

On 2010-05-24, at 3:46 PM, Martin v. Löwis wrote:

> Can you please provide a reproducible bug report? I have no idea what "paste" 
> is or how it got into your .local folder. Please structure the bug report as 
> follows:
> 
> 1. this is what you did
> 2. this is what happened
> 3. this is what you expected to happen instead

I was not sure if this is a bug .. which is why I was waiting till the 
completion of my investigation ...

> 
> Installing http://pypi.python.org/pypi/Paste through distribute's setup.py 
> install --user, I get
> 
> py> paste
>  '/home/martin/.local/lib/python/2.7/site-packages/Paste-1.7.3.1-py2.7.egg/paste/__init__.pyc'>

This is what I found: setuptools/Distribute does some namespace magic to make 
these namespace packages work in the absence of __init__.py. You should be able 
to reproduce this with --root option (or --single-version-multi-installed or 
some such thing) in "setup.py install" command to prevent .egg'fying the 
installed packages. So this is not a bug in Python; it is an expected behaviour 
of setuptools-installed packages that do not use .egg/ package structure.

--

___
Python tracker 

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



[issue8812] Show package path in repr string for packages installed to user site

2010-05-24 Thread Sridhar Ratnakumar

Changes by Sridhar Ratnakumar :


--
status: open -> closed

___
Python tracker 

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



[issue8777] Add threading.Barrier

2010-05-24 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



[issue850997] mbcs encoding ignores errors

2010-05-24 Thread STINNER Victor

STINNER Victor  added the comment:

Updated version of the patch for py3k:
 - don't accept "ignore" error handler anymore
 - there is a FIXME near "mbcs_decode_error:"

The whole test suite pass with these patch.

--
Added file: http://bugs.python.org/file17456/mbcs_errors-py3k.patch

___
Python tracker 

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



[issue8811] fixing sqlite3 docs for py3k

2010-05-24 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



[issue8811] fixing sqlite3 docs for py3k

2010-05-24 Thread Georg Brandl

Georg Brandl  added the comment:

Hmm, the patch mostly doesn't apply for me on the 3.1 branch.  (Note that 3.0 
docs aren't maintained anymore, just like 3.0 itself.)

--

___
Python tracker 

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



[issue8562] hasattr(open, 'newlines') example gives incorrect results from PEP0278

2010-05-24 Thread David Antliff

Changes by David Antliff :


--
nosy: +David.Antliff

___
Python tracker 

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



[issue8811] fixing sqlite3 docs for py3k

2010-05-24 Thread Shashwat Anand

Shashwat Anand  added the comment:

ok,
I think a few example codes are wrongly mentioned as if it were 2.x docs, 
however those examples at http://docs.python.org/dev/py3k/library/sqlite3 works 
correctly.
Do by 'mostly', do you mean I should submit another patch with only those wrong 
examples rectified ?

--

___
Python tracker 

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



[issue1368368] prompt_user_passwd() in FancyURLopener masks 401 Unauthorized error page

2010-05-24 Thread Shashwat Anand

Changes by Shashwat Anand :


--
nosy: +l0nwlf

___
Python tracker 

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



[issue8796] Deprecate codecs.open()

2010-05-24 Thread Dan Buch

Changes by Dan Buch :


--
nosy: +meatballhat

___
Python tracker 

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



[issue8816] Add test cases for builtins

2010-05-24 Thread Gregory Nofi

New submission from Gregory Nofi :

I'm attaching 2 patches with additional test cases for these built-in 
functions. They are mostly negative tests.

* abs
* callable: trunk only
* len
* long: trunk only
* range: copied some py3k range tests into trunk
* reduce: trunk only
* vars

I'm currently helping port IronPython tests into CPython. This is part of that 
series.

--
components: Tests
files: builtins.trunk.patch
keywords: patch
messages: 106410
nosy: gnofi
priority: normal
severity: normal
status: open
title: Add test cases for builtins
versions: Python 2.7, Python 3.1
Added file: http://bugs.python.org/file17457/builtins.trunk.patch

___
Python tracker 

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



[issue8816] Add test cases for builtins

2010-05-24 Thread Gregory Nofi

Changes by Gregory Nofi :


Added file: http://bugs.python.org/file17458/builtins.v3.patch

___
Python tracker 

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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-24 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I have two questions about the proposed implementation:

1. Why not follow pytz lead and expose an instance of UTC rather than the UTC 
class itself?

2. Is there a real need to add a boolean argument to utcnow()?  I think 
timedelta.now(UTC()) or with utc = UTC() timedelta.now(utc) seems to be a more 
obvious way to produce TZ aware datetime.

If a singleton instance utc is exposed instead of UTC class, I would suggest to 
change its repr to 'datetime.utc'.

On the patch itself, datetime_utcnow() is missing an error check for 
PyObject_IsTrue() return value:

>>> class X:
...def __nonzero__(self): raise RuntimeError
... 
>>> datetime.utcnow(tz_aware=X())
datetime.datetime(2010, 5, 25, 2, 12, 14, 739720, tzinfo=)
XXX undetected error
..

--

___
Python tracker 

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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-24 Thread Rafe Kaplan

Rafe Kaplan  added the comment:

Alexander, about 1, that's a pretty good question.  I had originally wanted to 
do something like that but Brett Cannon at the time thought it was not the 
right approach.  I don't recall the details.  Maybe Brett can recall.  I think 
we had that conversation in person and it was a long time ago :(

I had originally thought of doing the class, and then having constants 
associated with it:

  UTC.UTC0

Eventually if we support multiple timezones:

  UTC.UTC1
  UTC.UTC2
  UTC.UTC_1
  UTC.UTC_2

Well... maybe not given how impossible the naming would be.

I think we also talked about redefining new so that it would always return the 
same global instance.

On 2, we had discussions about how to pass parameters in to utcnow that we DID 
record.  When I suggested it, Brett said:

  "...using a boolean flag over an argument is much less error-prone for a 
developer from passing in the wrong timezone object; passing in something other 
than an instance of UTC would just be stupid so we should make sure the 
developer isn't stupid. =)"

--

___
Python tracker 

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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-24 Thread Brett Cannon

Brett Cannon  added the comment:

We didn't do a singleton because I don't like singletons. =) Plus they muck 
with isinstance/issubclass if you don't expose the class. Basically there is no 
need to have it be a singleton, so why bother?

And Rafe is right: since utcnow() already exists, why not take advantage of the 
method? Yes, you could manually call now() with a UTC object, but people are 
going to notice the utcnow() method and want to use it, so we should make it 
easy to use the new UTC object on utcnow(). Plus it has the added benefit of 
providing a transition plan to make utcnow() always return a timezone-aware 
datetime object.

--

___
Python tracker 

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



[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-24 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Mon, May 24, 2010 at 11:06 PM, Rafe Kaplan  wrote:
..
> On 2, we had discussions about how to pass parameters in to utcnow that we 
> DID record.  When I
> suggested it, Brett said:
>
>  "...using a boolean flag over an argument is much less error-prone for a 
> developer from passing in the wrong
> timezone object; passing in something other than an instance of UTC would 
> just be stupid so we should make
> sure the developer isn't stupid. =)"

Well, I respectfully disagree.  This advise seems to be placing
convenience of the writer of the code over that of the reader.
Imagine encountering an expression datetime.utcnow(True) allowed by
your current patch and trying to figure out what it means.  This can
be improved by making tz_aware a keyword only argument, but in that
case a separate datetime.tz_aware_utcnow() function seems like a
better choice.

Note that I am not suggesting passing anything to utcnow().  I would
either leave it unchanged or make it always return aware datetime
instances.  (Note that with singleton UTC timezone naive datetime
instances can be deprecated with no performance penalty.)

--

___
Python tracker 

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



  1   2   >