[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-05 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks.

--
status: open -> closed

___
Python tracker 

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



[issue4683] urllib2.HTTPDigestAuthHandler fails on third hostname?

2010-04-05 Thread Georg Brandl

Georg Brandl  added the comment:

Ping?

--
nosy: +georg.brandl

___
Python tracker 

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



[issue4683] urllib2.HTTPDigestAuthHandler fails on third hostname?

2010-04-05 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Okay, This vaguely got out of my mind. Shall come with the tests for 
HTTPAuthDigest.

--

___
Python tracker 

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



[issue5198] Strange DeprecationWarning behaviour in module struct

2010-04-05 Thread Georg Brandl

Georg Brandl  added the comment:

Both examples now give consistent behavior independent of byteorder in trunk: 
packing floats with "H" works, packing bytes out of range with "B" raises.

Closing as "out of date".

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



[issue8313] message in unittest tracebacks

2010-04-05 Thread Michael Foord

New submission from Michael Foord :

>>> import unittest
>>> class Foo(unittest.TestCase):
...   def test_fffd(self): self.assertEqual(u'\ufffd', u'\ufffd\ufffd')
...
>>> unittest.main(exit=False)
F
==
FAIL: test_fffd (__main__.Foo)
--
Traceback (most recent call last):
  File "", line 2, in test_fffd
AssertionError: 

--
Ran 1 test in 0.001s


The problem with creating unicode tracebacks is that they could fail when being 
output on terminals not capable of showing the full range of unicode characters 
(the default terminal on Windows is CP1252).

This can already happen with Unicode messages that aren't part of the traceback.

Detecting the 'unprintable' message before calling into traceback and replacing 
it with the repr of the unicode is one possibility.

--
assignee: michael.foord
components: Library (Lib)
messages: 102368
nosy: ezio.melotti, michael.foord
severity: normal
status: open
title:  message in unittest tracebacks
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



[issue6869] Embedded python crashed on 4th run, if "ctypes" is used

2010-04-05 Thread nik

nik  added the comment:

I can confirm that the patch fix this issue. I adapted the patch (variable 
names changed):

5523a5524
> Py_INCREF(&Struct_Type);
5529a5531
> Py_INCREF(&Union_Type);
5535a5538
> Py_INCREF(&Pointer_Type);
5541a5545
> Py_INCREF(&Array_Type);
5547a5552
> Py_INCREF(&Simple_Type);
5553a5559
> Py_INCREF(&CFuncPtr_Type); 

Platform: Linux (kubuntu 9.10 x64)
Python: 2.6.4-0ubuntu3

--
nosy: +nik.l...@gmail.com

___
Python tracker 

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



[issue7721] Code in xrange documentation does not work

2010-04-05 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in release26-maint r79796.

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



[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2010-04-05 Thread Georg Brandl

Changes by Georg Brandl :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue8314] test_ctypes fails in test_ulonglong on sparc buildbots

2010-04-05 Thread R. David Murray

New submission from R. David Murray :

==
FAIL: test_ulonglong (ctypes.test.test_callbacks.Callbacks)
--
Traceback (most recent call last):
  File 
"/home2/buildbot/slave/trunk.loewis-sun/build/Lib/ctypes/test/test_callbacks.py",
 line 68, in test_ulonglong
self.check_type(c_ulonglong, 42)
  File 
"/home2/buildbot/slave/trunk.loewis-sun/build/Lib/ctypes/test/test_callbacks.py",
 line 31, in check_type
self.assertEqual(result, arg)
AssertionError: 0L != 42

--
components: Tests
keywords: buildbot
messages: 102371
nosy: r.david.murray, theller
priority: normal
severity: normal
stage: needs patch
status: open
title: test_ctypes fails in test_ulonglong on sparc buildbots
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue8314] test_ctypes fails in test_ulonglong on sparc buildbots

2010-04-05 Thread R. David Murray

R. David Murray  added the comment:

The ubuntu and debian sparc buildbots show the same failure, none of the other 
buildbots do.

--

___
Python tracker 

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



[issue8314] test_ctypes fails in test_ulonglong on sparc buildbots

2010-04-05 Thread Florent Xicluna

Florent Xicluna  added the comment:

This bug is already reported here:
http://bugs.python.org/issue8142#msg101134

--
nosy: +flox

___
Python tracker 

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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-05 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
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-04-05 Thread Thouis (Ray) Jones

Changes by Thouis (Ray) Jones :


--
nosy: +thouis

___
Python tracker 

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



[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong

Irmen de Jong  added the comment:

Ok I think I've got the code and doc changes ready. I added a recvall and a 
recvall_into method to the socket module. Any partially received data in case 
of errors is returned to the application as part of the args for a new 
exception, socket.partialdataerror.

Still need to work on some unit tests for these new methods.

--

___
Python tracker 

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



[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong

Changes by Irmen de Jong :


Removed file: http://bugs.python.org/file6439/patch.txt

___
Python tracker 

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



[issue1220212] os.kill on windows

2010-04-05 Thread anatoly techtonik

anatoly techtonik  added the comment:

FAQ should be updated 
http://www.python.org/doc/faq/windows/#how-do-i-emulate-os-kill-in-windows

--
nosy: +techtonik

___
Python tracker 

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



[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong

Changes by Irmen de Jong :


Added file: http://bugs.python.org/file16762/socketmodulepatch.txt

___
Python tracker 

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



[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong

Changes by Irmen de Jong :


Added file: http://bugs.python.org/file16763/libpatch.txt

___
Python tracker 

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



[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong

Changes by Irmen de Jong :


Added file: http://bugs.python.org/file16764/docpatch.txt

___
Python tracker 

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



[issue7964] "-m pdb" SyntaxError for "\r\n" formatted py files

2010-04-05 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

Is there a reason this didn't get reviewed for the 3.1.2 release? What steps 
need to be taken to see that it makes it into a 3.1.3 release?

--

___
Python tracker 

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



[issue8315] ./python -m unittest test.test_importlib doesn't work

2010-04-05 Thread Barry A. Warsaw

New submission from Barry A. Warsaw :

Actually, ./python -m unittest test.test_email doesn't work either and those 
are two cases where the Lib/test module just forwards to the package's own test 
suite, so maybe that's the problem.

--
assignee: michael.foord
components: Library (Lib)
messages: 102377
nosy: barry, michael.foord
severity: normal
status: open
title: ./python -m unittest test.test_importlib doesn't work
versions: Python 3.2

___
Python tracker 

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



[issue5103] ssl.SSLSocket timeout not working correctly when remote end is hanging

2010-04-05 Thread David Andrzejewski

Changes by David Andrzejewski :


--
nosy: +dandrzejewski

___
Python tracker 

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



[issue7583] doctest should normalize tabs when comparing output

2010-04-05 Thread anatoly techtonik

anatoly techtonik  added the comment:

Could you be more specific about why users should not be allowed to use tabs in 
docstrings. An example use case/user story would help me a lot.

I've made a precondition to check tab existence before expanding tabs for 
performance reasons.

The indentation of output prior to tab expansion is necessary to correctly 
format output and show result when test fails.

I agree to close this bug as "won't fix" if we can clear the confusion by 
describing the situation in more detail and providing examples.

--

___
Python tracker 

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



[issue1220212] os.kill on windows

2010-04-05 Thread Brian Curtin

Brian Curtin  added the comment:

How about something like this patch?

--
Added file: http://bugs.python.org/file16765/faq_update.diff

___
Python tracker 

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



[issue4256] optparse: provide a simple way to get a programmatically useful list of options

2010-04-05 Thread Andy Buckley

Andy Buckley  added the comment:

Thanks for the pointers to both of these... I wasn't aware of either. I see 
argparse has been recently approved for Python stdlib inclusion, too: 
http://www.python.org/dev/peps/pep-0389/ Congratulations!

As far as I can tell, genzshcomp is parsing the output of the help command to 
reverse-engineer what the allowed flags should be. Assuming that only one space 
occurs between the arg and its metavar, this should work 99% or the time... I'm 
not sure if there is any attempt to be clever when the formatting is ambiguous. 
But given that the opt parser already contains the structured information, life 
can be made easier by writing out a more readily parseable format.

Here's an example bash parser function and its usage, for a further-simplified 
form of the above format where each arg (long or short) gets a line of its own 
and the arguments are indicated by a separate word as in the current output:

Example input:
$ foo --help-options
#OPTPARSE_FORMAT 0
--version
-h
--help
-r REGEXP
--regexp REGEXP
-s N
--start N
-e M
--end M
-f FILE
--file FILE

and the parser/completion functions:

function _optparse_getargs() {
local opts cur prev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"

PREVIFS=$IFS
IFS=$'\n'
for line in `$1 --help-options | egrep '^-'`; do
opt=`echo $line | sed 's/^\(-[^ ]\+\).*$/\1/'`
argeq=`echo $line | sed 's/^--[^ ]\+ \([A-Za-z0-9]*\)$/=/'`
if [[ $argeq != "=" ]]; then argeq=""; fi
opts="$opts $opt$argeq";
done
IFS=$PREVIFS
unset PREVIFS
opts=`echo $opts | sed -e 's/^ *//' -e 's/ *$//'`

if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
if test -n "$COMPREPLY"; then
return 0
fi
fi

return 0
}


function _foo() {
_optparse_getargs foo
return 0
}

complete -F _foo -o default foo

--

___
Python tracker 

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



[issue5103] ssl.SSLSocket timeout not working correctly when remote end is hanging

2010-04-05 Thread David Andrzejewski

David Andrzejewski  added the comment:

I believe this issue may be responsible for causing a very long hang in my 
application.  Here's an example of it hanging for 30 minutes.  Yes - minutes. 

[UI] 2010-04-03 11:33:34,209 DEBUG: Communicating with GUI on 127.0.0.1:9095 - 
timeout 10 seconds
[UI] 2010-04-03 12:03:16,118 ERROR: Error in send_gui_command()!
Traceback (most recent call last):
  File "javaui.pyc", line 72, in send_message
  File "client.pyc", line 506, in send_message_with_params
  File "client.pyc", line 230, in call
  File "client.pyc", line 94, in do_request
  File "httplib.pyc", line 1100, in connect
  File "ssl.pyc", line 350, in wrap_socket
  File "ssl.pyc", line 118, in __init__
  File "ssl.pyc", line 293, in do_handshake
error: [Errno 10053] An established connection was aborted by the software in 
your host machine

This is Python 2.6.4 on Windows.  (This particular time it happened on a 32-bit 
Server 2008 system). 

My guess is that after that 30 minute time period, Windows is seeing that the 
connection is hung and it's just aborting it?

--

___
Python tracker 

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



[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

Just a couple comments:

  * If MSG_WAITALL is defined and a signal interrupts recv, will a string 
shorter than requested will be returned by sock_recvall?
  * Since MSG_WAITALL is already exposed to Python (when the underlying 
platform provides it), I wonder if this could all be implemented more simply in 
pure Python.  Can you elaborate on the motivation to use C?

Someone should do another review when there are unit tests.

--
nosy: +exarkun

___
Python tracker 

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



[issue8316] test_gdb is susceptible to tty width settings

2010-04-05 Thread Dave Malcolm

New submission from Dave Malcolm :

test_gdb's get_gdb_repr carves up a gdb backtrace to try to extract how gdb 
representated the data.

When connected to a tty, gdb will insert additional newlines and spaces based 
on the width of the tty (internally it has a wrap_here() function to do this), 
so the test turned out to be somewhat susceptible to whitespace and tty 
configuration.

I'm attaching a patch against trunk which I believe fixes this.  I've tested it 
with various tty widths (from 5 columns wide through to 235 columns wide), and 
redirecting to a file, and all tests pass.

[Seen on buildbot on this run:
http://www.python.org/dev/buildbot/builders/sparc%20Ubuntu%20trunk/builds/37/steps/test/logs/stdio
and I believe this was the cause of all of four of the five failures there.

The remaining one "test_corrupt_tp_name" seems to be a different issue]

--
assignee: r.david.murray
files: fix-test_gdb-whitespace-issues.txt
keywords: buildbot
messages: 102383
nosy: dmalcolm, r.david.murray
severity: normal
stage: patch review
status: open
title: test_gdb is susceptible to tty width settings
versions: Python 2.7
Added file: http://bugs.python.org/file16766/fix-test_gdb-whitespace-issues.txt

___
Python tracker 

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



[issue8316] test_gdb is susceptible to tty width settings

2010-04-05 Thread R. David Murray

R. David Murray  added the comment:

Committed in r79803.  I changed the assert_ to an if not m/fail, since assert_ 
is deprecated and I think the if makes it clearer than the assert_ what it is 
that is being checked.

--
components: +Tests
priority:  -> normal
resolution:  -> fixed
stage: patch review -> 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



[issue1220212] os.kill on windows

2010-04-05 Thread anatoly techtonik

anatoly techtonik  added the comment:

Seems good to me, even though I'd rewrite some parts like this:

- Prior to Python 2.7 and 3.2, to terminate a process, you can use ctypes::
+ Prior to Python 2.7 and 3.2, you can use linksomehow:`ctypes` to
terminate a process::

...

In newer Python versions :func:`os.kill` works on Windows with the
additional feature of being able to send CTRL+C and CTRL+BREAK to
console subprocesses that understand these signals.

...
-- 
anatoly t.

On Mon, Apr 5, 2010 at 6:38 PM, Brian Curtin  wrote:
>
> Brian Curtin  added the comment:
>
> How about something like this patch?
>
> --
> Added file: http://bugs.python.org/file16765/faq_update.diff
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue8317] test_tarfile fails intermittently on Windows

2010-04-05 Thread Jason R. Coombs

New submission from Jason R. Coombs :

Using Windows 7 32-bit, and /branches/p...@79802.

When I run the test_tarfile from the regrtest script, often the first run will 
succeed and subsequent runs will fail (though sometimes a first run will fail 
and rarely a subsequent run will succeed). It appears to be a timing issue. The 
output from a failed attempt is included below.

Passing -v to the regrtest script prevents the failure from occurring. Also 
disabling test_extract_hardlink test prevents the failure from occurring in 
most cases. I found that enabling pdb and setting a trace in 
test_extract_hardlink prevented the error from occurring. I also attempted 
closing the tarfile explicitly (including in a finally block) and putting 
time.sleep(1) at the beginning or end of that test, but that seemed to have no 
effect.

I am beginning to suspect that this problem is related to an indexer or malware 
scanner on the system checking the file after it's created, causing it to be 
locked at the time it's scheduled to be deleted.

PS C:\Users\jaraco\projects\public\python-core-3.x-svn> pcbuild\python 
.\lib\test\regrtest.py test_tarfile
test_tarfile
test test_tarfile crashed -- : [Error 32] The process 
cannot access the file because it is being used by another process: 
'C:\\users\\jaraco\\projects\\public\\python-core-3.x-svn\\build\\test_python_519...@test_5196_tmp\\testtar.tar.gz'
'test_tarfile' left behind directory '@test_5196_tmp' and it couldn't be 
removed: [Error 32] The process cannot access the file because it is being used 
by another process: '@test_5196_tmp\\testtar.tar.gz'
1 test failed:
test_tarfile
Traceback (most recent call last):
  File 
"C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\test\support.py", line 
400, in temp_cwd
yield os.getcwd()
  File ".\lib\test\regrtest.py", line 1473, in 
main()
  File ".\lib\test\regrtest.py", line 687, in main
sys.exit(len(bad) > 0 or interrupted)
SystemExit: True

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".\lib\test\regrtest.py", line 1473, in 
main()
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\contextlib.py", 
line 35, in __exit__
self.gen.throw(type, value, traceback)
  File 
"C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\test\support.py", line 
404, in temp_cwd
rmtree(name)
  File 
"C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\test\support.py", line 
184, in rmtree
shutil.rmtree(path)
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\shutil.py", 
line 251, in rmtree
rmtree(fullname, ignore_errors, onerror)
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\shutil.py", 
line 256, in rmtree
onerror(os.remove, fullname, sys.exc_info())
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\shutil.py", 
line 254, in rmtree
os.remove(fullname)
WindowsError: [Error 32] The process cannot access the file because it is being 
used by another process: 
'C:\\users\\jaraco\\projects\\public\\python-core-3.x-svn\\build\\test_python_519...@test_5196_tmp\\testtar.tar.gz'

--
components: Tests
messages: 102386
nosy: jaraco
severity: normal
status: open
title: test_tarfile fails intermittently on Windows
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



[issue1578269] Add os.symlink() and os.path.islink() support for Windows

2010-04-05 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

My initial troubleshooting indicated to me that the intermittent test_tarfile 
problem exists independent of the symlink patch, so it was not relevant to this 
issue.

I've tried to do some more thorough troubleshooting, and this continues to be 
my finding, and somewhat consistent with Brian's finding.

I've created issue8317 to track the trouble with test_tarfile.

--

___
Python tracker 

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



[issue8317] test_tarfile fails intermittently on Windows

2010-04-05 Thread Brian Curtin

Brian Curtin  added the comment:

So far I've only seen this with os.symlink from #1578269 applied, but I will 
try more runs on a vanilla py3k to see if I can catch it.

--
components: +Windows
nosy: +brian.curtin
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue8317] test_tarfile fails intermittently on Windows

2010-04-05 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

> To be clear, all of my tests were without any patches applied.

--

___
Python tracker 

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



[issue8318] Deprecation of multifile inappropriate or incomplete

2010-04-05 Thread Tres Seaver

New submission from Tres Seaver :

Import of the multifile module emits a DeprecationWarning, but the
warning is either incomplete:

- The documentation[1] states that the 'email' module is to be
  preferred, but doesn't describe what APIs should be used from that
  module.

- In fact, the 'email' module doesn't appear to provide an equivalent
  API to the 'multifile' module.

or perhaps inappropriate, as not all handling of 'multipart' MIME is
email related (e.g., processing HTTP form POSTs which include file uploads).

At a minimum, the docs for 'multifile' should include examples showing
the "preferred" way to implement its own native examples using
the'email' module's APIs.


[1] http://docs.python.org/library/multifile.html

--
components: Library (Lib)
messages: 102390
nosy: barry, tseaver
severity: normal
status: open
title: Deprecation of multifile inappropriate or incomplete
versions: Python 2.5, Python 2.6, Python 2.7

___
Python tracker 

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



[issue1103213] Adding the missing socket.recvall() method

2010-04-05 Thread Irmen de Jong

Irmen de Jong  added the comment:

Currently if MSG_WAITALL is defined, recvall() just calls recv() internally 
with the extra flag. Maybe that isn't the smartest thing to do because it 
duplicates recv's behavior on errors. Which is: release the data and raise an 
error.
Would it be nicer to have recvall() release the data and raise an error, or to 
let it return the partial data? Either way, I think the behavior should be the 
same regardless of MSG_WAITALL being available. This is not yet the case.

Why C: this started out by making the (very) old patch that I once wrote for 
socketmodule.c up to date with the current codebase, and taking Martin's 
comments into account.
The old patch was small and straightforward. Unfortunately the new one turned 
out bigger and more complex than I thought. For instance I'm not particularly 
happy with the way recvall returns the partial data on fail. It uses a new 
exception for that but the code has some trickery to replace the socket.error 
exception that is initially raised. I'm not sure if my code is the right way to 
do this, it needs some review. I do think that putting it into the exception 
object is the only safe way of returning it to the application, unless the 
semantics on error are changed as mentioned above. Maybe it could be made 
simpler then.
In any case, it probably is a good idea to see if a pure python solution 
(perhaps just some additions to Lib/socket.py?) would be better. Will put some 
effort into this.

--

___
Python tracker 

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains nor data.

2010-04-05 Thread Winfried Plappert

New submission from Winfried Plappert :

When parsing HTML and having a string along the lines of , a call to 
handle_data is not issued between handle_starttag and handle_endtag, but 
afterwards. The problem is in HTMLparser.goahead, where the position i and j 
are calculated. The code reads
if i < j: self.handle_data(rawdata[i:j]) but it should be
if i <= j: self.handle_data(rawdata[i:j])

If there is data between  and , everything works fine.

I just checked the trunk of 2.6, this occurs in line 142 of Lib/HTMLParser.py. 
The size of HTMLParser.py is 13407 bytes, and is dated 'Feb 26 19:25'.

--
components: Library (Lib)
messages: 102392
nosy: wplappert
severity: normal
status: open
title: HTMLparser does not handle call to handle_data when a tag contains nor 
data.
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



[issue8320] docs on socket.recv_into doesn't mention the return value

2010-04-05 Thread Irmen de Jong

New submission from Irmen de Jong :

Doc/library/socket.rst doesn't mention the return value for recv_into. Adding a 
simple "Returns the number of bytes received." should fix this. 
(note that recvfrom_into does mention its return value)

--
assignee: georg.brandl
components: Documentation
keywords: easy
messages: 102393
nosy: georg.brandl, irmen
severity: normal
status: open
title: docs on socket.recv_into doesn't mention the return value
type: feature request
versions: Python 2.7, Python 3.1

___
Python tracker 

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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-05 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Yes, it's the _sslobj.shutdow() call:

  File "test_ftplib.py", line 332, in handle_close
self.socket = self.socket.unwrap()
  File "/usr/local/lib/python2.7/ssl.py", line 258, in unwrap
s = self._sslobj.shutdown()
error: [Errno 0] Error

Since it's not clear to me where exactly this comes from, whether it's from the 
Python C binding or OpenSSL itself, I tried to put some debugging printf() 
calls in Modules/_ssl.c, but it seems that  after installing OpenSSL 0.9.8m I'm 
no longer able to compile Python 2.7 from sorces.
This is what I get when I run ./configure; make:

gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/include 
-I/home/giampaolo/svn/python-2.7/Include -I/home/giampaolo/svn/python-2.7 -c 
/home/giampaolo/svn/python-2.7/Modules/_ssl.c -o 
build/temp.linux-i686-2.7/home/giampaolo/svn/python-2.7/Modules/_ssl.o
gcc -pthread -shared 
build/temp.linux-i686-2.7/home/giampaolo/svn/python-2.7/Modules/_ssl.o 
-L/usr/local/lib -lssl -lcrypto -o build/lib.linux-i686-2.7/_ssl.so
*** WARNING: renaming "_ssl" since importing it failed: 
build/lib.linux-i686-2.7/_ssl.so: undefined symbol: inflate

--
nosy:  -jcea
versions: +Python 2.6, Python 3.1

___
Python tracker 

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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-05 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +jcea

___
Python tracker 

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains no data.

2010-04-05 Thread Winfried Plappert

Changes by Winfried Plappert :


--
title: HTMLparser does not handle call to handle_data when a tag contains nor 
data. -> HTMLparser does not handle call to handle_data when a tag contains no 
data.

___
Python tracker 

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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Since it's not clear to me where exactly this comes from, whether it's
> from the Python C binding or OpenSSL itself, I tried to put some
> debugging printf() calls in Modules/_ssl.c, but it seems that  after
> installing OpenSSL 0.9.8m I'm no longer able to compile Python 2.7
> from sorces.

Have you tried `make distclean`?

--

___
Python tracker 

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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-05 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

No I haven't, but I tried just now and I get the same error.

--

___
Python tracker 

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



[issue8318] Deprecation of multifile inappropriate or incomplete

2010-04-05 Thread R. David Murray

R. David Murray  added the comment:

It's not inappropriate, since the facilities *in* the email package are 
supposed to support other MIME use cases (such as HTML).  That it isn't clear 
how to convert is certainly a doc bug at the very least.  However, I wouldn't 
be entirely surprised to find that there are things you can do with multifile 
that you can't (yet) do with the facilities from the email package.  If so, 
these will most likely be considered bugs in the email package.

(Now, whether or not 'email' is an appropriate package name for this bundle of 
facilities is a different question, and not one I'm going to address :)

--
nosy: +r.david.murray
priority:  -> normal
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains no data.

2010-04-05 Thread R. David Murray

Changes by R. David Murray :


--
keywords: +easy
nosy: +orsenthil
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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> No I haven't, but I tried just now and I get the same error.

I think "inflate" is a function exported by the zlib. Perhaps you can
add "-lz" to the linking flags.
(Googling hints that OpenSSL can depend on the zlib if compression is
enabled)

--

___
Python tracker 

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



[issue8318] Deprecation of multifile inappropriate or incomplete

2010-04-05 Thread Tres Seaver

Tres Seaver  added the comment:

> [T]here [may be] things you can do with multifile that you can't (yet)
> do with the facilities from the email package.  If so, these will most > 
> likely be considered bugs in the email package.

Surely the presence of such a feature would make the deprecation premature.

--

___
Python tracker 

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



[issue5479] Add an easy way to provide total ordering now that __cmp__ is deprecated/gone

2010-04-05 Thread Éric Araujo

Éric Araujo  added the comment:

Hello

Small documentation question: Does the expression “total ordering” have 
established usage in maths or computer science? Its meaning is not obvious to 
the non-maths person that I am.

Regards

--

___
Python tracker 

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



[issue5479] Add an easy way to provide total ordering now that __cmp__ is deprecated/gone

2010-04-05 Thread Mark Dickinson

Mark Dickinson  added the comment:

Yes, it's a standard mathematics term.

http://en.wikipedia.org/wiki/Total_order

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue5479] Add an easy way to provide total ordering now that __cmp__ is deprecated/gone

2010-04-05 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

http://en.wikipedia.org/wiki/Total_order

--

___
Python tracker 

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



[issue5479] Add an easy way to provide total ordering now that __cmp__ is deprecated/gone

2010-04-05 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the link. Please include it in the future doc if you judge it useful 
for a large number of users.

I’m still wondering if “total_ordering” is the best name for a decorator that 
fills the blanks to provide total ordering.

Regards

--

___
Python tracker 

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



[issue8318] Deprecation of multifile inappropriate or incomplete

2010-04-05 Thread R. David Murray

R. David Murray  added the comment:

Depending on the feature, I might agree with that, but I wasn't involved in 
that decision.

If email only supports something structured with proper MIME headers and 
multifile is more general (which I *think* is the case, but I haven't actually 
tried to run any tests to confirm it), does that mean we should have kept 
multifile in py3?  I'm inclined to say no.  Should we make email support the 
more general case?  I'll at least keep it in the back of my mind as I/we work 
on email6.

Multifile is still there in 2.7, at the moment.

I presume you have a use case for the multifile module.  Could you do me a 
favor and add that use case the set of use cases in the email wiki?
(http://wiki.python.org/moin/Email%20SIG/UseCases).  It would be a good idea to 
mention there that email is supposed to supersede multifile.

--

___
Python tracker 

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



[issue8287] python-gdb.py triggers compile errors on FreeBSD and Solaris

2010-04-05 Thread R. David Murray

R. David Murray  added the comment:

The buildbots seem happy.

--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This patch gives access to the OpenSSL version the _ssl module is linked 
against, through three attributes: one gives the raw integer, another the 
decoded 5-tuple of ints, the last one the version string as returned by OpenSSL.

--
components: Library (Lib)
files: sslversion.patch
keywords: patch
messages: 102406
nosy: benjamin.peterson, flox, giampaolo.rodola, janssen, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: Give access to openssl version number
type: feature request
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file16767/sslversion.patch

___
Python tracker 

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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-05 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

As suggested in this thread:
http://mirt.net/pipermail/stunnel-users/2005-July/000661.html
...I made the following change to the Makefile:

- LIBS=   -lpthread -ldl  -lutil
+ LIBS=   -lpthread -ldl  -lutil -lz

That made the error change as follows:

running build_ext

INFO: Can't locate Tcl/Tk libs and/or headers

Python build finished, but the necessary bits to build these modules were not 
found:
_bsddb _curses_curses_panel   
_sqlite3   _tkinter   bsddb185
bz2dbmgdbm
readline   sunaudiodev

--

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

(note: tested with OpenSSL 0.9.8k and 1.0.0)

--

___
Python tracker 

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



[issue8322] test_ssl failures with OpenSSL 1.0.0

2010-04-05 Thread Antoine Pitrou

New submission from Antoine Pitrou :

When I compile and link against a local build of OpenSSL 1.0.0 (vanilla), I get 
the following errors in test_ssl:

==
ERROR: testProtocolSSL2 (test.test_ssl.ThreadedTests)
--
Traceback (most recent call last):
  File "/home/antoine/cpython/newssl/Lib/test/test_ssl.py", line 869, in 
testProtocolSSL2
tryProtocolCombo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, True)
  File "/home/antoine/cpython/newssl/Lib/test/test_ssl.py", line 736, in 
tryProtocolCombo
CERTFILE, CERTFILE, client_protocol, chatty=False)
  File "/home/antoine/cpython/newssl/Lib/test/test_ssl.py", line 688, in 
serverParamsTest
raise test_support.TestFailed("Unexpected exception:  " + str(x))
TestFailed: Unexpected exception:  [Errno 104] Connection reset by peer

==
ERROR: testProtocolSSL3 (test.test_ssl.ThreadedTests)
--
Traceback (most recent call last):
  File "/home/antoine/cpython/newssl/Lib/test/test_ssl.py", line 903, in 
testProtocolSSL3
tryProtocolCombo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False)
  File "/home/antoine/cpython/newssl/Lib/test/test_ssl.py", line 745, in 
tryProtocolCombo
ssl.get_protocol_name(server_protocol)))
TestFailed: Client protocol SSLv23 succeeded with server protocol SSLv3!

==
ERROR: testProtocolTLS1 (test.test_ssl.ThreadedTests)
--
Traceback (most recent call last):
  File "/home/antoine/cpython/newssl/Lib/test/test_ssl.py", line 914, in 
testProtocolTLS1
tryProtocolCombo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv23, False)
  File "/home/antoine/cpython/newssl/Lib/test/test_ssl.py", line 745, in 
tryProtocolCombo
ssl.get_protocol_name(server_protocol)))
TestFailed: Client protocol SSLv23 succeeded with server protocol TLSv1!

--
components: Library (Lib)
messages: 102409
nosy: flox, giampaolo.rodola, janssen, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: test_ssl failures with OpenSSL 1.0.0
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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've tried to build against OpenSSL 1.0.0, and I get further failures in 
test_ssl. Since I don't know whether they are related, I've created a separate 
issue for them: issue8322

--

___
Python tracker 

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



[issue8321] Give access to openssl version number

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

Martin v. Löwis  added the comment:

Can you please add documentation as well?

--
nosy: +loewis

___
Python tracker 

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



[issue5479] Add an easy way to provide total ordering now that __cmp__ is deprecated/gone

2010-04-05 Thread David W. Lambert

David W. Lambert  added the comment:

http://en.wikipedia.org/wiki/Total_order

For pair of items from a set,  (that's the total)
if  a <= b  and  b <= c  then  a <= c  (part of the order)
if  a <= b  and  b <= a  then  a compares the same as b, a == b, (the
other part of the order)

On Mon, 2010-04-05 at 19:46 +, Éric Araujo wrote:
> Éric Araujo  added the comment:
> 
> Hello
> 
> Small documentation question: Does the expression “total ordering” have 
> established usage in maths or computer science? Its meaning is not obvious to 
> the non-maths person that I am.
> 
> Regards
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file16767/sslversion.patch

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

New patch with doc.

--
Added file: http://bugs.python.org/file16768/sslversion.patch

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file16768/sslversion.patch

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file16769/sslversion.patch

___
Python tracker 

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains no data.

2010-04-05 Thread Winfried Plappert

Winfried Plappert  added the comment:

The same code can be found in the 3.1 distribution.

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I was about to open a request for this.
Thanks.

--

___
Python tracker 

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



[issue8299] Improve GIL in 2.7

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

Kristján Valur Jónsson  added the comment:

Sorry, what I meant with the "original problem" was the phenomenon observed by 
Antoine (IIRC) that the same CPU thread tends to hog the gil, even when 
releaseing it in ceval.c.
What I have been looking at up to now is chiefly IO performance using David's 
iotest.py, and improving the poor performance of IO.  IO will not suffer as 
badly on windows because the IO thread will get its fair slice of execution 
time.  Promted by you, I added this bit of code to the iotest.py:
spins = 0
laststat = 0
def spin():
global spins, laststat
task,args = task_pidigits()
while True:
   r= task(*args)
   spins += 1
   t = time.clock()
   if t-laststat > 1:
   print spins/(t-laststat)
   spins = 0
   laststat = t
   

You are right, however that cpu throughput of multiple cpu bound thread 
suffers.  And in fact, on windows, it appears to suffer the least using the 
LEGACY_GIL implementation.  This is, I conjecture, because there are far fewer 
context switches (because relinqushing the GIL fails).  My conjecture is that 
context switches between threads on two cores are so expensive as to 
dramatically affect performance.  Normal multithreaded programs don't suffer 
from this because the threads are kept busy.  But in our case, we are stopping 
one thread on one core, and starting another on a separate core, and this 
causes latency.

Now, I've improved my patch somewhat.  First off, I fixed some minor errors in 
the PRIORITY_GIL implementation.  But more importantly, I added something 
called FIFOCOND.  It is a condition variable that guarantees the FIFO property. 
 This was prompted by my observation that even Windows' Semaphore doesn't do 
that, rather the windows scheduler may allow the currently executing thread to 
jump ahead in the semaphore queue.  The FIFOCOND condition variable fixes that 
using explicit scheduling, and is intended as a diagnostic tool.
(Antoine, your comment from 13:04 about "roundrobin" inasfar as that we don't 
know anything about the condition variable behaviour.  I was assuming FIFO 
behaviour for the sake of argument, and I thought I´ put it in to the comments 
that we assume a general 'fairness' there.  Put in the FIFOCOND and you will 
have that fairness guaranteed.)


At any rate, I believe my patch provides a useful platform for further 
experimentation.
1) Factoring out the gil as a separate type of lock (which it must be)
2) allowing for different implementation of the GIL
3) shoring up the Condition variable implementation on Windows
4) Providing a FIFOCOND_T type to enforce a particular scheduling order, and 
demonstrating how we can be explicit about thread scheduling.

I have already demonstrated that using the PRIORITY_GIL method fixes the 
problem with IO threads in the presence of CPU bound threads.  Your iotest.py 
script is perfect for this, using 2 worker threads.  On windows, the problem 
with IO wasn't so grave as I have explained (windows by default works as the 
ROUNDROBIN_GIL implementation, not the LEGACY_GIL mode used on pthreads).  The 
PRIORITY_GIL solution is particularly effective with multicore on Windows, but 
it also improves IO throughput if cpu affinity of the server is fixed to one 
CPU, i.e. on singlecore.

I have no fix for CPU bound threads, and I honestly don't think such a fix 
exists, except by causing switches to happen far less frequently, e.g. by 
raising the checkinterval, and so mitigating the problem (which is what the new 
gil in py3k does with its timeout implementation)  But the IO fix for pthreads

To summarise then:
1) The GIL has two problems on multicore machines
 a) performance of CPU threads goes down
 b) performance of IO in the presence of CPU threads is abysmal, but not on 
Windows
2) We can fix problem b) on pthreads with the ROUNDROBIN_GIL implementation.
3) We can improve IO performance in the presence of CPU threads on pthreads and 
Windows using the PRIORITY_GIL implementation, even to become faster than on a 
single core.
4) We cannot do anything about decreased performance of co-operatively 
switching CPU threads on multicore except switching less frequently.   But this 
is quite feasible now with the PRIORITY_GIL implementation because it can 
request an immediate gil drop when IO is ready.  So raising the checkinterval 
will not affect IO performance in a negative way.


Please have a look at the latest patch with IO thread performance in mind.  It 
is currently configured to enable the PRIORITY_GIL implementation without the 
FIFOCOND on windows and pthreads.

--
Added file: http://bugs.python.org/file16770/gil2.patch

___
Python tracker 

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

[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed, with Benjamin's permission, in r79812 (trunk) and r79813 (py3k).

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue8299] Improve GIL in 2.7

2010-04-05 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

>>> import ssl
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.7/ssl.py", line 62, in 
from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, 
OPENSSL_VERSION
ImportError: cannot import name OPENSSL_VERSION_NUMBER



Just in case it's my fault, here's what I've done before importing ssl module:

> svn up 
Updated to revision 79814.
> make distclean
...
> ./configure ; make ; make install
...

--

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> >>> import ssl
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/local/lib/python2.7/ssl.py", line 62, in 
> from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, 
> OPENSSL_VERSION
> ImportError: cannot import name OPENSSL_VERSION_NUMBER

This looks rather unlikely.
Can you type "import _ssl" and then check _ssl.__file__ to see if it's
the one that's just been compiled?
Or did compilation fail?

--

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

The ./configure -> make -> make install process went fine, or at least, I think 
so, as it completed without reporting errors or exiting.
...But maybe I'm doing something wrong as just a little while ago I was 
modifying _ssl.c but wasn't able to see those changes applied.

So I'm gonna ask: when I modify *.c files, do I have to do something else other 
than "./configure; make; make install" in order to see the changes applied?

Anyway, here's what you asked:


r...@ubuntu:/home/giampaolo/svn/python-2.7# python
Python 2.7a4+ (trunk:79814, Apr  5 2010, 23:53:01) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _ssl
>>> _ssl

>>> _ssl.__file__
'/usr/local/lib/python2.7/lib-dynload/_ssl.so'
>>>

--

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> So I'm gonna ask: when I modify *.c files, do I have to do something
> else other than "./configure; make; make install" in order to see the
> changes applied?

No.

If you run the Python binary from the SVN checkout directory (rather
than from an installation), _ssl should come from the build
subdirectory, not from /usr/local/lib.
Example here:

$ pwd
/home/antoine/cpython/newssl
$ ./python -c "import _ssl; print _ssl.__file__"
/home/antoine/cpython/newssl/build/lib.linux-x86_64-2.7/_ssl.so

If _ssl is coming from "/usr/local/lib/...", it means that something
modifies your sys.path so as to put that path before the path to the
just built extension modules. I can't really investigate this point for
you, but try using "python -E" instead.

--

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> So I'm gonna ask: when I modify *.c files, do I have to do something
> else other than "./configure; make; make install" in order to see the
> changes applied?

Oh, sorry, I had overlooked the "make install" bit.
Well then I don't know. But you can run the interpreter without
installing :-) (just "./python")

And check the output of "make" after you have touched Modules/_ssl.c

--

___
Python tracker 

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



[issue8323] multiprocessing.Queue ignores pickle restrictions in .put()

2010-04-05 Thread Robin Schoonover

New submission from Robin Schoonover :

The multiprocessing module's version of the Queue class, which causes objects 
to be pickled for process to process transfer, ignores pickle restrictions when 
objects are added to the queue.  Example code (buffer isn't pickleable):

from multiprocessing import Queue

q = Queue()
q.put(buffer("this is a buffer"))
print(q.get())

It results in an exception, which is expected, but the exception is confusing, 
after the problem has already occurred, and if I were actually using multiple 
processes, not in the process that tried to send an unsendable object:

Traceback (most recent call last):  
 
  File "mppkbuffer.py", line 5, in  
   
print(q.get())
  File "/usr/lib/python2.6/multiprocessing/queues.py", line 91, in get
res = self._recv()
TypeError: buffer() takes at least 1 argument (0 given)

Expected result would be a thrown exception when we attempt to put the object 
into the queue using .put(), NOT when we attempt pull it out of the queue using 
.get(), when it gets unpickled.  Basically, while pickle fails when it tries to 
dump, Queue succeeds the dump (somehow) and fails to load.

I have tested with python 2.6.4 and 2.7a4.  3.1 doesn't appear to have this bug 
(but it does have a different one which I will report later).

--
components: Library (Lib)
messages: 102423
nosy: rschoon
severity: normal
status: open
title: multiprocessing.Queue ignores pickle restrictions in .put()
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue8323] multiprocessing.Queue ignores pickle restrictions in .put()

2010-04-05 Thread Robin Schoonover

Robin Schoonover  added the comment:

Since these sort of buffer objects don't exist in 3.x (so far as I know), I 
came up with a different way to test in 3.x (basically, trying to pickle bound 
or unbound methods).

It turns out that using this method to test it in 2.6 seems to fail where it 
should (in .put()), so if there's some sort of object that isn't pickleable in 
the same way as buffer that exists in 3.x, it should be tested to see if this 
specific problem is actually confined to 2.6 or not.

--

___
Python tracker 

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



[issue8323] multiprocessing.Queue ignores pickle restrictions in .put()

2010-04-05 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee:  -> jnoller
nosy: +jnoller

___
Python tracker 

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



[issue8321] Give access to openssl version number

2010-04-05 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

You were right: make output had an error involving ssl I didn't notice. My bad.

--

___
Python tracker 

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



[issue8324] add a test command

2010-04-05 Thread Tarek Ziadé

New submission from Tarek Ziadé :

Add a test command in distutils, ala setuptools

--
assignee: tarek
components: Distutils2
keywords: gsoc
messages: 102426
nosy: tarek
priority: normal
severity: normal
status: open
title: add a test command
type: feature request

___
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-04-05 Thread Michael Foord

Michael Foord  added the comment:

Should default to test discovery if no arguments are supplied.

Valid arguments: "testrunner", "tests" or "testsuite".
Default testrunner is unittest of course. "tests" / "testsuite" to be of the 
form: "package.module.suitename" (or just "package.module").

--
nosy: +michael.foord
title: add a test command -> add a distutils test command

___
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-04-05 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



[issue7026] test_urllib: unsetting missing 'env' variable

2010-04-05 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Sridhar, I am unable to reproduce this bug in the 3.x (py3k and 
release31-maint) on 64 bit linux. I glance at the code to see any underpinnings 
for this RuntimeError and could not find any at the place the exception 
occurred.

Is it anyway related to other buildout issue you had mentioned? Can you provide 
the steps to reproduce?

--

___
Python tracker 

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



[issue8318] Deprecation of multifile inappropriate or incomplete

2010-04-05 Thread Tres Seaver

Tres Seaver  added the comment:

> Could you do me a favor and add that use case the set of use cases in
> the email wiki?

Done.  The code in Zope which still uses 'multifile' is in the tests
for HTTP 'Range' support:

  
http://svn.zope.org/*checkout*/Zope/trunk/src/OFS/tests/testRanges.py?content-type=text%2Fplain

--

___
Python tracker 

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains no data.

2010-04-05 Thread Winfried Plappert

Winfried Plappert  added the comment:

Here is a test program (shannon_data.py), some sample data 
(Shannon-2010.0.02-extract.html) and two output files (correct.out and 
wrong.out).

--
Added file: http://bugs.python.org/file16771/shannon_data.py

___
Python tracker 

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains no data.

2010-04-05 Thread Winfried Plappert

Changes by Winfried Plappert :


Added file: http://bugs.python.org/file16772/Shannon-2010.0.02-extract.html

___
Python tracker 

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains no data.

2010-04-05 Thread Winfried Plappert

Changes by Winfried Plappert :


Added file: http://bugs.python.org/file16773/correct.out

___
Python tracker 

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains no data.

2010-04-05 Thread Winfried Plappert

Changes by Winfried Plappert :


Added file: http://bugs.python.org/file16774/wrong.out

___
Python tracker 

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



[issue8317] test_tarfile fails intermittently on Windows

2010-04-05 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I've tried reproducing this on a clean system and have thusfar been unable to. 
I'll try to eliminate variables on the failing system and perhaps this will 
elicit some information about what's causing the intermittent failures with the 
symlink patch.

--

___
Python tracker 

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



[issue8262] bad wording in error message attempting to start a Thread twice

2010-04-05 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Yes, the proposed wording is more suitable in the scenarios when the error is 
encountered. Also saw there is already a test (test_start_thread_again), which 
covers this. There is no harm in changing the wording.

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains no data.

2010-04-05 Thread Winfried Plappert

Winfried Plappert  added the comment:

in short the correct output should be
2/4/2010;6.3;11.1;0.8;6.5;;7.8;-5
versus
2/4/2010;6.3;11.1;0.8;6.5;7.8;-5

which implies that one element is missing in the output stream :)

--

___
Python tracker 

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



[issue8262] bad wording in error message attempting to start a Thread twice

2010-04-05 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Fixed in r79817, r79819 and r79821.
Thanks for the report and the patch, Gabriel.

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



[issue8317] test_tarfile fails intermittently on Windows

2010-04-05 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

After grabbing a clean checkout, I'm unable to reproduce this problem where I 
was seeing it earlier, so I suspect the problem is in fact related to one or 
more lingering patches that were applied to the source. Please close this 
ticket as 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



[issue8317] test_tarfile fails intermittently on Windows

2010-04-05 Thread Brian Curtin

Changes by Brian Curtin :


--
resolution:  -> invalid

___
Python tracker 

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



[issue8319] HTMLparser does not handle call to handle_data when a tag contains no data.

2010-04-05 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

But changing the HTMLParser.goahead's way to treating tags from
if i < j: self.handle_data(rawdata[i:j]) TO
if i <= j: self.handle_data(rawdata[i:j]

is not the correct way to deal with this problem. Theoretically, whatever it is 
doing seems correct. As there is no data, don't call handle_data.

I can understand your testcase, and I think there is some other way to handle 
the test you are mentioning.

If you change the above line, many of the existing tests may fail, so that *may 
not be* way to go.

--

___
Python tracker 

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



[issue8280] urllib2 passes fragment identifier to server

2010-04-05 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil
resolution:  -> accepted

___
Python tracker 

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