[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat

2010-03-26 Thread Eric Devolder

Eric Devolder eric.devol...@gmail.com added the comment:

This seems to be fixed now under 3.1.2, and works properly for me.

Great stuff, thank you.

Eric

P.S. Last time I mistakenly tagged the bug to be Python 3.2 as well, 
correcting this now.

--
versions:  -Python 3.2

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



[issue8238] Proxy handling

2010-03-26 Thread Ciprian Trofin

New submission from Ciprian Trofin ciprian.tro...@ktd.ro:

After I installed Python 2.6.5, I noticed a drop in performance of web 
connections via proxy.

This script:
-
import time
import urllib2

timeMark = time.time()
opener = urllib2.build_opener()
textWeb = opener.open(http://www.google.com/;).read()
print time.time() - timeMark
-

takes about 60 seconds to complete (consistently)

The same script, run using Python 2.6.2 is completed in less than 1 second  
(0.2seconds)

The test system:
- Windows XP SP3
- internet connection via corporate connection, using a proxy (the proxy is set 
in Control Panel - Internet Options etc)

--
components: None
messages: 101742
nosy: ciprian.trofin
severity: normal
status: open
title: Proxy handling
type: performance
versions: Python 2.6

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



[issue8238] Proxy handling

2010-03-26 Thread Senthil Kumaran

Senthil Kumaran orsent...@gmail.com added the comment:

How are setting up and using your proxy? It would also help you discuss your 
approach at python-h...@python.org and if you see any specific issues, raise it 
in the bug report.

--
nosy: +orsenthil

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



[issue6716] Windows install error when choosing to compile .py files

2010-03-26 Thread Gabriel Genellina

Gabriel Genellina gagsl-...@yahoo.com.ar added the comment:

r78994 (exclude 2to3 tests from compileall) should be backported to trunk and 
the 2.6 branch, but I don't see them (yet).

--
nosy: +gagenellina

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6716
___
___
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-03-26 Thread Dirkjan Ochtman

Changes by Dirkjan Ochtman dirk...@ochtman.nl:


--
nosy: +djc

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



[issue8238] Proxy handling

2010-03-26 Thread Ciprian Trofin

Ciprian Trofin ciprian.tro...@ktd.ro added the comment:

I attached a screenshot.

The proxy is on the corporate network. I'm not setting it up, I'm only using 
it. Internet Explorer needs that setting in order to connect. Firefox needs 
this proxy set as manual proxy configuration.

I looked deeper into the situatioan, usign the following (modified) script:

---
import time
import urllib2

timeMark = time.time()
opener = urllib2.build_opener()

proxy = urllib2.ProxyHandler({http : http://10.249.1.63:80})
opener.add_handler(proxy)

textWeb = opener.open(http://www.google.com/;).read()

print time.time() - timeMark

---

The only difference from the script above: I set up the proxy manually.
I tested the new script in 2.6.5

With Windows proxy active: same problem, long waiting time.
With Windows proxy disabled: fast execution.

--
Added file: http://bugs.python.org/file16667/proxy.png

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



[issue8239] Windows 2.6.5 Installer Advanced Option Generates Error Message During Compile Step

2010-03-26 Thread Peter

New submission from Peter ps1...@users.sourceforge.net:

If the installer is run in Windows XP/SP3 without selecting the Advanced 
compiling option, it works fine.  If the installer is run in Windows XP/SP3 and 
the Advanced compiling option is selected, the following error message is 
generated during the compile step:

There is a problem with this Windows Installer package. A program run as part 
of the setup did not finish as expected. Contact your support 
personnel or package vendor.

The relevant part of the log when the installer fails using the Advanced 
compiling option is as follows:



MSI (s) (4C:B4) [14:41:27:205]: Doing action: CompilePyc
Action 14:41:27: CompilePyc. 
Action start 14:41:27: CompilePyc.
MSI (s) (4C:B4) [14:45:45:528]: Note: 1: 1722 2: CompilePyc 3: C:\bin
\Python26\python.exe 4: -Wi C:\bin\Python26\Lib\compileall.py -f -x 
bad_coding|badsyntax|site-packages|py3_ C:\bin\Python26\Lib 
MSI (s) (4C:B4) [14:45:45:528]: Note: 1: 2262 2: Error 3: -2147287038 
Error 1722. There is a problem with this Windows Installer package. A 
program run as part of the setup did not finish as expected. Contact your 
support personnel or package vendor.  Action CompilePyc, location: 
C:\bin\Python26\python.exe, command: -Wi C:\bin\Python26\Lib\compileall.py -f 
-x bad_coding|badsyntax|site-packages|py3_ C:\bin\Python26\Lib 
MSI (s) (4C:B4) [14:47:41:133]: Note: 1: 2262 2: Error 3: -2147287038 
MSI (s) (4C:B4) [14:47:41:133]: Product: Python 2.6.5 -- Error 1722. 
There is a problem with this Windows Installer package. A program run as part 
of the setup did not finish as expected. Contact your support 
personnel or package vendor.  Action CompilePyc, location: C:\bin\Python26 
\python.exe, command: -Wi C:\bin\Python26\Lib\compileall.py -f -x 
bad_coding|badsyntax|site-packages|py3_ C:\bin\Python26\Lib 

Action ended 14:47:41: CompilePyc. Return value 3.
Action ended 14:47:41: INSTALL. Return value 3.



I believe the cause of this installation failure message is due to the 
syntax of the following command:

C:\bin\Python26\python.exe -Wi C:\bin\Python26\Lib\compileall.py -f -x 
bad_coding|badsyntax|site-packages|py3_ C:\bin\Python26\Lib

If this command is run in the Windows XP shell, it yields an error.  If the -x 
option's args are wrapped in double quotes, it runs ok (except for a syntax 
error when compiling one of the python source files - I don't remember which 
one):

C:\bin\Python26\python.exe -Wi C:\bin\Python26\Lib\compileall.py -f -x 
bad_coding|badsyntax|site-packages|py3_ C:\bin\Python26\Lib

So it appears that the Windows XP shell is interpreting the | 
characters within the -x option's args as pipe characters and tries to 
pipe the multiple commands together.

The simple work around is to not use the Advanced compiling option with this 
release.  If wanted, the compilation step can be performed manually after the 
installation completes.

--
components: Installation, Windows
messages: 101746
nosy: ps1956
severity: normal
status: open
title: Windows 2.6.5 Installer Advanced Option Generates Error Message During 
Compile Step
type: behavior
versions: Python 2.6

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



[issue8194] Incompatible API change in xmlrpclib.Transport.parse_response() of Python 2.7 and 3.2

2010-03-26 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

In Python 2.6/3.1, xmlrpclib.Transport.parse_response() accepts a file like 
object. But Python 2.7/3.2 requires a HTTPResponse object because 
parse_response() calls response.getheader() method.

The patch moves the call to .getheader() in single_request() to accept a 
file-like object in parse_response(). But I don't understand why the gzip 
support is implemented in xmlrpclib instead of httplib.

The problem is related to M2Crypto which pass a BIO object (file-like object, 
without .getresponse() method).

--
nosy: +haypo
title: broken API in xmlrpclib.Transport - Incompatible API change in 
xmlrpclib.Transport.parse_response() of Python 2.7 and 3.2
versions: +Python 2.7, Python 3.2 -Python 3.3

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



[issue8239] Windows 2.6.5 Installer Advanced Option Generates Error Message During Compile Step

2010-03-26 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

This is fixed as of r79248.

--
nosy: +brian.curtin
priority:  - normal
resolution:  - duplicate
status: open - closed

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



[issue8236] ./configure: ImportError: No module named asdl

2010-03-26 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I can't reproduce this on 2.6 maint on Linux 32 bit (Gentoo).

Did you try doing a make distclean before redoing the configure/make?

--
nosy: +benjamin.peterson, r.david.murray
priority:  - high

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



[issue8237] multiprocessing.Queue() blocks program

2010-03-26 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Crash is for interpreter segfaults, changing to type 'behavior'.  Setting stage 
to 'test needed' because if this is a valid bug the test will need to be turned 
into a unit test.

--
nosy: +jnoller, r.david.murray
priority:  - normal
stage:  - test needed
type: crash - behavior

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



[issue8193] test_zlib fails with zlib 1.2.4

2010-03-26 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

According to http://www.zlib.net/ChangeLog.txt, since zlib 1.2.3.5::
- Use zlib header window size if windowBits is 0 in inflateInit2()

The failing test should be changed, for example::
self.assertRaises(ValueError, zlib.decompressobj, -1)

--
keywords: +easy, patch
nosy: +amaury.forgeotdarc

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



[issue8237] multiprocessing.Queue() blocks program

2010-03-26 Thread Jesse Noller

Jesse Noller jnol...@gmail.com added the comment:

multiprocessing.Queue.Put() acts the same as Queue.put() - if the queue is 
full, the put call hangs until the queue is no longer full. The process will 
not exit, as the Queue is full, and it's waiting in put.

This works as designed, unless I'm missing something painfully obvious, which 
is entirely possible.

--
resolution:  - invalid
status: open - closed

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril

Cyril c...@excellency.fr added the comment:

The following test case exhibits the bug, but I'm not sure it will fail every 
time as it depends on 2 things:

 - your connection speed (I guess)
 - I used the following trick to have 2 identical strings with a different id 
(memory address):

data = (('xx'[0] + 'xx'[1:])*1, ('xx'[0] + 'xx'[1:])*1)

I'm not sure it will work all the time though.

--
Added file: http://bugs.python.org/file16669/test_ssl.py.patch

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
components: +Extension Modules -Library (Lib)
nosy: +giampaolo.rodola

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
priority:  - normal
stage:  - test needed
type:  - behavior

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



[issue6543] traceback presented in wrong encoding

2010-03-26 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 surrogateescape characters are not printable

stderr uses backslashescape error handler, and so non-decodable characters will 
be displayed as \xHH.

... see also #8092 :-)

--

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



[issue8237] multiprocessing.Queue() blocks program

2010-03-26 Thread Erdem U. Altinyurt

Erdem U. Altinyurt spamjunkea...@gmail.com added the comment:

Firstly I think as you but this is not correct.
Added Q.full() to know if Queue is full or not to the testQ code..

def testQ():
   for i in range(1):
  mp.Process( None, QueueWorker, None, (i,Q,lock) ).start()
  while len(mp.active_children())=mp.cpu_count()+4:
time.sleep(0.01)
print Q.full()

output is:
1397  done
1398  done
1399  done
False
False
False

So Queue is not full. And you can also add some things to queue at this 
state(by adding extra line to  while loop) and this will not blocks while loop.

Please test..

--
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8237
___
___
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-03-26 Thread Konrad Delong

Changes by Konrad Delong kon...@gmail.com:


--
nosy: +konryd

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7946
___
___
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-03-26 Thread Alexandre Conrad

Changes by Alexandre Conrad alexandre.con...@gmail.com:


--
nosy: +aconrad

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +haypo

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

If I understood correctly, the patch only concerns non blocking socket if 
SSL_write() returns 0? If SSL_write() returns a non zero value, can you use: 
ssl_socket.send(data[count:])?

About the string identifier trick, you should add an assertion to ensure that 
identifiers are differents. Example:

a = 'x' * 2
# create a copy with a different memory address
b = a[0:] + a[1:]
assert (a == b) and (a is not b)
data = a, b


See also issue #8222: enabling SSL_MODE_AUTO_RETRY on SSL sockets.

--

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



[issue8222] enabling SSL_MODE_AUTO_RETRY on SSL sockets

2010-03-26 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

See also issue #8240 about SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 
(ssl.SSLSocket.write may fail on non-blocking sockets).

--
nosy: +haypo

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



[issue8222] enabling SSL_MODE_AUTO_RETRY on SSL sockets

2010-03-26 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 letting the C OpenSSL runtime do it for us is certainly more efficient

+1 if it's more efficient ;-)

--

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



[issue8222] enabling SSL_MODE_AUTO_RETRY on SSL sockets

2010-03-26 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Would it be possible to add an option to disable SSL_MODE_AUTO_RETRY for a 
specific socket? Existing applications may rely on / prefer the current 
behaviour.

--

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril

Cyril c...@excellency.fr added the comment:

You're right about the assert, I've just uploaded a new patch.

In non-blocking mode, ssl_socket.send(data) will return either 0 (which means 
nothing was sent, you'll have to try again), or len(data) when everything was 
sent. It can't return anything inbetween. This is because 
SSL_MODE_ENABLE_PARTIAL_WRITE is not enabled.

In my opinion, SSL_MODE_ENABLE_PARTIAL_WRITE should probably be enabled, 
although I don't know if it would have any consequence on existing code. Note 
that _ssl.c header has:

   XXX should partial writes be enabled, SSL_MODE_ENABLE_PARTIAL_WRITE?

However, it's totally unrelated to our bug. Issue #8222 is also unrelated since 
SSL_MODE_AUTO_RETRY only applies to blocking sockets.

By the way, this bug was triaged test needed. Am I missing anything? This is 
my first reported bug, I'm not sure about the process.

--
Added file: http://bugs.python.org/file16670/test_ssl.py.patch.v2

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril

Cyril c...@excellency.fr added the comment:

I forgot to talk about the conditions in which I stumbled upon that bug. I use 
a cStringIO.StringIO as a send buffer. When the socket is ready to send data, I 
call ssl_socket.send(send_buffer.getvalue()).

Unfortunately, two consecutive calls to send_buffer.getvalue() may return a 
different object (i.e. a string with a different memory address).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8240
___
___
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-03-26 Thread Guilherme Salgado

Changes by Guilherme Salgado gsalg...@gmail.com:


--
nosy: +salgado

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

test needed is in reference to your assertion that you weren't sure your test 
would fail reliably.  A test that fails some times and passes some times 
is...suboptimal when dealing with a buildbot testing infrastructure :)

--
nosy: +r.david.murray

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



[issue8222] enabling SSL_MODE_AUTO_RETRY on SSL sockets

2010-03-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Would it be possible to add an option to disable SSL_MODE_AUTO_RETRY
 for a specific socket? Existing applications may rely on / prefer the
 current behaviour.

I don't think so, since recv() used to emulate that behaviour anyway.

--

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +janssen

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



[issue6716] Windows install error when choosing to compile .py files

2010-03-26 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Gabriel: can you explain why that should be backported?

--

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Since this error seems to be aimed at warning about potential programming 
errors, I'm not sure it should be silenced. The obvious fix should be to pass 
the same argument every time (until the data finally gets written).

--
nosy: +pitrou

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril

Cyril c...@excellency.fr added the comment:

r.david.murray: ah, sure :) However, I'm not sure a test case is absolutely 
required for this issue for two reasons:

 - the fix is trivial: it's a one-liner that enables a SSL mode that 
explicitely authorizes SSL_write to be called a second time with a a different 
memory pointer than the first time. Since memory pointers are opaque to Python 
programmers anyway, I doubt it could break code (unless you'd expect the 
failure, of course :) )

 - tests about SSL in non-blocking mode are almost inexistant, I think. The 
only one I could find tests the handshake. See issue #3890 for instance. 
Probably because writing tests in non-blocking mode isn't easy.

However, my test may be correct, I'm just not sure it will pass everywhere :)

--

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril

Cyril c...@excellency.fr added the comment:

pitrou: that's debatable, since the Python programmer has no control over 
memory pointers. As I said, I have a cStringIO buffer, and two consecutive 
calls to buffer.getvalue() yield different objects. What can I do about it? I 
think it's a rather sane scenario, and I don't feel I'm doing anything wrong.

If you think the programmer should be alerted about it, however, then we should 
at least say it explicitely in the documentation and probably return an 
explicit Python error. I had to google quite a bit before finding out what this 
error meant:

error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry

--

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 pitrou: that's debatable, since the Python programmer has no control
 over memory pointers.

No, but he has control over whether he always uses the same object, or
generates a new argument everytime.

  As I said, I have a cStringIO buffer, and two consecutive calls to
 buffer.getvalue() yield different objects. What can I do about it? I
 think it's a rather sane scenario, and I don't feel I'm doing anything
 wrong.

Hmm, indeed. What you can do, very simply, is cache the getvalue()
result once you have generated it.

 If you think the programmer should be alerted about it, however, then
 we should at least say it explicitely in the documentation and
 probably return an explicit Python error. I had to google quite a bit
 before finding out what this error meant:
 
 error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry

Indeed, this is cryptic.

By the way, I've found a thread explaining this in greater detail:
http://readlist.com/lists/openssl.org/openssl-users/0/1794.html

Basically, even when SSL_write() says the write must be retried, it does
process and buffer some of your data, so that if you retry with
different data, some junk will be written out on the SSL socket.

--

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril

Cyril c...@excellency.fr added the comment:

Switching to a documentation issue is fine to me. Indeed I can just cache the 
result of StringIO.getvalue(), although it feels a bit crude.

I won't be able to create a documentation patch since English is not my primary 
language. While you're at it, the doc says about SSLSocket.write:

Returns the number of bytes written.

It actually either returns 0 or len(data), at least as long as we don't have 
SSL partial writes. That's a different behaviour from regular sockets, and I 
had to look in _ssl.c to figure out why I never had values inbetween.

--

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



[issue8222] enabling SSL_MODE_AUTO_RETRY on SSL sockets

2010-03-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Fixed in r79448 (trunk), r79449 (py3k), r79451 (2.6), r79453 (3.1).

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8222
___
___
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-03-26 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I also switched to gettimeofday() so it should work now on all Posix 
 with high resolution timer

But on a busy system, won't measuring wall clock time rather than CPU time give 
bogus results?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7946
___
___
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-03-26 Thread Nir Aides

Nir Aides n...@winpdb.org added the comment:

 But on a busy system, won't measuring wall clock time rather than CPU time 
 give bogus results?

This was the motivation for using clock_gettime(). I tried the wall clock 
version under load (including on single core system) and it seems to behave. 
Now it remains to rationalize it :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7946
___
___
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-03-26 Thread Larry Hastings

Changes by Larry Hastings la...@hastings.org:


--
nosy: +larry

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7946
___
___
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-03-26 Thread Augie Fackler

Changes by Augie Fackler li...@durin42.com:


--
nosy: +durin42

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2010-03-26 Thread Peter Kleiweg

Changes by Peter Kleiweg pklei...@xs4all.nl:


--
nosy: +pebbe

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4953
___
___
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-03-26 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

It would be really useful to be able to send signal.SIGINT to processes on 
Windows using os.kill(...). The patch as described sounds like it would have a 
different signature to the standard implementation of os.kill(...) which takes 
a pid and a signal type. 

IronPython 2.7 will have an os.kill implementation. Looks like it only supports 
signal.SIGINT and signal.SIGBREAK and just calls:

Process toKill = Process.GetProcessById(pid);
toKill.Kill()

--
nosy: +michael.foord

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1220212
___
___
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-03-26 Thread Michael Foord

Changes by Michael Foord mich...@voidspace.org.uk:


--
versions: +Python 2.7, Python 3.2 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1220212
___
___
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-03-26 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

I'm wrong. First IronPython tries:

NativeSignal.GenerateConsoleCtrlEvent(PythonSignal.CTRL_C_EVENT, ...)

But with the comment:

//The following calls to GenerateConsoleCtrlEvent will fail under
//most circumstances. We'll try them any ways though as this seems
//to be the only mechanism in Windows to send signals to processes

It falls back to just killing the process.

--

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



[issue6716] Windows install error when choosing to compile .py files

2010-03-26 Thread Gabriel Genellina

Gabriel Genellina gagsl-...@yahoo.com.ar added the comment:

Sorry for being so terse and not filling in the gaps! In the end, I changed my 
mind on this bug - it's not an installer issue.

The 2.6.5 MSI installer, when asked to compile .pyc files, exits with an error 
as reported here:
http://mail.python.org/pipermail/python-list/2010-March/1240182.html

Both Problem#1 and Problem#3 (as reported in this issue) apply to the 2.6.5 
installer. Properly quoting the -x argument fixed Problem#1 (already done). But 
Problem#3 still applies: compileall fails on one test case in lib2to3 because 
of a syntax error (this was not so clearly stated in the c.l.p. post). The 
error is:

SyntaxError: ('invalid syntax', 
('d:\\apps\\python26\\Lib\\lib2to3\\tests\\data\\py2_test_grammar.py', 936, 23, 
'with manager(), manager():\n'))

That syntax is not 2.6 compatible (but 2.7 does allow it).

My initial idea was to completely exclude lib2to3\tests from being precompiled, 
as done in r78994 for py3k, and both for 2.6 and 2.7. But after looking more 
closely to the error (and noticing that it is legal in 2.7) I'd leave the 
installer as it is, and report the issue in py2_test_grammar.py as a separate 
bug.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6716
___
___
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-03-26 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

Aaaand the IronPython implementation of 
NativeSignal.GenerateConsoleCtrlEvent(PythonSignal.CTRL_C_EVENT, ...)
 delegates to Kernel32.GenerateConsoleCtrlEvent.

--

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2010-03-26 Thread João Paulo Farias

João Paulo Farias jpaulofar...@gmail.com added the comment:

I dont see the resolution for this problem yet... What should I do to not have 
it happen?

--
nosy: +jpfarias

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



[issue8241] py2_test_grammar.py contains invalid syntax for 2.6

2010-03-26 Thread Gabriel Genellina

New submission from Gabriel Genellina gagsl-...@yahoo.com.ar:

Lib\lib2to3\tests\data\py2_test_grammar.py, in test_with_statement, requires a 
variant of the with statement (multiple targets) that is not available in 
Python 2.6.  Compiling py2_test_grammar.py raises a SyntaxError.  This makes 
the 2.6.5 installer exit with an error message when asked to pre-compile all 
.pyc files, as reported in issue6716.

The fix is simply to remove the last three 'with' statements in function 
test_with_statement, around line 923 in 
Lib\lib2to3\tests\data\py2_test_grammar.py, as this is invalid code for this 
Python version.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 101779
nosy: gagenellina
severity: normal
status: open
title: py2_test_grammar.py contains invalid syntax for 2.6
type: behavior
versions: Python 2.6

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



[issue8241] py2_test_grammar.py contains invalid syntax for 2.6

2010-03-26 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
assignee:  - benjamin.peterson
nosy: +benjamin.peterson
priority:  - normal
stage:  - needs patch

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



[issue8234] Spelling and text in howto/webservers

2010-03-26 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Closed as duplicate of #8218.

--
nosy: +ezio.melotti
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed

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



[issue8218] typo currect

2010-03-26 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

See also #8234 that has a patch with some rephrasing too.

--
nosy: +ubershmekel
stage:  - needs patch

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



[issue8241] py2_test_grammar.py contains invalid syntax for 2.6

2010-03-26 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

The correct thing to do is actually to ignore py2_test_grammar.py when 
compiling the pyc files.

--
assignee: benjamin.peterson - loewis
nosy: +loewis

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



[issue8242] Support surrogates in import ; install Python in a non-ASCII directory

2010-03-26 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

If the fullpath to the python3 binary contains a non-ASCII character and the 
file system encoding is ASCII, Python fails with:
---
Could not find platform independent libraries prefix
Could not find platform dependent libraries exec_prefix
Consider setting $PYTHONHOME to prefix[:exec_prefix]
Fatal Python error: Py_Initialize: can't initialize sys standard streams
ImportError: No module named encodings.utf_8
Abandon
---

The file system encoding is set to ASCII if there is no locale (eg. LANG=C).

The problem is that the command line argument, especially argv[0], is stored to 
a wchar_t* string using surrogates to store undecodable bytes.

Attached patch fixes calculate_path() and import functions to support 
surrogates. Details:

 * Initialize Py_FileSystemDefaultEncoding earlier in Py_InitializeEx(), 
because its value is required to encode unicode using surrogates to bytes
 * Rename char2wchar() to _Py_char2wchar(), the function is not more static ; 
and create function _Py_wchar2char()
 * Escape surrogates (reimplement surrogateescape decoder) in calculate_path() 
subfunctions (_wstat, _wgetcwd, _Py_wreadlink)
 * Use surrogateescape error handler in find_module(), NullImporter_init() and 
zipimporter_init()
 * Write a fastpath (I don't know the right term: is it an hack?) for utf-8 
encoding with surrogateescape error handler in PyUnicode_AsEncodedObject() and 
PyUnicode_AsEncodedString(): required because these functions are called by 
codecs module is initialized

The patch is a work in progress: there are some FIXME (I don't know if the 
string should be encoded/decoded using surrogates or not).

I only tested ASCII and UTF-8 file system encodings. I don't know if we can 
support more encodings. Python has few builtin encodings. Other encodings are 
implemented in Python: we have to import them, but we need the codec to import 
a module, so...

I don't think that Windows is affected by this issue because it has a better 
API for unicode filenames and command line arguments, and most patched 
functions are surrounded by #ifndef WINDOWS ... #endif

--
components: Unicode
files: surrogates_bootstrap-4.patch
keywords: patch
messages: 101815
nosy: haypo
severity: normal
status: open
title: Support surrogates in import ; install Python in a non-ASCII directory
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file16671/surrogates_bootstrap-4.patch

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



[issue8242] Support surrogates in import ; install Python in a non-ASCII directory

2010-03-26 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

If I understood correctly, my patch is also required to import a module having 
a non-ASCII full path if the file system encoding is ASCII.

--

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



[issue8086] ssl.get_server_certificate new line missing

2010-03-26 Thread Kyle VanderBeek

Changes by Kyle VanderBeek ky...@kylev.com:


--
keywords: +patch
Added file: http://bugs.python.org/file16672/python-ssl-PEM_FOOTER.patch

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



[issue8086] ssl.get_server_certificate new line missing

2010-03-26 Thread Kyle VanderBeek

Kyle VanderBeek ky...@kylev.com added the comment:

Forgot to note that my patch is against 2.7 current trunk.

--
nosy: +kylev

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



[issue8242] Support surrogates in import ; install Python in a non-ASCII directory

2010-03-26 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Initialize Py_FileSystemDefaultEncoding earlier in Py_InitializeEx(),
 because its value is required to encode unicode using surrogates to bytes

Oh, it doesn't work: get_codeset() returns NULL, because the codec register is 
empty when get_codeset() is called (with my patch).

--

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



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2010-03-26 Thread Gabriel Genellina

Gabriel Genellina gagsl-...@yahoo.com.ar added the comment:

@jpfarias: could you be more specific? Which error(s) do you have? in which 
scenario?

--

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



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2010-03-26 Thread Daniel Vim

Changes by Daniel Vim 333...@gmail.com:


--
files: curses_bug.py
nosy: theosp
severity: normal
status: open
title: curses writing to window's bottom right position raises: `_curses.error: 
addstr() returned ERR'
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file16673/curses_bug.py

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



[issue4621] zipfile returns string but expects binary

2010-03-26 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

I just discovered that attempting to open zip member test\file fails where 
attempting to open test/file works.  Granted the zip contains / not \ 
characters, but using the os.path stuff (on windows) to manipulate the names 
before attempting to open the zip member produces \ characters.  Clearly, I 
could switch them back.  It seems pretty clear that zipfile should do that for 
me, though.

A small, self-contained zip file test case is attached, being a zip that is 
named .py 

My testing using Python 3.1.1

--
nosy: +v+python
Added file: http://bugs.python.org/file16674/testzip.py

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