[issue9721] urlparse.urljoin() cuts off last base character with semicolon at url start

2010-08-31 Thread Bastian Kleineidam

Bastian Kleineidam cal...@users.sourceforge.net added the comment:

Update: the python2.5 behaviour is the expected and what I think the correct 
output.

--
versions:  -Python 2.5

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



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

2010-08-31 Thread Lehmann

Lehmann andre.lehm...@solutech.ch added the comment:

I hope I'm sending this information in the right place.
Trying to install psutil 0.1.3, on Python 2.7 (with Win7 as OS), I get the same 
error that was mentionned in this thread:

c:\Users\Andre\Bureau\psutil-0.1.3setup.py install
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\psutil
copying psutil\error.py - build\lib.win32-2.7\psutil
copying psutil\wmi.py - build\lib.win32-2.7\psutil
copying psutil\_psbsd.py - build\lib.win32-2.7\psutil
copying psutil\_pslinux.py - build\lib.win32-2.7\psutil
copying psutil\_psmswindows.py - build\lib.win32-2.7\psutil
copying psutil\_psosx.py - build\lib.win32-2.7\psutil
copying psutil\__init__.py - build\lib.win32-2.7\psutil
running build_ext
building '_psutil_mswindows' extension
error: Unable to find vcvarsall.bat

--
nosy: +dederocks
versions: +Python 2.7 -Python 3.1

___
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



[issue9574] allow whitespace around central '+' in complex constructor

2010-08-31 Thread Jervis Whitley

Jervis Whitley jervi...@gmail.com added the comment:

Here is a patch to document string argument requirements.

--
keywords: +patch
Added file: http://bugs.python.org/file18686/complex_doc.diff

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



[issue9722] PyObject_Print with Visual Studio 2010

2010-08-31 Thread Krauzi

New submission from Krauzi krauzi_g...@yahoo.de:

Hi guys,
i recently found out that PyObject_Print is not working with Visual Studio 2010:


#include Python.h
#include iostream

int main( int argc, char** argv )
{
Py_Initialize();
PyObject_Print( PyUnicode_FromString(test), stdout, Py_PRINT_RAW );
Py_Finalize();

std::cin.get();
return EXIT_SUCCESS;
}

--
components: Interpreter Core, Windows
messages: 115256
nosy: Krauzi
priority: normal
severity: normal
status: open
title: PyObject_Print with Visual Studio 2010
type: crash
versions: Python 2.6, Python 2.7, Python 3.1

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



[issue9722] PyObject_Print with Visual Studio 2010

2010-08-31 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Krauzi wrote:
 
 New submission from Krauzi krauzi_g...@yahoo.de:
 
 Hi guys,
 i recently found out that PyObject_Print is not working with Visual Studio 
 2010:
 
 
 #include Python.h
 #include iostream
 
 int main( int argc, char** argv )
 {
 Py_Initialize();
 PyObject_Print( PyUnicode_FromString(test), stdout, Py_PRINT_RAW );
 Py_Finalize();
 
 std::cin.get();
 return EXIT_SUCCESS;
 }

In what way is this not working ?

Have you compiled Python with VS2010 or are you using the stock
from python.org (which is compiled with VS2008) ?

--
nosy: +lemburg

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



[issue3735] allow multiple threads to efficiently send the same requests to a processing.Pool without incurring duplicate processing

2010-08-31 Thread Ask Solem

Changes by Ask Solem a...@opera.com:


--
resolution:  - postponed
stage: unit test needed - needs patch

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



[issue4892] Sending Connection-objects over multiprocessing connections fails

2010-08-31 Thread Ask Solem

Changes by Ask Solem a...@opera.com:


--
nosy: +asksol

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



[issue3831] Multiprocessing: Expose underlying pipe in queues

2010-08-31 Thread Ask Solem

Changes by Ask Solem a...@opera.com:


--
nosy: +asksol

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



[issue5501] Update multiprocessing docs re: freeze_support

2010-08-31 Thread Ask Solem

Changes by Ask Solem a...@opera.com:


--
nosy: +asksol

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



[issue8534] multiprocessing not working from egg

2010-08-31 Thread Ask Solem

Changes by Ask Solem a...@opera.com:


--
keywords: +needs review
nosy: +asksol

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



[issue9722] PyObject_Print with Visual Studio 2010

2010-08-31 Thread Krauzi

Krauzi krauzi_g...@yahoo.de added the comment:

i used the one from python.org.
I cant build python with VC2010 because it cant convert the project from VC2008 
to VC2010.

--

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



[issue3093] Namespace pollution from multiprocessing

2010-08-31 Thread Ask Solem

Changes by Ask Solem a...@opera.com:


--
nosy: +asksol
stage:  - needs patch

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



[issue6407] multiprocessing Pool should allow custom task queue

2010-08-31 Thread Ask Solem

Ask Solem a...@opera.com added the comment:

are there really any test/doc changes needed for this?

--

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



[issue6407] multiprocessing Pool should allow custom task queue

2010-08-31 Thread Ask Solem

Changes by Ask Solem a...@opera.com:


--
stage: needs patch - unit test needed

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



[issue9722] PyObject_Print with Visual Studio 2010

2010-08-31 Thread Amaury Forgeot d'Arc

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

You really should use the same version of Visual Studio than the one used to 
compile python.
stdout points to a FILE object created by your version of the compiler 
(VS2010); it cannot be passed to PyObject_Print(), which uses definitions from 
the VS2008 compiler.

What issue did you encounter when converting the project files to VS2010?

--
nosy: +amaury.forgeotdarc
resolution:  - invalid
status: open - pending

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



[issue941346] AIX shared library fix

2010-08-31 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

Hi,

As reported in this issue and issue 1756343 and issue 1542544, Python does not 
produce a shared python library on AIX even with the --enable-shared flag.

I had provided a patch to correct that, but it was breaking static compilation 
of Python on AIX.

We are upgrading our AIX build environment to AIX 6.1 and Python 2.6.6, so I 
took the time to review this patch again and to clean it so that it works well 
when compiling Python statically and dynamically, with either gcc and xlc_r.

I attach the resulting patch, and the build and unit test logs. You can notice 
that not only this patch allows to compile Python dynamically on AIX, but also 
that it improves the unit tests results when compiling Python statically.

For example with the xlc_r compiler and Python compiled statically, the results 
without the patch are:
  274 tests OK.
  22 tests failed
  70 tests skipped
The results with the patch are:
  286 tests OK.
  21 tests failed
  59 tests skipped

A minor issue with this patch is that libpython2.6.so is hardcoded in the 
ld_so_aix file. That should be modified by moving ld_so_aix to ld_so_aix.in and 
using $LDLIBRARY, or by using an explicit flag when calling ld_so_aix to 
compile libpythonx.y.so.

If you agree to the principle of this patch, I can make the extra work to clean 
ld_so_aix and test this patch on Python 2.7 and 3.1.

regards

--
Added file: http://bugs.python.org/file18687/Python-2.6.6_shared_AIX.diff

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



[issue941346] AIX shared library fix

2010-08-31 Thread Sébastien Sablé

Changes by Sébastien Sablé sa...@users.sourceforge.net:


Added file: 
http://bugs.python.org/file18688/python266_AIX61_static_gcc_nopatch.txt.gz

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



[issue941346] AIX shared library fix

2010-08-31 Thread Sébastien Sablé

Changes by Sébastien Sablé sa...@users.sourceforge.net:


Added file: 
http://bugs.python.org/file18689/python266_AIX61_static_gcc_patchshared.txt.gz

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



[issue941346] AIX shared library fix

2010-08-31 Thread Sébastien Sablé

Changes by Sébastien Sablé sa...@users.sourceforge.net:


Added file: 
http://bugs.python.org/file18690/python266_AIX61_static_xlc_nopatch.txt.gz

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



[issue941346] AIX shared library fix

2010-08-31 Thread Sébastien Sablé

Changes by Sébastien Sablé sa...@users.sourceforge.net:


Added file: 
http://bugs.python.org/file18691/python266_AIX61_static_xlc_patchshared.txt.gz

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



[issue941346] AIX shared library fix

2010-08-31 Thread Sébastien Sablé

Changes by Sébastien Sablé sa...@users.sourceforge.net:


Added file: 
http://bugs.python.org/file18692/python266_AIX61_shared_gcc_nopatch.txt.gz

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



[issue941346] AIX shared library fix

2010-08-31 Thread Sébastien Sablé

Changes by Sébastien Sablé sa...@users.sourceforge.net:


Added file: 
http://bugs.python.org/file18693/python266_AIX61_shared_gcc_patchshared.txt.gz

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



[issue941346] AIX shared library fix

2010-08-31 Thread Sébastien Sablé

Changes by Sébastien Sablé sa...@users.sourceforge.net:


Added file: 
http://bugs.python.org/file18694/python266_AIX61_shared_xlc_nopatch.txt.gz

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



[issue941346] AIX shared library fix

2010-08-31 Thread Sébastien Sablé

Changes by Sébastien Sablé sa...@users.sourceforge.net:


Added file: 
http://bugs.python.org/file18695/python266_AIX61_shared_xlc_patchshared.txt.gz

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



[issue9723] pipes.quote() needs to be documented

2010-08-31 Thread Brandon Craig Rhodes

New submission from Brandon Craig Rhodes bran...@rhodesmill.org:

The only way to safely build shell command lines from inside of Python — which 
is necessary when sending commands across SSH, since that behaves like 
os.system() rather than like subprocess.call() — is to use the wonderful 
pipes.call() method to turn possibly-dangerous arguments, like filenames that 
might have spaces, special characters, and embedded rm -r calls, into 
perfectly quoted strings for an sh-like shell (say, bash or zsh).

This call is already recommended on mailing lists, blog posts, and Stack 
Overflow — and since it doesn't start with a _, I think its public use is 
fair game. But the pipes documentation itself doesn't officially mention or 
support it. I think it should be added to the Standard Library documentation 
for pipes. So. Yeah.

--
assignee: d...@python
components: Documentation
messages: 115263
nosy: brandon-rhodes, d...@python
priority: normal
severity: normal
status: open
title: pipes.quote() needs to be documented
type: feature request
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue1756343] Python 2.5.1 fails to build on AIX

2010-08-31 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

I proposed a patch in issue 941346 to correct this same problem with Python 
2.6.6.

regards

--
nosy: +sable

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



[issue1542544] Improve dynamic linking support on AIX

2010-08-31 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

I proposed a patch in issue 941346 that is different from this one but which 
should result in a shared python library on AIX as well.

regards

--
nosy: +sable

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



[issue9724] help('nonlocal') missing

2010-08-31 Thread Cherniavsky Beni

New submission from Cherniavsky Beni c...@users.sf.net:

 help('nonlocal')
no Python documentation found for 'nonlocal'

As a language keyword, it clearly should have documentation.

--
assignee: d...@python
components: Documentation
messages: 115266
nosy: cben, d...@python
priority: normal
severity: normal
status: open
title: help('nonlocal') missing
versions: Python 3.2

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



[issue9724] help('nonlocal') missing

2010-08-31 Thread Benjamin Peterson

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

r84376.

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

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



[issue9721] urlparse.urljoin() cuts off last base character with semicolon at url start

2010-08-31 Thread Michał Powaga

Michał Powaga michalpowag...@gmail.com added the comment:

The problem was be here:

path = path[:-1] # This is not needed and cuts last character
return urlunparse((scheme, netloc, path,
  params, query, fragment))

I sent a patch.

PS. Sorry if I`m doing something wrong but it is my first patch and activity in 
the Python project.

--
keywords: +patch
nosy: +michalp -calvin
Added file: http://bugs.python.org/file18696/urlparse.patch

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



[issue9725] urllib.request.FancyURLopener won't connect to pages requiring username and password

2010-08-31 Thread Petr Machek

New submission from Petr Machek petr...@seznam.cz:

Code:

import urllib.request

class MyOpener(urllib.request.FancyURLopener):
prompt_user_passwd = lambda x, y, z: (username, password)

opener = MyOpener()
page = opener.open(http://riddle.p4x.ch/music;)
print(page.readlines())


opener.open() call ends with error for every page requiring login via 
prompt_user_password(). urllib/request.py tries to encode password with base64 
without conversion to bytes which is required for base64.b64encode() in Python 
3.1. Even after applying conversion to bytes, another new error is generated

--
components: Library (Lib)
messages: 115269
nosy: petr6.6
priority: normal
severity: normal
status: open
title: urllib.request.FancyURLopener won't connect to pages requiring username 
and password
type: behavior
versions: Python 3.1

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



[issue9723] pipes.quote() needs to be documented

2010-08-31 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

I think you mean pipe.quote in your message, not pipe.call. The subject looks 
correct.

I'm not sure pipes is the best place for this, but I agree it should probably 
be documented in older versions. It seems to me we've had this discussion 
before about quoting command lines, how it applies differently between Windows 
and various shells, and which functions to expose. But having said that, I 
can't find a previous issue that discusses it.

Not the least of my concerns is that pipes says it's available on Unix systems, 
despite the fact that I have it on a Windows machine. And I might need the 
functionality of passing a bash command from a Windows machine to a Unix 
machine, so we definitely need this cross platform.

--
nosy: +eric.smith

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



[issue9721] urlparse.urljoin() cuts off last base character with semicolon at url start

2010-08-31 Thread R. David Murray

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


--
nosy: +orsenthil

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



[issue8990] array constructor and array.fromstring should accept bytearray.

2010-08-31 Thread Antoine Pitrou

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

The patch shouldn't remove the tests for tostring()/fromstring() (they might be 
deprecated, but they are still supported).

--

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



[issue9726] logging.handlers.RotatingFileHandler: implement preserve log file name extension feature

2010-08-31 Thread Desmond Cox

New submission from Desmond Cox desmon...@gmail.com:

See https://issues.apache.org/jira/browse/LOG4NET-64 - [PATCH] to 
RollingFileAppender.cs to add the ability to preserve the log file name 
extension when rolling the log file.

Currently, rollover appends a numeric extension to the base file name. E.g.:

app.log
app.log.1
app.log.2

Consider adding an option to preserve the log file name extension. E.g.:

app.log
app.1.log
app.2.log

This maintains file associations in Windows, most notably.

--
components: Library (Lib)
messages: 115272
nosy: desmondgc
priority: normal
severity: normal
status: open
title: logging.handlers.RotatingFileHandler: implement preserve log file name 
extension feature
type: feature request
versions: Python 2.7

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



[issue9693] asynchat push_callable() patch

2010-08-31 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Thanks for the comments.

 I don't understand what _Callable is used for; why not just a tuple?

_Callable is just a container to store function, args and kwargs objects.
I thought it made more sense than using a tuple because it's intrinsically 
callable.

 - if you use _Callable, then why do you write hasattr(first, 
 '__call__') rather than simply isinstance(first, _Callable)?

For flexibility, in the remote case the user wants to override _Callable class. 
 It's a corner case though, not really important.

 - why override __bool__??

I did that for performance.
Considering that initiate_send() method is called many times, and that it is 
almost always used to send data rather than firing functions I wanted to avoid 
to call isinstance(first, _Callable) (or hasattr(first,  '__call__')) on every 
loop.
By making __bool__ return False we achieve this, see:

first = self.producer_fifo[0]
# handle empty string/buffer or None entry
if not first:
...
# code to handle data to be sent follows...
...
   

 The API also looks a bit weird to me - the Twisted model of Deferreds 
 is so much better - but why not.

The API follows the exact same approach as push(), push_with_producer() and 
close_when_done() methods.
It adds something to a fifo and that something will be processed (called) 
only when the previous producers are exhausted, respecting the order of what 
has been pushed first and later.
This is different than a deferred.

A deferred is a callback that will be fired at a later time and that is related 
to the main loop (the reactor).
push_callable() is a callback that will be fired when all previous producers 
will be exhausted firsts and is related to the connection itself, not the main 
loop (if the connection gets closed the callback will be discarded).

Something similar to Twisted deferreds is this:
http://bugs.python.org/issue1641
...which, despite apparently similar, is different than this.

--

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



[issue8990] array constructor and array.fromstring should accept bytearray.

2010-08-31 Thread Thomas Jollans

Thomas Jollans tho...@jollans.com added the comment:

That sounds reasonable. I've updated the patch to keep the old 
test_tofromstring testcase. 

I'll also attach another patch in a moment that removes what I'm reasonably 
sure is all the uses of array.tostring and .fromstring in the standard library 
and the other modules' tests.

--
Added file: http://bugs.python.org/file18697/tofrombytes.diff

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



[issue8990] array constructor and array.fromstring should accept bytearray.

2010-08-31 Thread Thomas Jollans

Changes by Thomas Jollans tho...@jollans.com:


Added file: http://bugs.python.org/file18698/tostring_usage.diff

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



[issue8990] array constructor and array.fromstring should accept bytearray.

2010-08-31 Thread Thomas Jollans

Changes by Thomas Jollans tho...@jollans.com:


Removed file: http://bugs.python.org/file18607/tofrombytes.diff

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



[issue5553] Py_LOCAL_INLINE(type) doesn't actually inline except using MSC

2010-08-31 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

Committed in r84379

--
keywords:  -needs review
resolution:  - accepted
stage: patch review - committed/rejected
status: open - closed

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



[issue1397474] timeit execution enviroment

2010-08-31 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

I agree that the Timer doc is deficient in not saying that timing is done 
within a function defined within the timeit module. It is also deficient in not 
mentioning the secret of how to successfully pass user-defined functions until 
the very bottom instead of where that option is described. (I had missed this 
very point until recently.)

The discussion of possible new features for 3.2 (more likely later) does not 
affect 2.7/3.1 and should not stop a change in 3.2 either.  I propose that the 
Timer doc be revised to the following:

PROPOSED REPLACEMENT
'''
Class for timing execution speed of small code snippets. The constructor 
creates a function that executes the *setup* statement once and then times some 
number of executions of the *stmt* statement (see Timer.timeit). Both 
statements default to 'pass'. The *timer* parameter defaults to a 
platform-dependent timer function (see the module doc string). Both *stmt* and 
*setup* may contain multiple statements separated by ; or newlines as long as 
they don’t contain multi-line string literals.

Both *stmt* and *setup* can also be objects that are callable without 
arguments. Passing testfunc rather than 'testfunc()' may reduce the timing 
overhead. However, if testfunc is a Python function, passing its quoted code 
should have even less overhead because doing so eliminates an extra function 
call.

To give *stmt* (whether it is a callable name or code string) access to 
pre-defined user objects, such as testfunc, *setup* must include an import, 
such as 'from __main__ import testfunc'. Note that 'from __main__ import *' 
does not work because * imports are not legal within functions.

To measure the execution time of *stmt*, use the timeit() method. The repeat() 
method is a convenience to call timeit() multiple times and return a list of 
results.
'''

Note 1. testfunc , 'testfunc()' , and 'from ' should be marked up as code. 
Perhaps the first two should be double quoted also, depending of the style 
convention. What must be clear is the difference between passing an unquoted 
function name and a string.

Note 2. The 'may reduce' comment: timeit.timeit(str) (for instance) runs 
noticeably faster than timeit.timeit('str()'). I presume this is because 
callables get bound to a local name and local name lookup is faster than 
builtin lookup. This difference does not apply to imported user names. The 
existing statement Note that the timing overhead is a little larger in this 
case because of the extra function calls. is confusing to me because it does 
not specify the alternative to 'this case' and there are two possibilities, 
which I specified.

Note 3. The comment about * imports should be deleted for 2.7 version.

ADDITIONAL CHANGE
Add the following to the very bottom as part of the final example:

t = Timer(test, from __main__ import test)
print(t.timeit()) # should be nearly the same


--
keywords: +patch
nosy: +terry.reedy
stage:  - needs patch
type:  - behavior
versions: +Python 2.7, Python 3.1, Python 3.2

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



[issue808164] socket.close() doesn't play well with __del__

2010-08-31 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

Fixed in r84380 and r84382.

--
keywords:  -needs review
resolution:  - accepted
stage: patch review - committed/rejected
status: open - closed

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



[issue7141] 2to3 should add from __future__ import print_statement

2010-08-31 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

I don't think I'm familiar enough with 2to3's pattern-matching syntax to write 
a good patch.

Here's a rough outline for how a patch would work.  There are two cases: 

1) When there is already a from __future__ import.  Currently, this line is 
stripped by fix_future.  fix_future could be changed to remove the other 
futures, but add/leave print_statement.  This case is probably pretty 
straightforward.

2) When there is no from __future__ import.  A pattern would need to detect 
the absence of the __future__ line and insert one in the right place (after 
initial comments but before anything else).

--
stage:  - needs patch

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



[issue941346] AIX shared library fix

2010-08-31 Thread Antoine Pitrou

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

In dynamic builds, there seem to be lots of messages such as:

ld: 0711-224 WARNING: Duplicate symbol: .PyLong_FromString
ld: 0711-224 WARNING: Duplicate symbol: PyLong_FromString

Are you sure this is normal?

In any case, if you find a way to cleanup ld_so_aix, this should probably be 
checked in anyway. I doubt anybody else tests under AIX, so it's reasonable to 
trust you on this.

Even better if you manage to diagnose and/or fix some of the test failures, by 
the way. (if not, you can still open separate issues for each of them)

--

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



[issue9693] asynchat push_callable() patch

2010-08-31 Thread Antoine Pitrou

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

  - why override __bool__??
 
 I did that for performance.
 Considering that initiate_send() method is called many times, and that
 it is almost always used to send data rather than firing functions I
 wanted to avoid to call isinstance(first, _Callable) (or
 hasattr(first,  '__call__')) on every loop.

This looks hackish... You should at least make the purpose very clear in
comments to the code.
Also, really, isinstance(..., _Callable) is better than the hasattr()
call, IMO.

 The API follows the exact same approach as push(),
 push_with_producer() and close_when_done() methods.
 It adds something to a fifo and that something will be processed
 (called) only when the previous producers are exhausted, respecting
 the order of what has been pushed first and later.
 This is different than a deferred.

Well, a deferred would be fired when a given piece of data has been sent
(or failed to send, in which case the errback would be run rather than
the callback). This is in the end equivalent, since I suppose the send
queue is sequential and never gets reordered.

In any case, I guess it's too late to change the overall design. I just
wanted to point out that the Deferred concept unified a lot of use cases
under a simple convenient abstraction. It avoids having to define ad hoc
methods such as push_callable().

 Something similar to Twisted deferreds is this:
 http://bugs.python.org/issue1641

This has nothing to do with Deferreds actually :)

--

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



[issue9727] Add callbacks to be invoked when locale changes

2010-08-31 Thread Nick Coghlan

New submission from Nick Coghlan ncogh...@gmail.com:

As part of the PEP 384 discussion, it was noted that one of the problems with 
mixed C runtimes on Windows is that each C runtime in the process has it's own 
idea of the current locale setting.

This can be addressed to some degree by having extension modules query and 
modify the Python interpreter's locale setting rather than the C runtime 
setting, but doesn't help those modules react to *changes* in the setting.

Would it be worth adding a callback registration mechanism to the locale module 
to allow modules to be notified when the locale changes? (It seems like this 
may be useful even outside the context of PEP 384, e.g. to dynamically update 
displays in GUI applications)

--
components: Library (Lib)
messages: 115281
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Add callbacks to be invoked when locale changes
type: feature request
versions: Python 3.2

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



[issue9713] Py_CompileString fails on non decode-able paths.

2010-08-31 Thread STINNER Victor

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

The problem is not specific to Py_CompileString(): all functions based 
(indirectly) on PyParser_ASTFromString() and PyParser_ASTFromFile() expect 
filenames encoded in utf-8 with the strict error handler.

If we choose to use something else than utf-8 in strict mode, here is an 
incomplete list of functions that have to be patched:
 - parser:
   * initerr()
   * err_input()
 - ast
   * ast_error_finish()

And the list of impacted functions (parsing functions accepting filenames):
 - PyParser_ParseStringFlagsFilename()
 - PyParser_ParseFile*()
 - PyParser_ASTFromString(), PyParser_ASTFromFile()
 - PyAST_FromNode()
 - PyRun_SimpleFile*()
 - PyRun_AnyFile*()
 - PyRun_InteractiveOneFlags()
 - etc.

All these functions are public and I don't think that it would be a good idea 
to change the encoding (eg. to iso-8859-1). We can use a different error 
handler (especially surrogateespace, as suggested in the initial message) 
and/or create new functions accepting unicode filenames.

--

I'm working on undecodable filenames in issues #8611 and #9425, especially on 
the import machinery part. When the import machinery will be fully unicode 
compliant, the last part will be the parser machinery (Parser/*.c). It is a 
little bit more complex to patch the parser because there is the bootstrap 
problem: the parser is compiled twice, once with a small subset of the C Python 
API (using some mockups), once with the full API.

--

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



[issue9713] Py_CompileString fails on non decode-able paths.

2010-08-31 Thread STINNER Victor

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


--
components: +Unicode -None
versions: +Python 3.2

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



[issue1552880] Unicode Imports

2010-08-31 Thread STINNER Victor

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

utf-8 codec (in strict mode) rejects surrogates in python3, and so you doesn't 
support undecodable filenames (filenames decoded using surrogateescape error 
handler which produces surrogate characters). It may be possible if you use 
surrogateescape everywhere.

Manipulate encoded filenames is not trivial because it may quickly lead to 
mojibake if the encodings are different (eg. if sys.path contains a bytes 
filename, you have to be careful). Use utf-8 means that you have to decode and 
then reencode (to the filesystem encoding) a filename before passing it to a 
system call (eg. mkdir()). #8611 problem is that Python3 doesn't work if the 
filesystem is *not* utf-8.

You solution is attractive because it is short, but I prefer to use directly 
the right solution to not patch Python twice: use unicode (with surrogates, PEP 
383, for undecodable filenames) everywhere.

--

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



[issue1552880] Unicode Imports

2010-08-31 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

I conffess that I didn't follow the utf-8/surrogate discussion.
But the utf-8 encoding can encode all valid unicode characters:

UTF-8 may only legally be used to encode valid Unicode scalar values. According 
to the Unicode standard the high and low surrogate halves used by UTF-16 
(U+D800 through U+DFFF) and values above U+10 are not legal Unicode values, 
and the UTF-8 encoding of them is an invalid byte sequence and should be 
treated as described above. (from wikipedia)

If we encounter surrogate halves when encoding (unicode) to utf-8, it means 
that we are really trying to decode utf-16 and reencode it as utf-8.  (and that 
python is using 16 bits for its unicode chars).  the utf--8 codec should be 
smart enough to merge the surrogates into a utf-32 char, and encode that.

Anyway, as you remark, my approach is a _patch_, designed to make python (2.x) 
work in an unicode environment, with the least amount of code change, for those 
willing to commit such a patch.  In 3.x you may want to do things differently.

--

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



[issue9728] Docs point to FAQ Section 3, but FAQs are not numbered

2010-08-31 Thread Daniel Stutzbach

New submission from Daniel Stutzbach dan...@stutzbachenterprises.com:

In Doc/extending/windows.rst, there's the following text:


If your module creates a new type, you may have trouble with this line::

   PyVarObject_HEAD_INIT(PyType_Type, 0)

Change it to::

   PyVarObject_HEAD_INIT(NULL, 0)

and add the following to the module initialization function::

   MyObject_Type.ob_type = PyType_Type;

Refer to section 3 of the `Python FAQ http://www.python.org/doc/faq`_ for
details on why you must do this.


If I assume that Section 3 means, the third link on the FAQ page, I can't find 
the FAQ that's being alluded to here.  There's a comment in Include/pyport.h 
that I believe to be related:

/* Under Cygwin, auto-import functions to prevent compilation */
/* failures similar to http://python.org/doc/FAQ.html#3.24 */

However, that link no longer goes to a particular question and I can't tell 
which question it once referred to.

I ran into this because I'm trying to understand the cause of the issue which I 
suspect is related to Issue #6672.

--
assignee: d...@python
components: Documentation
messages: 115285
nosy: brian.curtin, d...@python, stutzbach, tim.golden
priority: normal
severity: normal
stage: needs patch
status: open
title: Docs point to FAQ Section 3, but FAQs are not numbered

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



[issue9729] Unconnected SSLSocket.{send, recv} raises TypeError: 'member_descriptor' object is not callable

2010-08-31 Thread Andrew Bennetts

New submission from Andrew Bennetts s...@users.sourceforge.net:

ython 2.6.6 (r266:84292, Aug 24 2010, 21:47:18) 
[GCC 4.4.5 20100816 (prerelease)] on linux2
Type help, copyright, credits or license for more information.
 import socket, ssl
 s = socket.socket()
 wrapped = ssl.wrap_socket(s)
 wrapped.recv(1)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.6/ssl.py, line 217, in recv
return socket.recv(self, buflen, flags)
TypeError: 'member_descriptor' object is not callable


What I expected was a more helpful error, like the unwrapped socket gives:

 s.recv(1)
Traceback (most recent call last):
  File stdin, line 1, in module
socket.error: [Errno 107] Transport endpoint is not connected


The full list of affected methods are all the _delegate_methods from socket.py:

_delegate_methods = (recv, recvfrom, recv_into, recvfrom_into,
 send, sendto)

The cause is that the SSLSocket subclass is trying to upcall to the 
_socketobject base class, but the base does not have methods for those, just 
__slots__ for the instance to fill in with bound methods.

--
messages: 115286
nosy: spiv
priority: normal
severity: normal
status: open
title: Unconnected SSLSocket.{send,recv} raises TypeError: 'member_descriptor' 
object is not callable
versions: Python 2.6, Python 2.7

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



[issue9729] Unconnected SSLSocket.{send, recv} raises TypeError: 'member_descriptor' object is not callable

2010-08-31 Thread Andrew Bennetts

Changes by Andrew Bennetts s...@users.sourceforge.net:


--
type:  - behavior

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



[issue9730] base64 encoding takes in bytes rather than string.

2010-08-31 Thread JingCheng LIU

New submission from JingCheng LIU liu...@gmail.com:

http://docs.python.org/py3k/library/base64.html?highlight=base64
the examples given doesn't work

--
assignee: d...@python
components: Documentation
messages: 115287
nosy: Dmitry.Jemerov, JingCheng.LIU, d...@python, ezio.melotti, orsenthil, 
pitrou
priority: normal
severity: normal
status: open
title: base64 encoding takes in bytes rather than string.
type: behavior
versions: Python 3.1

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