[issue7961] Py3k: decoding empty bytestring with invalid encoding throws no error

2010-02-22 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

I think it's better to close the ticket as "won't fix".

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue7980] time.strptime not thread safe

2010-02-22 Thread Willard

New submission from Willard :

The following script raises several "_strptime_time" AttributeErrors (on OS X 
10.4 at least).

If time.strptime is used before starting the threads, then no exception is 
raised (the issue may thus come from strptime.py not being imported in a thread 
safe manner).


import time
import thread

def f():
for m in xrange(1, 13):
for d in xrange(1,29):
time.strptime("2010%02d%02d"%(m,d),"%Y%m%d")

for _ in xrange(10):
thread.start_new_thread(f, ())
time.sleep(3)


> Traceback (most recent call last):
>   File "[...]/test.py", line 75, in f
> time.strptime("2010%02d%02d"%(m,d),"%Y%m%d")
> AttributeError: _strptime_time

--
components: Library (Lib)
messages: 99718
nosy: cptnwillard
severity: normal
status: open
title: time.strptime not thread safe
type: crash
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



[issue7573] Python build issue on Ubuntu 9.10

2010-02-22 Thread Stefan Krah

Stefan Krah  added the comment:

This is documented, so I'd recommend to close this issue.

http://docs.python.org/3.1/c-api/intro.html#include-files

--
nosy: +skrah

___
Python tracker 

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



[issue7977] I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.

2010-02-22 Thread Jelly Chen

Jelly Chen  added the comment:

I can't modify the issue. so i replay this email.
The old xmlrpc lib don't use  surround a param. please take a look at
wrong.xml and right.xml.

2010/2/22 Mark Dickinson 

>
> Mark Dickinson  added the comment:
>
> Please could you generate and upload a patch against the Python source?
>  (For Windows, you can do this using the WinMerge tool, amongst others.)
>  I'm unable to open the file you attached on my machine:
>
> """No application knows how to open ... xmlrpc.client.modify.rar."""
>
> If you could explain how "" is being used improperly, that might
> also help.
>
> --
> nosy: +mark.dickinson
>
> ___
> Python tracker 
> 
> ___
>

--
keywords: +patch
Added file: http://bugs.python.org/file16292/unnamed
Added file: http://bugs.python.org/file16293/xmlrpc.patch
Added file: http://bugs.python.org/file16294/wrong.xml
Added file: http://bugs.python.org/file16295/right.xml

___
Python tracker 

___I can't modify the issue. so i replay this email.The old xmlrpc lib 
don't use  surround a param. please take a look at 
wrong.xml and right.xml.2010/2/22 Mark 
Dickinson rep...@bugs.python.org>

Mark Dickinson dicki...@gmail.com> added the 
comment:

Please could you generate and upload a patch against the Python source? 
 (For Windows, you can do this using the WinMerge tool, amongst others.) 
 I'm unable to open the file you attached on my machine:

"""No application knows how to open ... 
xmlrpc.client.modify.rar."""

If you could explain how "" is being used improperly, 
that might also help.

--
nosy: +mark.dickinson

___
Python tracker rep...@bugs.python.org>
http://bugs.python.org/issue7977>
___
-- Contact me: 
 QQ: 2578717MSN: mailto:sinoje...@msn.cn";>sinoje...@msn.cn新浪微博:http://t.sina.com.cn/sinojelly";>http://t.sina.com.cn/sinojelly
我的博客:http://sinojelly.20x.cc";>http://sinojelly.20x.cc

diff -Nur xmlrpc\client.py modify\xmlrpc\client.py
--- xmlrpc\client.pyThu Jun 04 17:11:52 2009
+++ modify\xmlrpc\client.py Mon Feb 22 19:13:37 2010
@@ -49,6 +49,7 @@
 # 2003-07-12 gp  Correct marshalling of Faults
 # 2003-10-31 mvl Add multicall support
 # 2004-08-20 mvl Bump minimum supported Python version to 2.1
+# 2010-02-22 cgd Reorganize xmlrpc request message format (Chenguodong 
email:sinoje...@gmail.com)
 #
 # Copyright (c) 1999-2002 by Secret Labs AB.
 # Copyright (c) 1999-2002 by Fredrik Lundh.
@@ -508,9 +509,7 @@
 # is for now.  See @XMLRPC3 for more information. /F
 write("\n")
 for v in values:
-write("\n")
 dump(v, write)
-write("\n")
 write("\n")
 result = "".join(out)
 return result
@@ -588,13 +587,25 @@
 raise TypeError("cannot marshal recursive sequences")
 self.memo[i] = None
 dump = self.__dump
+for v in value:
+write("\n")
+dump(v, write)
+write("\n")
+del self.memo[i]
+dispatch[tuple] = dump_array
+
+def dump_list(self, value, write):
+i = id(value)
+if i in self.memo:
+raise TypeError("cannot marshal recursive sequences")
+self.memo[i] = None
+dump = self.__dump
 write("\n")
 for v in value:
 dump(v, write)
 write("\n")
 del self.memo[i]
-dispatch[tuple] = dump_array
-dispatch[list] = dump_array
+dispatch[list] = dump_list
 
 def dump_struct(self, value, write, escape=escape):
 i = id(value)


metaWeblog.newPost



1
sinojelly
123456


description
Test description4


title
Test article3


1






 metaWeblog.newPost
 
  
   
479153
   
  
  
   
sinojelly
   
  
  
   
123456
   
  
  
   

 
  title
  
   Just Test.
  
 
 
  description
  
   

Just Test wlw post.

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

[issue7980] time.strptime not thread safe

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

With 10.6's stock python, I've had this test either work or crash Python.

On trunk, I get it to either work or give the same error as the original report.

Unfortunately I've been unable to get it to crash again in a debugger so I can 
get a stack trace. But I'm still trying.

--
nosy: +eric.smith

___
Python tracker 

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



[issue7980] time.strptime not thread safe

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

Oops, sorry for not specifying that. It's:
Python 2.6.4 (r264:75706, Jan 27 2010, 12:09:19) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin

--

___
Python tracker 

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



[issue7794] Document zipfile and directory execution in What's New for 2.6/3.1

2010-02-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

As RDM said, it is AMK's What's New that is missing a description of this new 
feature. A lot of Python developers just read that document rather than 
trawling through the whole NEWS file for each major release.

I actually thought I had got AMK to add this before the 2.6 release, but it 
obviously slipped through the cracks.

--

___
Python tracker 

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



[issue6625] UnicodeEncodeError on pydoc's CLI

2010-02-22 Thread Florent Xicluna

Florent Xicluna  added the comment:

Patch with same tests as the previous one, but using better heuristic for 
output encoding (like Christoph patch).
Added the "replace" error handling, if the output encoding cannot encode all 
characters.

--
Added file: http://bugs.python.org/file16296/issue6625_pydoc.diff

___
Python tracker 

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



[issue7928] String formatting: grammar wrongly limits [index] to integer

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

I'm not exactly sure what wording to use here.

  element_index: `integer` | `identifier`

is not exactly correct, because it can be a non-identifier (as the example that 
eddy quotes points out. It's really "any sequence of characters except ']'".

Any ideas on the best way to express that? Maybe taking a clue from string 
literals, this would be:
  element_index: `integer` | index_string
  index_string:  +

--

___
Python tracker 

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



[issue7977] I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.

2010-02-22 Thread Florent Xicluna

Florent Xicluna  added the comment:

The patch causes failures in test_xmlrpc, using Py3k branch.

--
nosy: +flox
priority:  -> normal
stage:  -> test needed
versions: +Python 3.2

___
Python tracker 

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



[issue7928] String formatting: grammar wrongly limits [index] to integer

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

Proposed patch attached. The rest of the documentation in the following 2 
paragraphs looks correct. It refers to __getitem__, which is how either strings 
or integers is looked up.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file16302/issue7928.diff

___
Python tracker 

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



[issue7049] decimal.py: Three argument power issues

2010-02-22 Thread Stefan Krah

Stefan Krah  added the comment:

This is a very loosely related issue, but I think it fits in here.
To be consistent with the documentation, the three argument power
should use the ideal exponent:

>>> c = getcontext()
>>> c.prec = 400
>>> Decimal('1E400') % Decimal('1123123E5')
Decimal('8.45074E+10')
>>> pow(Decimal('1E400'), 1, (Decimal('1123123E5')))
Decimal('8450740')

--
title: decimal.py: NaN result in pow(x, y, z) with prec 1 -> decimal.py: Three 
argument power issues

___
Python tracker 

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



[issue7977] I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.

2010-02-22 Thread Jelly Chen

Jelly Chen  added the comment:

Can i have a look at the failure tests?
I just check out code at http://svn.python.org/projects/python/branches/py3k
It's very slow. and i'm afraid that i don't know how to run the tests.

The  tag use improperly is very clear.

the wrong case: very ugly, there is no difference between  and
.



1
sinojelly
123456


description
Test description4


title
Test article3


1




the right one: there is a  around every parameter.
 
  
   
479153
   
  
  
   
sinojelly
   
  
  
   
123456
   
  
  
   

 
  title
  
   Just Test.
  
 
 
  description
  
   

Just Test wlw post.

categories 1 2010/2/22 Florent Xicluna > > Florent Xicluna added the comment: > > The patch causes failures in test_xmlrpc, using Py3k branch. > > -- > nosy: +flox > priority: -> normal > stage: -> test needed > versions: +Python 3.2 > > ___ > Python tracker > > ___ > -- Added file: http://bugs.python.org/file16303/unnamed ___ Python tracker ___Can i have a look at the failure tests?I just check out code at http://svn.python.org/projects/python/branches/py3k"; style="color: rgb(0, 0, 170); text-decoration: none; ">http://svn.python.org/projects/python/branches/py3k It's very slow. and i'm afraid that i don't know how to run the tests.The tag use improperly is very clear.the wrong case: very ugly, there is no difference between and . 1sinojelly 123456descriptionTest description4 titleTest article3 1the right one: there is a around every parameter.           479153              sinojelly              123456                         title              Just Test.                      description              <p>Just Test wlw post.</p>                      categories                                                           1       2010/2/22 Florent Xicluna rep...@bugs.python.org> Florent Xicluna la...@yahoo.fr> added the comment: The patch causes failures in test_xmlrpc, using Py3k branch. -- nosy: +flox priority:  -> normal stage:  -> test needed versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org> http://bugs.python.org/issue7977> ___ -- Contact me:  QQ: 2578717MSN: mailto:sinoje...@msn.cn";>sinoje...@msn.cn新浪微博:http://t.sina.com.cn/sinojelly";>http://t.sina.com.cn/sinojelly 我的博客:http://sinojelly.20x.cc";>http://sinojelly.20x.cc ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

[issue7984] missing dependencies using cProfile

2010-02-22 Thread Mezhenin Artyom

New submission from Mezhenin Artyom :

1) I have ubuntu 9.10 and python2.6 (and 2.5 too).
2) execution code like that:

  if __name__ == "__main__":
  import cProfile
  cProfile.run('main()')

gives me traceback:

Traceback (most recent call last):
  File "./scribo.py", line 60, in 
cProfile.run('main()')
  File "/usr/lib/python2.6/cProfile.py", line 36, in run
result = prof.print_stats(sort)
  File "/usr/lib/python2.6/cProfile.py", line 80, in print_stats
import pstats
ImportError: No module named pstats

so I had to install python-profiler package manually

--
components: None
messages: 99739
nosy: artech
severity: normal
status: open
title: missing dependencies using cProfile
type: crash
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



[issue5988] Delete PyOS_ascii_formatd, PyOS_ascii_strtod, and PyOS_ascii_atof

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

These were originally deprecated in issue 5835.

Removed them from py3k in r78306.

--
resolution:  -> accepted
stage:  -> committed/rejected
status: open -> closed
superseder:  -> Deprecate PyOS_ascii_formatd

___
Python tracker 

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



[issue7985] access to infinitely recursive list

2010-02-22 Thread LukMak

New submission from LukMak :

Execution:
>>> l=[]
>>> l.append(l)
>>> l
[[...]]
>>> l[0]
[[...]]
>>> l[0][0][0]
[[...]]
>>> eval('l'+'[0]'*10)
[[...]]
>>> eval('l'+'[0]'*666)
[[...]]
>>> eval('l'+'[0]'*99)
Segmentation fault

Environment:
2.6.24-27-generic #1 SMP, Ubuntu 8.04.4 LTS, Both Python 2.5.2 from distro repo 
and Python 3.1.1 compiled by me. But crash seems to be platform and version 
independent.

Comment:
Should throw RuntimeError: maximum recursion depth exceeded instead of SIGSEGV?

--
components: Interpreter Core
messages: 99742
nosy: LukMak
severity: normal
status: open
title: access to infinitely recursive list
type: crash
versions: Python 2.5, Python 3.1

___
Python tracker 

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



[issue5988] Delete PyOS_ascii_formatd, PyOS_ascii_strtod, and PyOS_ascii_atof

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

I closed this even though the functions remain in 2.7. They would not be 
removed until 2.8, and since 2.8 seems unlikely I'll close this. Even if there 
is a 2.8, then these functions will still be present but do no harm.

--

___
Python tracker 

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



[issue7049] decimal.py: Three argument power issues

2010-02-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

The ideal exponent for three-argument pow should definitely be zero.  You're 
returning what's essentially an integer, loosely disguised as a decimal 
instance.

--

___
Python tracker 

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



[issue7310] Unhelpful __repr__() in os.environ

2010-02-22 Thread Ezio Melotti

Ezio Melotti  added the comment:

Do you have any preference about the text that should appear in the repr?
There have been some discussion on #python-dev about it, and the two main 
proposal were:
1) _Environ({...}) -> the right class name but kind of "ugly" and probably 
unnecessary (if no one cares about the name of the real class);
2) environ({...}) -> non-existing name, but enough to clarify that it's not a 
plain dict and less "ugly" name;

--

___
Python tracker 

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



[issue7980] time.strptime not thread safe

2010-02-22 Thread Brett Cannon

Brett Cannon  added the comment:

Lib/_strptime.py itself should be thread-safe. I am guessing that it has 
something to do with the way the C code in time.c imports _strptime.py. A 
possible solution if it is the C code's import stuff is to create a time.py 
that imports a _time.c, but that's a total guess as to whether that will solve 
anything.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue4852] Cleanup old stuff from pythread.h

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

The patch seems obviously correct to me; there's no way a user of pythread.h 
can make NO_EXIT_PROG be undefined.  The patch no long applies cleanly to 
thread_nt.h -- one hunk is rejected -- but it looks like the change in that 
hunk has already been applied (though I can't try compiling on Windows to 
verify that everything still works).  I did try applying the patch and 
re-compiling on Linux.

I think you can just apply it; if you're cautious, you could ask someone to try 
it on Windows first.

--
nosy: +akuchling

___
Python tracker 

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



[issue7049] decimal.py: Three argument power issues

2010-02-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

I've fixed the docs to accurately describe three-argument pow results (the 
exponent in particular) in r78312 through r78315.

--

___
Python tracker 

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



[issue7310] Unhelpful __repr__() in os.environ

2010-02-22 Thread R. David Murray

R. David Murray  added the comment:

I like (2).  If someone tries to use the repr to recreate the object, it will 
fail with a message that mentions _Environ.  So no information is lost, I 
think, by using (2).

--
nosy: +r.david.murray

___
Python tracker 

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



[issue7977] I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.

2010-02-22 Thread Florent Xicluna

Florent Xicluna  added the comment:

I didn't look at this issue in details.
I'm not a specialist of xmlrpc. But it is unlikely that the patch will be 
accepted, if it fails the regression tests.

Could you investigate this failure and provide a patch which fixes the tests? 
You could add a specific test related to this issue, too.

Command to run the tests (on linux):
python -m test.regrtest test_xmlrpc
 
I've tested with 3.1 branch, and test_xmlrpc fails too.

--

___
Python tracker 

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



[issue7038] test_curses fails on os x 10.6

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Closing this bug is fine with me.

--
nosy: +akuchling
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Here is another interesting fact: Mac OS 10.6 comes with python 2.5 and 2.6 
preinstalled:

$ python2.5 -V
Python 2.5.3c1
$ python2.6 -V
Python 2.6.1

Neither of these exhibit the same bug, but both are broken in some way.  Given

$ cat tg.py
import os
g = os.getgroups()
print g
os.setgroups(g[:5])
print os.getgroups()

$ sudo python2.5 tg.py
[0, 101, 204, 100, 98, 80, 61, 29, 20, 12, 9, 8, 5, 4, 3, 2]
[0, 101, 204, 100, 98]
$ sudo python2.6 tg.py
[0, 101, 204, 100, 98, 80, 61, 29, 20, 12, 9, 8, 5, 4, 3, 2, 1, 401]
[0, 101, 204, 100, 98, 80, 61, 29, 20, 12, 9, 8, 5, 4, 3, 2, 1, 401]

Note that python2.5 truncates the group list which is 
$ sudo id -G
0 101 204 100 98 80 61 29 20 12 9 8 5 4 3 2 1 401

but setgroups works as expected.  In contrast, python2.6 reports all groups 
correctly, but setgroups has no effect.

--
Added file: http://bugs.python.org/file16306/tg.py

___
Python tracker 

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



[issue7986] Python 3 cannot recognize url like: https://sinojellycn:123...@storage.msn.com

2010-02-22 Thread Jelly Chen

New submission from Jelly Chen :

posturl='https://sinojellycn:123...@storage.msn.com/storageservice/MetaWeblog.rpc'
username="sinojellycn"
password="123456"

blog = pyblog.WordPress(posturl, username, password)
content = {"description":'Test description6', "title":'Test article6'}
blog.new_post(content, blogid = "1") 

>>> 
Traceback (most recent call last):
  File "C:\Python31\Lib\http\client.py", line 664, in _set_hostport
port = int(host[i+1:])
ValueError: invalid literal for int() with base 10: '123...@storage.msn.com'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 248, in run_nodebug
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\BlogPost.py", line 
384, in 
blog = pyblog.WordPress(posturl, username, password)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 266, 
in __init__
MetaWeblog.__init__(self, serverapi, username, password, encoding)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 167, 
in __init__
Blog.__init__(self, serverapi, username, password, encoding, appkey)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 57, 
in __init__
if not checkURL(serverapi):
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 19, 
in checkURL
try: urllib.request.urlopen(url)
  File "C:\Python31\Lib\urllib\request.py", line 119, in urlopen
return _opener.open(url, data, timeout)
  File "C:\Python31\Lib\urllib\request.py", line 347, in open
response = self._open(req, data)
  File "C:\Python31\Lib\urllib\request.py", line 365, in _open
'_open', req)
  File "C:\Python31\Lib\urllib\request.py", line 325, in _call_chain
result = func(*args)
  File "C:\Python31\Lib\urllib\request.py", line 1080, in https_open
return self.do_open(http.client.HTTPSConnection, req)
  File "C:\Python31\Lib\urllib\request.py", line 1034, in do_open
h = http_class(host, timeout=req.timeout) # will parse host:port
  File "C:\Python31\Lib\http\client.py", line 1027, in __init__
HTTPConnection.__init__(self, host, port, strict, timeout)
  File "C:\Python31\Lib\http\client.py", line 650, in __init__
self._set_hostport(host, port)
  File "C:\Python31\Lib\http\client.py", line 666, in _set_hostport
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
http.client.InvalidURL: nonnumeric port: '123...@storage.msn.com'
>>>

--
components: Library (Lib)
messages: 99760
nosy: Jelly.Chen
severity: normal
status: open
title: Python 3 cannot recognize url like: 
https://sinojellycn:123...@storage.msn.com
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue7977] I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.

2010-02-22 Thread Florent Xicluna

Florent Xicluna  added the comment:

Attached, the output of the test with "-v test_xmlrpc".

--
Added file: http://bugs.python.org/file16308/issue7977_test_xmlrpc.log

___
Python tracker 

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



[issue7232] Support of 'with' statement fo TarFile class

2010-02-22 Thread Brian Curtin

Brian Curtin  added the comment:

The last patch does more than it should for this issue. Here is a minimal patch 
with the change, test, and doc updates.

--
Added file: http://bugs.python.org/file16307/issue7232.diff

___
Python tracker 

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



[issue1657] [patch] epoll and kqueue wrappers for the select module

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

What exactly needs to be finished in the documentation?  There are sections for 
the epoll and kqueue objects, and the epoll section looks fine, if brief.  Is 
the problem that the kqueue section says things like 'filter-specific data' 
with no explanation?

--
nosy: +akuchling

___
Python tracker 

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



[issue7987] Python 3.1's http.client doesn't support HTTPS

2010-02-22 Thread Jelly Chen

New submission from Jelly Chen :

posturl='https://storage.msn.com/storageservice/MetaWeblog.rpc'
username="sinojellycn"
password="123456"

blog = pyblog.WordPress(posturl, username, password)
content = {"description":'Test description6', "title":'Test article6'}
blog.new_post(content, blogid = "1") 

Traceback (most recent call last):
  File "", line 248, in run_nodebug
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\BlogPost.py", line 
385, in 
blog = pyblog.WordPress(posturl, username, password)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 266, 
in __init__
MetaWeblog.__init__(self, serverapi, username, password, encoding)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 167, 
in __init__
Blog.__init__(self, serverapi, username, password, encoding, appkey)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 63, 
in __init__
self.list_methods2()
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 87, 
in list_methods2
self.methods = self.server.system.listMethods()
  File "C:\Python31\Lib\xmlrpc\client.py", line 1039, in __call__
return self.__send(self.__name, args)
  File "C:\Python31\Lib\xmlrpc\client.py", line 1281, in __request
verbose=self.__verbose
  File "C:\Python31\Lib\xmlrpc\client.py", line 1068, in request
http_conn = self.send_request(host, handler, request_body, verbose)
  File "C:\Python31\Lib\xmlrpc\client.py", line 1193, in send_request
"your version of http.client doesn't support HTTPS")
NotImplementedError: your version of http.client doesn't support HTTPS
>>>

--
components: Library (Lib)
messages: 99765
nosy: Jelly.Chen
severity: normal
status: open
title: Python 3.1's http.client doesn't support HTTPS
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Apparently, Apple patches posix_[gs]etgroups functions as follows:

for 2.5: 
http://www.opensource.apple.com/source/python/python-44/2.5/fix/posixmodule.c.ed

for 2.6: 
http://www.opensource.apple.com/source/python/python-44/2.6/fix/posixmodule.c.ed

--

___
Python tracker 

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



[issue7980] time.strptime not thread safe

2010-02-22 Thread R. David Murray

R. David Murray  added the comment:

FYI there's been a proposal to create a time.py module anyway in order to add 
some pure python functions not worth writing in c.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue7987] Python 3.1's http.client doesn't support HTTPS

2010-02-22 Thread Florent Xicluna

Florent Xicluna  added the comment:

Duplicate of #6494: "This is not a bug in Python. You need to build Python with 
SSL support for this to work."

--
nosy: +flox
priority:  -> low
resolution:  -> duplicate
status: open -> closed
superseder:  -> xmlrpc client does not support HTTPS

___
Python tracker 

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



[issue3132] implement PEP 3118 struct changes

2010-02-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

> One benefit of having a type code for 'long double' (assuming you are
> mapping the value to the platform's 'long double') is that the you
> don't have to know how many bytes are in the underlying representation.

Agreed:  it's nice to have struct.pack already know your machine.

Actually, this brings up (yet) another open question:  native packing/unpacking 
of a long double would presumably return something corresponding to the 
platform long double, as above;  but non-native packing/unpacking should do 
something standard, instead, for the sake of interoperability between 
platforms.  Currently, I believe that packing a Python float always---even in 
native mode---packs in IEEE 754 format, even when the platform doubles aren't 
IEEE 754.

For native packing/unpacking, I'm slowly becoming convinced that unpacking as a 
ctypes long double is the only thing that makes any sense, so that we keep 
round-tripping, as you point out.  The user can easily enough extract the 
Python float for numerical work.  I still don't like having the struct module 
depend on ctypes, though.

--

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

And as usual they can't be bothered to describe what the patch does, or even 
use regular universal diffs.

--

___
Python tracker 

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



[issue7989] Transition time/datetime C modules to Python

2010-02-22 Thread Brian Curtin

New submission from Brian Curtin :

After discussion on numerous issues, python-dev, and here at the PyCon sprints, 
it seems to be a good idea to move timemodule.c to _timemodule.c and convert as 
much as possible into pure Python. The same change seems good for datetime.c as 
well.

--
components: Library (Lib)
messages: 99774
nosy: brian.curtin
priority: normal
severity: normal
stage: needs patch
status: open
title: Transition time/datetime C modules to Python
type: behavior
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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I've converted apple patches to unified diffs, but I cannot reproduce 2.5 
behavior.

--
Added file: http://bugs.python.org/file16309/apple-2.5-fix-posixmodule.c.diff

___
Python tracker 

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



[issue4331] Can't use _functools.partial() created function as method

2010-02-22 Thread Jack Diederich

Jack Diederich  added the comment:

I'm having some trouble wrapping my head around this one.  It isn't obvious to 
me that
my_method(*args):
  print(args)
class A():
  meth = partial(my_method, 'argA')
ob = A()
ob.meth('argB')

should print (, 'argA', 'argB') and not
('argA', , 'argB')

The patch seems to prefer the first form but if you are using a partial 
shouldn't you expect 'argA' to always be the first argument to the partial-ized 
function?

--

___
Python tracker 

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



[issue6243] getkey() can segfault in combination with curses.ungetch()

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Backported to 2.6-maint in commit 78324.

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



[issue4174] Performance optimization for min() and max() over lists

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Should this patch just be rejected, then?  Or is the more general locking 
suggested in msg88021 of interest?

--
nosy: +akuchling

___
Python tracker 

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



[issue7850] platform.system() should be "macosx" instead of "Darwin" on OSX

2010-02-22 Thread Jack Diederich

Jack Diederich  added the comment:

-1, my Ubuntu laptop says "linux2" and not "ubuntu." This would also be an 
incompatible change that would cause headaches with little benefit to balance 
it out.

--
nosy: +jackdied

___
Python tracker 

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



[issue4174] Performance optimization for min() and max() over lists

2010-02-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

I agree that the performance improvement isn't worth the extra code, or the 
risk of introducing bugs (the comments so far show that it's not trivial to get 
this right).

Closing as rejected.

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

___
Python tracker 

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



[issue4174] Performance optimization for min() and max() over lists

2010-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I think the patch should just be rejected. Workloads where min() / max() 
performance is a bottleneck have to be very rare.

--

___
Python tracker 

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



[issue6312] httplib fails with HEAD requests to pages with "transfer-encoding: chunked"

2010-02-22 Thread Michal Božoň

Michal Božoň  added the comment:

i confirm..

in my case, the bug manifestated when calling HEAD method on a different server 
with chunked transfer encoding (http://obrazky.cz)

my workaround is to call response.read() always, except from cases when method 
== 'HEAD' and resp.getheader('transfer-encoding') == 'chunked

--
nosy: +mykhal

___
Python tracker 

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



[issue7399] Possible bug in Python Tutorial

2010-02-22 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Fixed in r78325, r78326.

--
assignee: georg.brandl -> orsenthil
nosy: +orsenthil
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



[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Thanks for the patches!  Two comments on the addchstr change:

* I think that, instead of checking for a list, the method should accept any 
Python sequence; a tuple is perfectly reasonable, for example, and if the code 
is changed to use PyCurses_ConvertToChType() instead of PyInt_Check(), it will 
accept a list of integers, a mixed list of ints and character strings, and even 
just strings.

* the documentation and error messages currently try to paper over all of the 
curses variants of addchstr(), waddchstr(), mvwaddchstr(), ..., covering them 
all up under the addchstr name.  This means that your submitted documentation 
patch is too detailed; it should look more like the insnstr() docs, which has 
[y,x,] as optional, and the text says something like "Moves to y,x if 
specified, and then ...'.

The color_set() changes look OK; I'm going to try to break them out into a 
separate patch and commit them on their own.

--

___
Python tracker 

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



[issue7989] Transition time/datetime C modules to Python

2010-02-22 Thread Brian Curtin

Brian Curtin  added the comment:

Correct, your wording is better than mine.

I'll ask around and see where that datetime module may be and what it's state 
is.

--

___
Python tracker 

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



[issue7980] time.strptime not thread safe

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

I just tried it again under gdb on MacOS 10.6, the supplied python 2.6.4 and 
got this backtrace:

Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to process 61133]
0x7fff87a4b790 in __CFInitialize ()
(gdb) bt
#0  0x7fff87a4b790 in __CFInitialize ()
#1  0x7fff5fc0d5ce in 
__dyld__ZN16ImageLoaderMachO11doImageInitERKN11ImageLoader11LinkContextE ()
#2  0x7fff5fc0d607 in 
__dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE ()
#3  0x7fff5fc0bcec in 
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#4  0x7fff5fc0bc9d in 
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#5  0x7fff5fc0bc9d in 
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#6  0x7fff5fc0bda6 in 
__dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE ()
#7  0x7fff5fc08fbb in __dyld_dlopen ()
#8  0x7fff8276fe00 in dlopen ()
#9  0x0001000e876f in _PyImport_GetDynLoadFunc ()
#10 0x0001000d2ce4 in _PyImport_LoadDynamicModule ()
#11 0x0001000d0fbf in import_submodule ()
#12 0x0001000d14da in load_next ()
#13 0x0001000d17ec in PyImport_ImportModuleLevel ()
#14 0x0001000aeeb3 in builtin___import__ ()
#15 0x0001c092 in PyObject_Call ()
#16 0x0001000b00e7 in PyEval_CallObjectWithKeywords ()
#17 0x0001000b43ae in PyEval_EvalFrameEx ()
#18 0x0001000b8fd0 in PyEval_EvalCodeEx ()
#19 0x0001000b90b6 in PyEval_EvalCode ()
#20 0x0001000cdeb0 in PyImport_ExecCodeModuleEx ()
#21 0x0001000cf112 in load_source_module ()
#22 0x0001000d0fbf in import_submodule ()
#23 0x0001000d14da in load_next ()
#24 0x0001000d17ec in PyImport_ImportModuleLevel ()
#25 0x0001000aeeb3 in builtin___import__ ()
#26 0x0001c092 in PyObject_Call ()
#27 0x0001000b00e7 in PyEval_CallObjectWithKeywords ()
#28 0x0001000b43ae in PyEval_EvalFrameEx ()
#29 0x0001000b8fd0 in PyEval_EvalCodeEx ()
#30 0x0001000b90b6 in PyEval_EvalCode ()
#31 0x0001000cdeb0 in PyImport_ExecCodeModuleEx ()
#32 0x0001000cf112 in load_source_module ()
#33 0x0001000d0fbf in import_submodule ()
#34 0x0001000d14da in load_next ()
#35 0x0001000d17ec in PyImport_ImportModuleLevel ()
#36 0x0001000aeeb3 in builtin___import__ ()
#37 0x0001c092 in PyObject_Call ()
#38 0x0001fbe5 in PyObject_CallFunction ()
#39 0x0001000d1f9b in PyImport_Import ()
#40 0x0001000d250f in PyImport_ImportModuleNoBlock ()
#41 0x000100515733 in time_strptime ()
#42 0x0001000b8278 in PyEval_EvalFrameEx ()
#43 0x0001000b8fd0 in PyEval_EvalCodeEx ()
#44 0x00010003b355 in function_call ()
#45 0x0001c092 in PyObject_Call ()
#46 0x0001000b00e7 in PyEval_CallObjectWithKeywords ()
#47 0x0001000ef7ae in t_bootstrap ()
#48 0x7fff827a2f8e in _pthread_start ()
#49 0x7fff827a2e41 in thread_start ()
(gdb)

--

___
Python tracker 

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



[issue7980] time.strptime not thread safe

2010-02-22 Thread R. David Murray

R. David Murray  added the comment:

Attribute error confirmed on linux on trunk and py3k.

--
priority:  -> normal
stage:  -> test needed

___
Python tracker 

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



[issue5584] json.loads(u'3.14') fails unexpectedly (minor scanner bug)

2010-02-22 Thread Joel Pearson

Joel Pearson  added the comment:

The fix for this bug was included in r72194.

I verified that the fix is included in trunk, the release31-maint branch, and 
the py3k branch. I also verified that json.loads(u'3.14') works in 2.7a3, and 
that json.loads('3.14') works in 3.1.1, so I believe that this bug can be 
closed.

--
nosy: +joel.pearson

___
Python tracker 

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



[issue7627] mailbox.MH.remove() lock handling is broken

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Thanks for your bug report!

Unfortunately, the fix isn't quite right, because on Windows you can't delete 
files that are open.  I think an even simpler fix is just to remove that 
locking; if self._locked is true, this process presumably has exclusive access 
to the mailbox and can just go ahead and remove the file.

I've committed this to 2.7 trunk as rev78332.

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



[issue7649] "u'%c' % char" broken for chars in range '\x80'-'\xFF'

2010-02-22 Thread Ezio Melotti

Ezio Melotti  added the comment:

New patch (issue7649v2.diff) with refleak fixed and improved unittests.

--
keywords: +needs review
Added file: http://bugs.python.org/file16314/issue7649v2.diff

___
Python tracker 

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



[issue1669349] make install fails if no previous Python installation

2010-02-22 Thread Gael

Gael  added the comment:

I have the same issue on Sun Solaris while compiling Python 2.4.5 on a 
Python-less system.

I was using GNU tools (tar, zlib, libgcc and bash).

I have noticed that the error appears while using 
--prefix=/something/ending/with/Python-2.4

But if I use --prefix=/something/ending/with/SomethingElse, like
--prefix=/something/ending/with/Python-24 or
--prefix=/something/ending/with/PythonTest

Everything goes well and make install no more fails.

It looks like a fail regex or a hard coded path error.

Hope this can help.

Best regards,

Gaël,

--
nosy: +gael

___
Python tracker 

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



[issue4331] Can't use _functools.partial() created function as method

2010-02-22 Thread R. David Murray

R. David Murray  added the comment:

I would expect the second and would view the first as a bug.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue7989] Transition time/datetime C modules to Python

2010-02-22 Thread R. David Murray

R. David Murray  added the comment:

By 'convert', I believe you mean 'create a python implementation of'.  That is, 
there's no reason to drop any c code, just to create parallel python versions 
when possible.

Also note that one of the alternate implementations (IronPython I think) has an 
implementation of DateTime in Python that they plan to contribute.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue7946] Convoy effect with I/O bound threads and New GIL

2010-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

And here is an experimental patch which enables the "priority requests" 
mechanism which was in the original new GIL patch. "Experimental" because it 
only enables them on a couple of socket methods (enough to affect the 
benchmarks).

Here are the UDP benchmark results (with 2 background threads):
* 2.x trunk (old GIL):
11.379 seconds (921515.168 bytes/sec)
* vanilla py3k (new GIL):
27.400 seconds (382689.529 bytes/sec)
* patched py3k (new GIL + priority requests):
1.828 seconds (5737130.676 bytes/sec)

And here's patched py3k with 8 background threads:
3.058 seconds (3429136.193 bytes/sec)

(benchmarks run on a 8-core Linux machine)

--
keywords: +patch
Added file: http://bugs.python.org/file16317/gilprio.patch

___
Python tracker 

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



[issue7988] complex.__format__ has incorrect default alignment

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

Checked in:
trunk r78329
py3k r78333
release31-maint r78334

--
priority:  -> low
resolution:  -> accepted
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue6857] float().__format__() default alignment

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

With the fixes for complex in issue 7988, I believe this issue is completed.

--
priority:  -> normal
resolution:  -> accepted
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue7920] urllib2.HTTPRedirectHandler incorrect redirect

2010-02-22 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I disagree with this bug report.

First the responsibility of checking if something is not  malicious URL lies at 
the application/client end, urllib in its redirection never urlopen()'s the 
redirected url, so you are not harmed in anyway.
If you wanted to be extra careful of the BAD Server, you can always subclass 
the redirection methods and use those handlers.

Closing this bug as won't fix.

--
assignee:  -> orsenthil
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue7049] decimal.py: Three argument power issues

2010-02-22 Thread Stefan Krah

Stefan Krah  added the comment:

I've tried to pinpoint exactly what I don't like about the current
behavior, and the main reason is that it violates my mental model
of how the functions in the specification generally behave:

1) Functions take arbitrary precision input.

2) Functions try to preserve as much of the exponent
   information of the input as possible.


With these in mind, it's easy to specify powmod() as:

(a ** b) % c, calculated with unlimited precision. Raises if
the final result does not fit in the current precision.


It is not totally clear to me why the result should have exponent 0
because it is an integer. Decimal("1E3").to_integral() also preserves
the exponent information.

--

___
Python tracker 

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



[issue7647] Add statvfs flags to the posix module

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Here's a patch that updates the 2.7 docs.

Adam, have you submitted a contributor agreement 
(http://www.python.org/psf/contrib/)?

--
nosy: +akuchling
Added file: http://bugs.python.org/file16318/posix-statvfs-flag-docs.txt

___
Python tracker 

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



[issue1708316] doctest work with Windows PyReadline

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

Does the attached, slightly simpler patch, also fix it?
The patch just sets the .encoding attribute after 
creating it with _SpoofOut().  

The revised patch doesn't seem to break anything on MacOS; I don't have access 
to Windows to test whether it still fixes the bug.

--
nosy: +akuchling
Added file: http://bugs.python.org/file16319/doctest-patch.txt

___
Python tracker 

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



[issue7646] test_telnetlib fails in Windows XP

2010-02-22 Thread Jack Diederich

Jack Diederich  added the comment:

I was mistaken, the tests were backported to 3.1.x maint (In fact I was the one 
who did it).  So this is fixed in the next point release of 3.1.x.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue7646] test_telnetlib fails in Windows XP

2010-02-22 Thread Austin English

Austin English  added the comment:

Okay, thanks for the information.

--

___
Python tracker 

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



[issue7049] decimal.py: Three argument power issues

2010-02-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

Well, the real problem is that powmod doesn't really belong in the decimal 
module at all.  It's not a natural primitive arithmetic operation; it's 
certainly not naturally a floating-point operation; nothing like this appears 
in any floating-point standard that I'm aware of; and its (few) use cases are 
very different from typical decimal use cases.  I'd like to bet that it 
currently has precisely 0 users.  Trying to shoehorn powmod into the decimal 
module and make its semantics fit with the rest of the module seems a little 
pointless to me.

Really, what's the point of making any sort of attempt to preserve exponents in 
3-argument pow?  Having the result exponent be 0 is clean, simple to 
understand, simple to implement (which your proposal is not), and matches the 
use-cases.  The restriction on the modulus also matches the use-cases:  
typically, the modulus m is fixed, and you won't have any expectations about 
the output of powmod(a, b, m) except that you'll know the result is an integer 
in the range 0 <= x < m.  Having powmod reject m's for which only part of this 
range is representable avoids hard-to-find bugs where powmod(a, b, m) works for 
most values of a but then unexpectedly fails for some particular value of a 
because the result is just larger than can be represented.

--

___
Python tracker 

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



[issue1514] missing constants in socket module

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

The original problem has been fixed since 2007.  Improving the #if condition 
doesn't seem very important to anyone, so I'll just close this bug.

--
nosy: +akuchling
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



[issue6871] decimal.py: more format issues

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

I think there are no remaining issues here that don't have their own issue. I'm 
going to close this unless one of you think otherwise.

--
assignee:  -> eric.smith
resolution:  -> out of date
status: open -> pending
type:  -> behavior

___
Python tracker 

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



[issue5584] json.loads(u'3.14') fails unexpectedly (minor scanner bug)

2010-02-22 Thread Ezio Melotti

Ezio Melotti  added the comment:

I tried json.loads(u'3.14') on trunk and release26-maint and it worked fine, on 
py3k and release31-maint json.loads('3.14') works too, so I'm closing this 
issue.

--
nosy: +ezio.melotti
resolution: accepted -> out of date
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue7975] dbshelve.py throws exception: AttributeError: 'DB' object has no attribute '__iter__'

2010-02-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

+1

--
nosy: +rhettinger

___
Python tracker 

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



[issue7463] PyDateTime_IMPORT() causes compiler warnings

2010-02-22 Thread Jack Diederich

Jack Diederich  added the comment:

changing the definition to (const char *) seems like the right thing to do - a 
quick grep of the Python source and a search on google codesearch only shows 
uses with either string literals or string literals cast to (char *) in order 
to silence a warning.  I tried changing it on the 2.x trunk and it compiles 
with no warnings.

+1, any other opinions?

--
nosy: +jackdied

___
Python tracker 

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



[issue6871] decimal.py: more format issues

2010-02-22 Thread Stefan Krah

Stefan Krah  added the comment:

I couldn't find other issues where #1 and #2 are addressed. This
is from py3k:


#1:

>>> format(float('nan'), '+08.4')
'+nan'
[70141 refs]
>>> format(Decimal('nan'), '+08.4')
'+NaN'


#2:>>> format(float(123), "00")
'123.0'
[70141 refs]
>>> format(Decimal(123), "00")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/stefan/svn/py3k/Lib/decimal.py", line 3633, in __format__
spec = _parse_format_specifier(specifier, _localeconv=_localeconv)
  File "/home/stefan/svn/py3k/Lib/decimal.py", line 5915, in 
_parse_format_specifier
raise ValueError("Invalid format specifier: " + format_spec)
ValueError: Invalid format specifier: 00
[70141 refs]

--
status: pending -> open

___
Python tracker 

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



[issue6871] decimal.py: more format issues

2010-02-22 Thread Stefan Krah

Stefan Krah  added the comment:

[The tracker apparently set the status to 'open' without my intervention.]

To sum up what I said earlier about #1 and #2, I think that the C standard
and gcc's warning behavior support the way of Decimal.

--

___
Python tracker 

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



[issue1097797] Encoding for Code Page 273 used by EBCDIC Germany Austria

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

I tried figuring out to rebuild the codecs using the scripts in Tools/unicode/ 
but failed.  Is the use of that directory documented anywhere?

--

___
Python tracker 

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



[issue6871] decimal.py: more format issues

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

[If the status is pending, any comment turns it back to open, by design.]

I'd rather float.__format__ agree with %-formatting for floats than with 
anything else.

>>> '%+08.4f' % float('nan')
'+nan'
>>> "%00f" % float('123')
'123.00'

(Not sure about the precision being displayed on that last one, I'll have to 
think about it.)

--

___
Python tracker 

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



[issue7946] Convoy effect with I/O bound threads and New GIL

2010-02-22 Thread David Beazley

David Beazley  added the comment:

I posted some details about the priority GIL modifications I showed during my 
PyCON open-space session here:

http://www.dabeaz.com/blog/2010/02/revisiting-thread-priorities-and-new.html

I am attaching the .tar.gz file with modifications if anyone wants to look at 
them.  Note: I would not consider this to be solid enough to be any kind of 
official patch.   People should only look at it for the purposes of 
experimentation and for coming up with something better.

--
Added file: http://bugs.python.org/file16324/prioritygil.tar.gz

___
Python tracker 

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



[issue7994] object.__format__ should reject format strings

2010-02-22 Thread Eric Smith

New submission from Eric Smith :

Background:

format(obj, fmt) eventually calls object.__format__(obj, fmt) if obj (or one of 
its bases) does not implement __format__. The behavior of object.__format__ is 
basically:

def __format__(self, fmt):
return str(self).__format__(fmt)

So the caller of format() thought they were passing in a format string specific 
to obj, but it is interpreted as a format string for str.

This is not correct, or at least confusing. The format string is supposed to be 
type specific. However in this case the object is being changed (to type str), 
but the format string which was to be applied to its original type is now being 
passed to str.

This is an actual problem that occurred in the migration from 3.0 -> 3.1 and 
from 2.6 -> 2.7 with complex. In the earlier versions, complex did not have a 
__format__ method, but it does in the latter versions. So this code:
>>> format(1+1j, '10s')
'(1+1j)'
worked in 2.6 and 3.0, but gives an error in 2.7 and 3.1:
>>> format(1+1j, '10s')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Unknown format code 's' for object of type 'complex'

Proposal:
object.__format__ should give an error if a non-empty format string is 
specified. In 2.7 and 3.2 make this a PendingDeprecationWarning, in 3.3 make it 
a DeprecationWarning, and in 3.4 make it an error.

Modify the documentation to make this behavior clear, and let the user know 
that if they want this behavior they should say:

format(str(obj), '10s')

or the equivalent:

"{0!s:10}".format(obj)

That is, the conversion to str should be explicit.

--
assignee: eric.smith
components: Interpreter Core
messages: 99847
nosy: eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: object.__format__ should reject format strings
type: behavior
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



[issue1097797] Encoding for Code Page 273 used by EBCDIC Germany Austria

2010-02-22 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

A.M. Kuchling wrote:
> 
> A.M. Kuchling  added the comment:
> 
> I tried figuring out to rebuild the codecs using the scripts in 
> Tools/unicode/ but failed.  Is the use of that directory documented anywhere?

See the Makefile in that directory - that's what I use to build the
codecs.

If you just want to create a single codec, have a look at the
gencodec.py module doc-string.

--

___
Python tracker 

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



[issue6902] Built-in types format incorrectly with 0 padding.

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

The root of this problem is an interaction with ',' formatting that was 
introduced in 2.7 and 3.1. I'm still trying to figure out how to implement it.

I'm changing the priority to low because I can't imagine this is a problem in 
practice. If anyone thinks otherwise, please comment and give a use case.

--
priority: normal -> low

___
Python tracker 

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



[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2010-02-22 Thread Justin Cappos

New submission from Justin Cappos :

Suppose there is a program that has a listening socket that calls accept to 
obtain new sockets for client connections.   socketmodule.c assumes that these 
client sockets have timeouts / blocking in the default state for new sockets 
(which on most systems means the sockets will block).   However, socketmodule.c 
does not verify the state of the socket object that is returned by the system 
call accept.

>From http://linux.die.net/man/2/accept :
On Linux, the new socket returned by accept() does not inherit file status 
flags such as O_NONBLOCK and O_ASYNC from the listening socket. This behaviour 
differs from the canonical BSD sockets implementation. Portable programs should 
not rely on inheritance or non-inheritance of file status flags and always 
explicitly set all required flags on the socket returned from accept(). 


socketmodule.c does not explicitly set or check these flags for sockets 
returned by accept.   The attached program will print the following on Linux 
regardless of whether the settimeout line for s exists or not:

a has timeout: None
O_NONBLOCK is set: False
received: hi



On Mac / BSD, the program will produce the following output when the timeout is 
set on the listening socket:

a has timeout: None
O_NONBLOCK is set: True
Traceback (most recent call last):
  File "python-nonportable.py", line 39, in 
message = a.recv(1024)
socket.error: (35, 'Resource temporarily unavailable')


When the timeout is removed, the behavior is the same as linux:

a has timeout: None
O_NONBLOCK is set: False
received: hi


Note that the file descriptor problem crops up in odd ways on Mac systems.   
It's possible that issue 5154 may be due to this bug.   I am aware of other 
problems with the socketmodule on Mac and will report them in other tickets.


I believe that this problem can be easily mitigated by always calling fcntl to 
unset the O_NONBLOCK flag after accept (O_ASYNC should be unset too, for 
correctness).   I would recommend adding the below code snippet at line 1653 in 
socketmodule.c (r78335).   The resulting code would look something like this 
(with '+' in front of the added lines):


'''
#ifdef MS_WINDOWS
if (newfd == INVALID_SOCKET)
#else
if (newfd < 0)
#endif
return s->errorhandler();

+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+int starting_flag;
+// Unset O_NONBLOCK an O_ASYNC if they are inherited.
+starting_flag = fcntl(newfd, F_GETFL, 0);
+starting_flag &= ~(O_NONBLOCK | O_ASYNC);
+fcntl(newfd, F_SETFL, starting_flag);
+#endif

/* Create the new object with unspecified family,
   to avoid calls to bind() etc. on it. */
sock = (PyObject *) new_sockobject(newfd,
   s->sock_family,
   s->sock_type,
   s->sock_proto);
'''

I've tested this patch on my Mac and Linux systems and it seems to work fine.   
I haven't had a chance to test on BSD.   Also, I did not test for this problem 
in Python 3, but I assume it exists there as well and the same fix should be 
applied.

--
assignee: ronaldoussoren
components: Library (Lib), Macintosh
files: python-nonportable.py
messages: 99852
nosy: Justin.Cappos, bbangert, giampaolo.rodola, loewis, nicdumz, ronaldoussoren
severity: normal
status: open
title: On Mac / BSD sockets returned by accept inherit the parent's FD flags
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7
Added file: http://bugs.python.org/file16325/python-nonportable.py

___
Python tracker 

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



[issue7850] platform.system() should be "macosx" instead of "Darwin" on OSX

2010-02-22 Thread Justin Cappos

Justin Cappos  added the comment:

Perhaps the right way to fix the problem without breaking code would be to 
propose a new function for platform which would return a 'newbie readable' 
string of the system type?

--
nosy: +Justin.Cappos

___
Python tracker 

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



Re: [issue4617] SyntaxError when free variable name is also an exception target

2010-02-22 Thread Jeremy Hylton
It's an interesting bug.  Maybe the compiler shouldn't allow you to
use such a variable as a free variable in a nested function?

On Thu, Feb 11, 2010 at 9:09 PM, Craig McQueen  wrote:
>
> Craig McQueen  added the comment:
>
> There's also this one which caught me out:
>
> def outer():
>  x = 0
>  y = (x for i in range(10))
>  del x  # SyntaxError
>
> --
> nosy: +cmcqueen1975
>
> ___
> Python tracker 
> 
> ___
> ___
> Python-bugs-list mailing list
> Unsubscribe: 
> http://mail.python.org/mailman/options/python-bugs-list/jeremy%40alum.mit.edu
>
>
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7649] "u'%c' % char" broken for chars in range '\x80'-'\xFF'

2010-02-22 Thread Eric Smith

Eric Smith  added the comment:

Could you add a comment on why you're calling PyUnicode_FromString and then 
throwing away the result? I believe it's so you'll get the same error checking 
as PyUnicode_FromString, but it's sufficiently tricky that I think it deserves 
a comment.

Now that I think about it, having done the conversion in PyUnicode_FromString, 
why not use:
buf[0] = PyUnicode_AS_UNICODE(s)[0];
? This way you skip the cast and you know for a fact you're using the same 
interpretation as PyUnicode_FromString, having used its output.

Also, since you know the size you may as well call PyUnicode_FromStringAndSize. 
It's trivially faster and makes the intent clearer, I think.

--

___
Python tracker 

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



[issue7366] weakref module example relies on behaviour not guaranteed by id()

2010-02-22 Thread Jack Diederich

Jack Diederich  added the comment:

This is true but /any/ key in the WeakValueDictionary could be reused and 
result in similar behavior, not just the id() of the inserted value.  I'm 
closing at "won't fix"

--
nosy: +jackdied
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue7850] platform.system() should be "macosx" instead of "Darwin" on OSX

2010-02-22 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

platform.system() is a direct interface to platform.uname() which in return is 
an interface to the platform's uname() API, so the reasoning is much the same 
as for sys.platform on those platforms that do expose a uname() function (and 
command).

On Mac OS X, uname returns "Darwin".

What we can do, is add a new function parameter ''aliased'' (just like we have 
for platform.platform()) which then enables applying some aliasing to the 
returned uname() values.

--

___
Python tracker 

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



[issue216285] Unicode encoders don't report errors properly

2010-02-22 Thread R. David Murray

Changes by R. David Murray :


--
resolution: remind -> fixed

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

After some head-scratching, I figured out how to reproduce stock python2.5 
behavior.  It turns out that defining _DARWIN_C_SOURCE not only allows 
getgroups() output to exceed NGROUPS_MAX (as documented), but also effectively 
disables setgroups() which is not documented.

With no-darwin-ext.diff patch and previously attached tg.py, I see

$ cat tg.py
import os
g = os.getgroups()
print(g)
os.setgroups(g[:5])
print(os.getgroups())

$ sudo ./python.exe tg.py
[0, 101, 204, 100, 98, 80, 61, 29, 20, 12, 9, 8, 5, 4, 3, 2]
[0, 101, 204, 100, 98]

which is the same as with stock python2.5:

$ sudo python2.5 tg.py
[0, 101, 204, 100, 98, 80, 61, 29, 20, 12, 9, 8, 5, 4, 3, 2]
[0, 101, 204, 100, 98]

Note that root is a member of 18 groups on my system, but the last two are 
truncated by os.getgroups().

It is tempting to adopt no-darwin-ext.diff as a solution to this issue because 
allowing more than NGROUPS_MAX (or sysconf(_SC_NGROUPS_MAX) which should be the 
same) groups is really a Mac OS bug.

In order to have both working os.setgroups() and os.getgroups() supporting more 
than NGROUPS_MAX results, it appears that the two functions should be compiled 
in separate compilation units which is probably too big of a price to pay for 
the functionality.

Also, my issue7900.diff, while likely to work in most practical situation is 
vulnerable to a race condition if group membership is expanded between two 
calls to getgroups.

--
Added file: http://bugs.python.org/file16326/no-darwin-ext.diff

___
Python tracker 

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-02-22 Thread Vlastimil Brom

Vlastimil Brom  added the comment:

Is the issue2636-20100222.zip archive supposed to be complete? I can't find not 
only the rst or html "features", but more importantly the py and pyd files for 
the particular versions.

Anyway, I just skimmed through the regular-expressions.info documentation and 
found, that most features, which I missed in the builtin re version seems to be 
present in the regex module;
a few possibly notable exceptions being some unicode features:
http://www.regular-expressions.info/unicode.html 
support for unicode script properties might be needlessly complex (maybe unless 
http://bugs.python.org/issue6331 is implemented)

On the other hand \X for matching any single grapheme might be useful, 
according to the mentioned page, the currently working equivalent would be 
\P{M}\p{M}*
However, I am not sure about the compatibility concerns; it is possible, that 
the modifier characters as a part of graphemes might cause some discrepancies 
in the text indices etc. 

A feature, where i personally (currently) can't find a usecase is \G and 
continuing matches (but no doubt, there would be some some cases for this).

regards
   vbr

--

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



[issue1180002] locale.format question

2010-02-22 Thread R. David Murray

R. David Murray  added the comment:

The last comment set this issue to 'remind' in case someone wanted to fix it in 
the future...it's pretty much fixed now.  format_string was added in 2.5, and 
in 2.6 format only accepts a string containing just a format code.

--
nosy: +r.david.murray
resolution: remind -> fixed

___
Python tracker 

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



[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I am reclassifying this as a crash because os.getgroups() crashes the 
interpreter when python is running as root on an unmodified system:

$ sudo ./python.exe  -c "import os; os.getgroups()"
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument

This is also a regression apparently introduced in r63955.

--
type: behavior -> crash
versions: +Python 2.6, Python 3.1, Python 3.2

___
Python tracker 

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



[issue7796] No way to find out if an object is an instance of a namedtuple

2010-02-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Discussed this with GvR.
Here's a recap:

For 2.6 and 3.1 which are already released, check for the _fields attribute.  
This is a guaranteed part of the API is not fragile.  For the C structures, 
check for the n_fields attribute.

In the future, the C API needs to grow to match the namedtuple() API and we 
should add an abstract base class describing the common API.  Then you'll be 
able to write: 
if isinstance(obj, abc_namedtuple).

--

___
Python tracker 

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-02-22 Thread Matthew Barnett

Matthew Barnett  added the comment:

I don't know what happened there. I didn't notice that the zip file was way too 
small. Here's a replacement (still called issue2636-20100222.zip).

Unicode script properties are already included, at least those whose 
definitions at http://www.regular-expressions.info/unicode.html

I haven't notice \X before. I'll have a look at it.

As for \G, .findall performs searches normally, but when using \G it 
effectively performs contiguous matches only, which can be useful when you need 
it!

--
Added file: http://bugs.python.org/file16327/issue2636-20100222.zip

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



[issue7196] Clarify str.split() behavior

2010-02-22 Thread Jack Diederich

Jack Diederich  added the comment:

I suggest this be closed WONTFIX.  The str.split() documentation accurately 
describes str.split() but doesn't happen to do what the OP wanted which was

list(filter(None, '00010001'.split('0')))

Instead split(sep) is the reciprocal of sep.join(), that is
txt == sep.join(txt.split(sep))

--
nosy: +jackdied

___
Python tracker 

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



[issue7946] Convoy effect with I/O bound threads and New GIL

2010-02-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is another patch based on a slightly different approach. Instead of being 
explicitly triggered in I/O methods, priority requests are decided based on the 
computed "interactiveness" of a thread. Interactiveness itself is a simple 
saturated counter (incremented when the GIL is dropped without request, 
decremented when the GIL is dropped after a request).

Benchmark numbers are basically the same as with gilprio2.patch.

--
Added file: http://bugs.python.org/file16328/gilinter.patch

___
Python tracker 

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



[issue1517495] memory leak threading or socketserver module

2010-02-22 Thread A.M. Kuchling

A.M. Kuchling  added the comment:

I can no longer confirm this bug, either; trying the scripts with the current 
trunk doesn't seem to leak.  Backing out Jeffrey's r61011 didn't bring the 
problem back, so I'll just conclude that the problem has gotten fixed along the 
way somehow.

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

___
Python tracker 

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



[issue4617] SyntaxError when free variable name is also an exception target

2010-02-22 Thread Guido van Rossum

Guido van Rossum  added the comment:

All examples so far (*) have to do with our inability to have properly nested 
blocks. If we did, I'd make the except clause a block, and I'd issue a syntax 
warning or error if a nested block shadowed a variable referenced outside it. 
Ditto for generator expressions and comprehensions.

As long as we don't have nested blocks, I think it's okay to see the limitation 
on (implicit or explicit) "del" of a cell variable as a compiler deficiency and 
fix that deficiency.

__
(*) However there's also this example:

>>> def f():
...  try: 1/0
...  except Exception as a:
...   def g(): return a
...   return g
... 
SyntaxError: can not delete variable 'a' referenced in nested scope
>>>

--

___
Python tracker 

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



[issue6886] cgi.py runs python, not python3

2010-02-22 Thread Jack Diederich

Jack Diederich  added the comment:

+0 I'm ambivalent.  The script uses a reasonable default and pyhton3 is a 
reasonable default for the 3k branch.  That said most people will have to edit 
the file anyway to use it: I had to chmod a+x the file and change the bang path 
to /usr/bin/python to get it to work on my machine.

--
nosy: +jackdied

___
Python tracker 

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



[issue7996] concurrency problem in regrtest -jX

2010-02-22 Thread Antoine Pitrou

New submission from Antoine Pitrou :

While testing GIL changes I ran against an interesting bug in regrtest when run 
with -j. It turns out that we can't consume a generator from two 
threads simultaneously.


Exception in thread Thread-8:
Traceback (most recent call last):
  File "/home/antoine/py3k/gilprio/Lib/threading.py", line 521, in 
_bootstrap_inner
self.run()
  File "/home/antoine/py3k/gilprio/Lib/threading.py", line 474, in run
self._target(*self._args, **self._kwargs)
  File "/home/antoine/py3k/gilprio/Lib/test/regrtest.py", line 523, in work
test, args_tuple = next(pending)
ValueError: generator already executing

--
components: Tests
messages: 99879
nosy: pitrou, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: concurrency problem in regrtest -jX
type: behavior
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



[issue4617] SyntaxError when free variable name is also an exception target

2010-02-22 Thread Jeremy Hylton

Jeremy Hylton  added the comment:

On Mon, Feb 22, 2010 at 6:10 PM, Guido van Rossum
 wrote:
>
> Guido van Rossum  added the comment:
>
> All examples so far (*) have to do with our inability to have properly nested 
> blocks. If we did, I'd make the except clause a block, and I'd issue a syntax 
> warning or error if a nested block shadowed a variable referenced outside it. 
> Ditto for generator expressions and comprehensions.

There's no reason we couldn't revise the language spec to explain that
except clauses and comprehensions are block statements, i.e.
statements that introduce a new block.  For the except case, there
would be some weird effects.

y = 10
try:
  ...
except SomeError as err:
  y = 12
print y  # prints 10

In the example above, y would be a local variable in the scope of the
except handler that shadows the local variable in the block that
contains the try/except.  It might be confusing that you couldn't
assign to a local variable in the except handler without using a
nonlocal statement.

> As long as we don't have nested blocks, I think it's okay to see the 
> limitation on (implicit or explicit) "del" of a cell variable as a compiler 
> deficiency and fix that deficiency.

The general request here is to remove all the SyntaxErrors about
deleting cell variables, right?  Instead, you'd get a NameError at
runtime saying that the variable is currently undefined.  You'd want
that change regardless of whether we change the language as described
above.

hoping-for-some-bdfl-pronouncements-ly y'rs,
Jeremy

> __
> (*) However there's also this example:
>
 def f():
> ...  try: 1/0
> ...  except Exception as a:
> ...   def g(): return a
> ...   return g
> ...
> SyntaxError: can not delete variable 'a' referenced in nested scope

>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue7196] Clarify str.split() behavior

2010-02-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Agreed.  Thanks Jack.

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



  1   2   >