[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-05-24 Thread Senthil

Senthil  added the comment:

Fixed for Py2x in the revision 72880. Tested it on a Squid Proxy setup
and found it working fine. Should this be backported?

For Py3k, the Request class has undergone changes since the patch was
developed, I am modifying the patch for Py3k to accommodate those changes.

--

___
Python tracker 

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



[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

2009-05-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
priority:  -> critical
stage:  -> needs patch
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



[issue6073] threading.Timer and gtk.main are not compatible

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

It is probably a problem with the gtk/gobject Python binding.
By the way, you're supposed to call `gobject.threads_init()` if you use
threads with Python and gobject/gtk.
Besides, gtk certainly has its own timing facilities, while
threading.Timer is rather crude.

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

___
Python tracker 

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



[issue1309352] Make fcntl work properly on AMD64

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Gonna apply if nobody opposes :)

--
assignee: nnorwitz -> pitrou

___
Python tracker 

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



[issue6070] Pyhon 2.6 makes .pyc/.pyo bytecode files executable

2009-05-24 Thread Marco

Marco  added the comment:

I attach a patch to correct this little bug.

Bye ;)

--
nosy: +markon
Added file: http://bugs.python.org/file14049/import_patch.c

___
Python tracker 

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



[issue6073] threading.Timer and gtk.main are not compatible

2009-05-24 Thread Eric

Eric  added the comment:

OK, this is a workaround. 

adding this line 
gtk.gdk.threads_init()

makes the job. And that's ok for me.

nevertheless, I still got the feeling that's this is a flaw in the Timer
implementation: it's behaviour is changed by some external (gtk) code.

--
status: pending -> open

___
Python tracker 

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



[issue5259] smtplib is broken in Python3

2009-05-24 Thread R. David Murray

R. David Murray  added the comment:

Committed the simple auth tests and fix in r72868 in py3k and r72877 in
3.0.  Also added the test to trunk in r72878 to keep the test source in
sync, and to 26maint similarly in r72886.

Now we need tests for the other auth cases.

--
stage: commit review -> test needed

___
Python tracker 

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



[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

2009-05-24 Thread Marco

Marco  added the comment:

It seems Python is using a default mask to compile modules.
If you open a file b.py as "r", and you import it from a.py, you can see
that b.pyc is:
-rwxr-xr-x 1 marco marco9 24 mag 16:17 a.py
-r--r--r-- 1 marco marco   10 24 mag 16:17 b.py
-rw-r--r-- 1 marco marco  122 24 mag 16:46 b.pyc

If you try to run a.py:
-rwxr-xr-x 1 marco marco9 24 mag 16:17 a.py
-r-xr-xr-x 1 marco marco   10 24 mag 16:17 b.py

you'll get:
-rw-r--r-- 1 marco marco  122 24 mag 16:49 b.pyc

as you can see, there is a default "mode" to create compiled modules...

--
nosy: +markon

___
Python tracker 

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



[issue1309352] Make fcntl work properly on AMD64

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed in r72887, r72888, r72889. Thanks!

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



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

2009-05-24 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

Thanks again Martin for the guidance.  It proved quite helpful in completing 
this patch.

This latest version (3) compiles and has been tested under Windows Vista and 
Windows XP and behaves as expected (with a NotImplemented error under XP).

I did find that I had to tweak the behavior of stat.S_ISLNK because my 
implementation of the st_mode bits for a symlink has different values than 
that of a posix call.  I don't fully understand the implications of my 
implementation.

An alternate implementation would be to have set_symlink_stat[AW] reset all of 
the st_mode flags except for 0o12, to be consistent with what is returned 
by a posix stat call.  This approach doesn't seem quite right either.  I would 
appreciate a comment on this by someone more familiar with this type of 
problem.

Other than that issue, what else needs to be addressed to get this patch 
integrated into the 3.1 or 3.1.1 release?

--
title: Add os.link() and os.symlink() and   os.path.islink() support for 
Windows -> Add os.link() and os.symlink() and os.path.islink() support for 
Windows
Added file: http://bugs.python.org/file14050/windows symlink draft 3.patch
Added file: http://bugs.python.org/file14051/smime.p7s

___
Python tracker 

___Index: Lib/stat.py
===
--- Lib/stat.py (revision 72889)
+++ Lib/stat.py (working copy)
@@ -53,7 +53,7 @@
 return S_IFMT(mode) == S_IFIFO
 
 def S_ISLNK(mode):
-return S_IFMT(mode) == S_IFLNK
+return bool(S_IFMT(mode) & S_IFLNK)
 
 def S_ISSOCK(mode):
 return S_IFMT(mode) == S_IFSOCK
Index: Lib/ntpath.py
===
--- Lib/ntpath.py   (revision 72889)
+++ Lib/ntpath.py   (working copy)
@@ -306,13 +306,19 @@
 return split(p)[0]
 
 # Is a path a symbolic link?
-# This will always return false on systems where posix.lstat doesn't exist.
+# This will always return false on systems where os.lstat doesn't exist.
 
 def islink(path):
-"""Test for symbolic link.
-On WindowsNT/95 and OS/2 always returns false
 """
-return False
+Test whether a path is a symbolic link.
+This will always return false for Windows prior to 6.0
+and for OS/2.
+"""
+try:
+st = os.lstat(path)
+except (os.error, AttributeError):
+return False
+return stat.S_ISLNK(st.st_mode)
 
 # alias exists to lexists
 lexists = exists
Index: Modules/posixmodule.c
===
--- Modules/posixmodule.c   (revision 72889)
+++ Modules/posixmodule.c   (working copy)
@@ -1005,6 +1005,45 @@
return 0;
 }
 
+void set_symlink_statA(
+   const char *path,
+   WIN32_FILE_ATTRIBUTE_DATA *info,
+   struct win32_stat *result)
+{
+   /* Get WIN32_FIND_DATA structure for the path to determine if
+  it is a symlink */
+   WIN32_FIND_DATAA find_data;
+   HANDLE find_data_handle;
+   if(!(info->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) return;
+   find_data_handle = FindFirstFileA(path, &find_data);
+   if(find_data_handle != INVALID_HANDLE_VALUE)
+   {
+   if(find_data.dwReserved0 == IO_REPARSE_TAG_SYMLINK)
+   result->st_mode |= 012;
+   FindClose(find_data_handle);
+   }
+}
+
+void set_symlink_statW(
+   const wchar_t *path,
+   WIN32_FILE_ATTRIBUTE_DATA *info,
+   struct win32_stat *result)
+{
+   /* Get WIN32_FIND_DATA structure for the path to determine if
+  it is a symlink */
+   WIN32_FIND_DATAW find_data;
+   HANDLE find_data_handle;
+   if(!(info->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) return;
+   find_data_handle = FindFirstFileW(path, &find_data);
+   if(find_data_handle != INVALID_HANDLE_VALUE)
+   {
+   if(find_data.dwReserved0 == IO_REPARSE_TAG_SYMLINK)
+   result->st_mode |= 012;
+   FindClose(find_data_handle);
+   }
+}
+
+
 /* Emulate GetFileAttributesEx[AW] on Windows 95 */
 static int checked = 0;
 static BOOL (CALLBACK *gfaxa)(LPCSTR, GET_FILEEX_INFO_LEVELS, LPVOID);
@@ -1143,6 +1182,9 @@
code = attribute_data_to_stat(&info, result);
if (code != 0)
return code;
+
+   set_symlink_statA(path, &info, result);
+
/* Set S_IFEXEC if it is an .exe, .bat, ... */
dot = strrchr(path, '.');
if (dot) {
@@ -1181,6 +1223,9 @@
code = attribute_data_to_stat(&info, result);
if (code < 0)
return code;
+
+   set_symlink_statW(path, &info, result);
+
/* Set IFEXEC if it is an .exe, .bat, ... */
dot = wcsrchr(path, '.');
if (dot) {
@@ -4736,7 +4781,79 @@
 }
 #endif /* HAVE_SYMLINK */
 
+#if !

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

2009-05-24 Thread Jason R. Coombs

Changes by Jason R. Coombs :


Removed file: http://bugs.python.org/file14051/smime.p7s

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Is there any reason in versioning Misc/python.pc, instead of versioning
it only on install?

--

___
Python tracker 

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



[issue1518] Fast globals/builtins access (patch)

2009-05-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou

___
Python tracker 

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



[issue5596] memory leaks in 3.1

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Current results:

test_modulefinder leaked [145, 145] references, sum=290
test_urllib leaked [10, 0] references, sum=10
test_urllib2 leaked [227, 227] references, sum=454

--

___
Python tracker 

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



[issue6001] Test discovery for unittest

2009-05-24 Thread Michael Foord

Michael Foord  added the comment:

Updated patch with documentation and fixed command line usage message.

Unless there are objections I intend to check this in in the next few
days. It would be helpful if someone else could go over the
documentation and check for errors / typos etc.

I've already had feedback from a few folks. The only suggestions so far
have been:

* Instead of a discover method the functionality could be built into
TestLoader.loadTestsFromPath. This would be a substantial change and I
think it better belongs in a new method.
* discover could simply load all modules and discover TestCases instead
of needing a pattern to filter on. I think filtering is an important
feature (not least for performance and because importing arbitrary
modules is not safe). Loading all modules can be had by passing in a
pattern of '*'

The behavior as implemented is a subset of the test discovery provided
by frameworks like nose (which doesn't require all test modules to be
importable from the top level).

The load_tests protocol is an idea already in use by the Bzr test
framework and similar protocols are in use in other frameworks.

--
Added file: http://bugs.python.org/file14052/test_discovery.patch

___
Python tracker 

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



[issue6096] SimpleXMLRPCServer not suitable for HTTP/1.1 keep-alive

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

New submission from Kristján Valur Jónsson :

The SimpleXMRRPCServer class calls connection.shutdown(1) when done with 
each request, thus making it unsuitable for a RequestHandler that supports 
HTTP/1.1 with keep-alive.  This patch removes those extra shutdown calls.
Patch also uploaded as 
http://codereview.appspot.com/63143

--
components: Library (Lib)
files: xmlsrv.patch
keywords: easy, needs review, patch, patch
messages: 88269
nosy: krisvale
severity: normal
status: open
title: SimpleXMLRPCServer not suitable for HTTP/1.1 keep-alive
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7
Added file: http://bugs.python.org/file14053/xmlsrv.patch

___
Python tracker 

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



[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

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

Changes by Martin v. Löwis :


--
title: Pyhon 2.6 makes .pyc/.pyo bytecode files executable -> Python 2.6 makes 
.pyc/.pyo bytecode files executable

___
Python tracker 

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



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

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

Martin v. Löwis  added the comment:

The patch (v3) looks technically correct, with two minor issues: perhaps
one should release the handle to kernel32 (not sure whether other code
does it, or whether it matters), and I would inline the two new
functions into their single callers.

That aside, I sense a bigger issue of getting stat/lstat correct. In the
presence of symbolic links, stat(2) is supposed to look at the file that
is being linked to, whereas lstat is supposed to look at the link
itself. Currently, lstat and stat do the same thing on Windows, as the
assumption was that there are no symbolic links, anyway (in which case
lstat does indeed return the same as stat always). This assumption is no
longer correct - so the two functions need to be separated.

I don't know what the most efficient way is to do a real stat() on Vista
- ideally, the Get* APIs would take a flag to follow links. If that
doesn't work, we would need to resolve the link ourselves, and look at
the file being referenced. Possible errors (on POSIX) for stat then are
ENOENT (broken symlink), ELOOP (symlink loop), ENOTDIR (path component
in symlink value is not a directory), and EACCESS (path component in
symlink, or target file is not accessible). This is just FYI; we should
raise the appropriate Win32 errors (and hopefully, we don't have to do
it ourselves, anyway).

--

___
Python tracker 

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



[issue6001] Test discovery for unittest

2009-05-24 Thread Michael Foord

Michael Foord  added the comment:

Georg Brandl has pointed out various minor issues in the docs (and
discover docstring) that I am correcting.

--

___
Python tracker 

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



[issue6097] Encoded surrogate characters on command line not escaped in sys.argv

2009-05-24 Thread David Watson

New submission from David Watson :

The mbstowcs and mbrtwoc functions which are used for the initial
conversion of command-line arguments on Unix can return lone or
paired surrogates (e.g. \udcff for \xed\xb3\xbf in non-strict
UTF-8), and these surrogates are currently placed into sys.argv
unescaped.  This creates various problems such as strings that
cannot be re-encoded into bytes and strings that could represent
more than one byte sequence.  Examples follow using the following
script in a UTF-8 locale on Linux:

import sys
print(repr(sys.argv[1]))
print(repr(sys.argv[1].encode(sys.getfilesystemencoding(),
"surrogateescape")))


Strings that cannot be re-encoded:

$ ./python argtest.py $'\xed\xa0\x80'
'\ud800'
Traceback (most recent call last):
  File "argtest.py", line 6, in 
print(repr(sys.argv[1].encode(sys.getfilesystemencoding(),
"surrogateescape")))
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in
position 0: surrogates not allowed

$ ./python argtest.py $'\xed\xb0\x80'
'\udc00'
Traceback (most recent call last):
  File "argtest.py", line 6, in 
print(repr(sys.argv[1].encode(sys.getfilesystemencoding(),
"surrogateescape")))
UnicodeEncodeError: 'utf-8' codec can't encode character '\udc00' in
position 0: surrogates not allowed


Aliasing between non-decodable bytes and encoded lone surrogates:

$ ./python argtest.py $'\xff'
'\udcff'
b'\xff'

$ ./python argtest.py $'\xed\xb3\xbf'
'\udcff'
b'\xff'


Aliasing between encoding of a non-BMP character and encoding of
its UTF-16 representation (on narrow Unicode builds):

$ ./python argtest.py $'\xf0\x90\x80\x80'
'\U0001'
b'\xf0\x90\x80\x80'

$ ./python argtest.py $'\xed\xa0\x80\xed\xb0\x80'
'\U0001'
b'\xf0\x90\x80\x80'


Attached is a patch to fix these problems by replacing any
decoded characters in the range 0xd800...0xdfff with the
surrogateescape encodings of their source bytes.

--
files: escape-surrogates.diff
keywords: patch
messages: 88272
nosy: baikie
severity: normal
status: open
title: Encoded surrogate characters on command line not escaped in sys.argv
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14054/escape-surrogates.diff

___
Python tracker 

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



[issue4859] pwd, spwd, grp functions vulnerable to denial of service

2009-05-24 Thread David Watson

David Watson  added the comment:

Patch to make get*nam() functions encode their arguments using
the file system encoding and "surrogateescape" error handler, so
that they correctly handle the user/group name fields returned by
each other.

--
Added file: http://bugs.python.org/file14056/surrogateescape-args.diff

___
Python tracker 

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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-05-24 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I added a versionadded: 2.7 note to the docs in r72890.

This change is not suitable for back porting as it arguably adds a new 
feature.

--

___
Python tracker 

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



[issue4859] pwd, spwd, grp functions vulnerable to denial of service

2009-05-24 Thread David Watson

David Watson  added the comment:

Patch to make pwd, spwd and grp decode their string fields using
the file system encoding and the "surrogateescape" error handler,
as per PEP 383.

--
Added file: http://bugs.python.org/file14055/surrogateescape-fields.diff

___
Python tracker 

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



[issue6065] bdist_msi.py failed assert when including extension modules

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

Martin v. Löwis  added the comment:

Thanks for the patch. Committed as r72891 and r72892.

Please use 4-space indents in the future.

--
resolution:  -> accepted
status: open -> closed

___
Python tracker 

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



[issue6050] zipfile: Extracting a directory that already exists generates an OSError

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

Martin v. Löwis  added the comment:

Thanks for the patch. Committed with modifications (including a test) as
r72893, r72894, r72895, r72896.

--
resolution:  -> accepted
status: open -> closed

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-24 Thread Clinton Roy

Clinton Roy  added the comment:

Not that I can see, or remember. Revised patch attached. Tyop fixed as well.

Please note there seem to be some issues with svn head atm,
pyconfig.h.in and configure would seem to be out of whack with
configure.in, this patch does not include changes to those generated files.

--
Added file: http://bugs.python.org/file14057/pkgconfig.diff

___
Python tracker 

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



[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

2009-05-24 Thread Georg Brandl

Georg Brandl  added the comment:

Are these S_IX... constants available on every platform we support?

--
nosy: +georg.brandl

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The patch is committed in trunk (r72898) and py3k (r72899). Thanks!

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



[issue6070] Python 2.6 makes .pyc/.pyo bytecode files executable

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

Martin v. Löwis  added the comment:

No, they are not supported on Visual Studio.

--

___
Python tracker 

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



[issue6098] xml.dom.minidom incorrectly claims DOM Level 3 conformance

2009-05-24 Thread Philipp Hagemeister

New submission from Philipp Hagemeister :

>From DOM Level 3[1]: "An implementation conforms to a DOM Level 3 module
if it supports all the interfaces for that module and the associated
semantics.". minidom supports only some Level 3 functions such as
Node.renameNode, Element.setIdAttribute*, Text.replaceWholeText and
Node.isSameNode.

Apart from full DOM Level 2 conformance such as functional namespace
handling, many semantics are available under a different name, such as
DOMImplementation.getFeature (minidom: getInterface),
Text.getWholeText(minidom: _getWholeText) or missing
(Attr.schemaTypeInfo, Document.inputEncoding, Document.xmlEncoding,
Document.xmlStandalone, Document.xmlVersion, Document.domConfig,
Document.adoptNode, Document.normalizeDocument,
DOMException.VALIDATION_ERR, DOMException.TYPE_MISMATCH_ERR,
Node.baseURI, Node.textContent, Node.compareDocumentPosition,
Node.lookupPrefix, Node.isDefaultNamespace, Node.lookupNamespaceURI,
Node.isEqualNode, Node.DOCUMENT_POSITION_*,
Text.isElementContentWhitespace).

Users explicitely asking for DOM Level 3 conformance will run into
unexpected problems. Attached is a patch that removes the DOM L3
conformance declarations.

--
components: XML
files: minidom-dont-declare-level3.diff
keywords: patch
messages: 88282
nosy: phihag
severity: normal
status: open
title: xml.dom.minidom incorrectly claims DOM Level 3 conformance
type: behavior
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file14058/minidom-dont-declare-level3.diff

___
Python tracker 

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



[issue6099] HTTP/1.1 with keep-alive support for xmlrpclib.ServerProxy

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

New submission from Kristján Valur Jónsson :

The Transport class in xmlrpclib.py was using the old httplib.HTTP 
class.
This patch brings xmlrpclib up to date to use the HTTPConnection and 
HTTPSConnection classes.  This allows xlmrpclib.ServerProxy to use 
HTTP/1.1 with keep-alive on
servers that support it.

Note that this patch benefits from recent optimizations of 
HTTPConnection reducing the Nagle problem.

This is a separate patch from http://bugs.python.org/issue1767370 and in 
my opinion much simpler.
See also 
http://bugs.python.org/issue2076

Patch uploaded as http://codereview.appspot.com/63144

--
components: Library (Lib)
files: xmlprclib.patch
keywords: needs review, patch, patch
messages: 88283
nosy: krisvale
severity: normal
status: open
title: HTTP/1.1 with keep-alive support for xmlrpclib.ServerProxy
type: performance
versions: Python 2.7, Python 3.0
Added file: http://bugs.python.org/file14059/xmlprclib.patch

___
Python tracker 

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



[issue6012] enhance getargs O& to accept cleanup function

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

Martin v. Löwis  added the comment:

So: any opinions what approach would be better? A new converter O$ or a
change to the existing O&, selected by return value from the conversion
function?

--

___
Python tracker 

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



[issue6012] enhance getargs O& to accept cleanup function

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Reusing O& looks better to me (we already have too many type specifiers). 
Why have you chosen 0x2 for Py_CLEANUP_SUPPORTED? Are there other
possible values below that?

--
nosy: +pitrou

___
Python tracker 

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



[issue1943] improved allocation of PyUnicode objects

2009-05-24 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Antoine, I think we have to make a decision here: I'm still -1 on
changing PyUnicodeObject to be a PyVarObject, but do like your
experiments with the free lists.

I also still believe that tuning the existing parameters in the Unicode
implementation and pymalloc would give a better performance gain than
what your patch achieves. 

Setting KEEPALIVE_SIZE_LIMIT to 32 would be a first start in that direction.

However, if you insist on changing the PyUnicodeObject structure, I'll
have to reject the patch.

--

___
Python tracker 

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



[issue1943] improved allocation of PyUnicode objects

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

As I already showed, the freelist experiments bring very little improvement.

--

___
Python tracker 

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



[issue6012] enhance getargs O& to accept cleanup function

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

Martin v. Löwis  added the comment:

> Reusing O& looks better to me (we already have too many type specifiers). 
> Why have you chosen 0x2 for Py_CLEANUP_SUPPORTED? Are there other
> possible values below that?

It's essentially random. I want it to be a power of two, in case we make
it a bit mask some day, and significantly different from 1. 0x2 was
the smallest number that qualified :-)

--

___
Python tracker 

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



[issue1943] improved allocation of PyUnicode objects

2009-05-24 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Ok, then closing the patch as rejected.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue1943] improved allocation of PyUnicode objects

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Marc-André, please don't close the issue while you're the only one
opposing it, thanks.

--
resolution: rejected -> 
status: closed -> open

___
Python tracker 

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



[issue6100] Expanding arrays inside other arrays

2009-05-24 Thread marek_sp

New submission from marek_sp :

Hello!
I recently thought about a nice feature (pure syntactic sugar):
>>> a = [2,3,4]
>>> b = [1,*a,5]
>>> print b
[1, 2, 3 ,4 ,5]

instead of:
>>> b = [1]+a+[5]

I think first one is somewhat more readable and similiar thing already
is possible with function calls. For example:
>>> c = func(*a)

--
components: Interpreter Core
messages: 88292
nosy: marek_sp
severity: normal
status: open
title: Expanding arrays inside other arrays
type: feature request
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2

___
Python tracker 

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



[issue6101] SETUP_WITH

2009-05-24 Thread Benjamin Peterson

New submission from Benjamin Peterson :

This patch condenses the many current opcodes used to start a with
statement into one, SETUP_WITH. I originally did this to properly lookup
__enter__ and __exit__ as special methods. However, the patch also has
the nice side effect of removing the need for a temporary variable.

--
assignee: benjamin.peterson
components: Interpreter Core
files: SETUP_WITH.patch
keywords: patch
messages: 88293
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: SETUP_WITH
type: performance
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file14060/SETUP_WITH.patch

___
Python tracker 

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



[issue6101] SETUP_WITH

2009-05-24 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Performance numbers:

With patch:

$ ./python.exe -m timeit -s 'import thread; l = thread.allocate_lock()'
'with l: pass'
100 loops, best of 3: 1.99 usec per loop

Without:
10 loops, best of 3: 2.15 usec per loop

--

___
Python tracker 

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



[issue6101] SETUP_WITH

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'm not sure I understand the point of PyInstance_Check() in
lookup_special().

You should bump the bytecode version in import.c.

By the way, there are some "with" tests in pybench (you can run them
using "-t With").

--
nosy: +pitrou

___
Python tracker 

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



[issue6101] SETUP_WITH

2009-05-24 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/5/24 Antoine Pitrou :
>
> Antoine Pitrou  added the comment:
>
> I'm not sure I understand the point of PyInstance_Check() in
> lookup_special().

_PyObject_LookupSpecial doesn't understand classic classes.

>
> You should bump the bytecode version in import.c.

Ok

Thanks.

--

___
Python tracker 

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



[issue6101] SETUP_WITH

2009-05-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Endly, in compile.c, it seems the stack effect of SETUP_WITH should be
1, not 3 (only one value is pushed onto the stack).

--

___
Python tracker 

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



[issue6101] SETUP_WITH

2009-05-24 Thread Benjamin Peterson

Changes by Benjamin Peterson :


Added file: http://bugs.python.org/file14061/SETUP_WITH2.patch

___
Python tracker 

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



[issue6012] enhance getargs O& to accept cleanup function

2009-05-24 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

> Reusing O& looks better to me

Me too.

--

___
Python tracker 

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



[issue6101] SETUP_WITH

2009-05-24 Thread Benjamin Peterson

Changes by Benjamin Peterson :


Added file: http://bugs.python.org/file14062/SETUP_WITH3.patch

___
Python tracker 

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



[issue6102] When the package has non-ascii path and .pyc file, we cannot import them.

2009-05-24 Thread Suzumizaki

New submission from Suzumizaki :

When the path of the package has non-ascii characters, importing such
packages always fails except the first time (in other words, always 
fails when compiled .pyc file exists).

The problem exists even the names of such modules only consist of
us-ascii characters. Please follow the test code I create, which can
test the problem even with English version Windows(, I expected).

Target: Windows XP (I tested Home Ed., SP3, 32bit, Japanase version)
Python: 3.0.1

The priority of this issue might be CRITICAL or higher by 2 reasons:
1) When the end-users meet this condition, the users cannot find what's
wrong easily, because UnicodeDecodeError is raised (not ImportError).

2) On non-English version Windows, "Desktop", "My Documents" or etc. 
folders have non-English name as default. For example, Katakana is used
in Japanese version. This means all python packages in the desktop meet
 this problem for not a few users.

--
components: None
files: testcode.zip
messages: 88299
nosy: Suzumizaki
severity: normal
status: open
title: When the package has non-ascii path and .pyc file, we cannot import them.
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file14063/testcode.zip

___
Python tracker 

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



[issue6094] Python fails to build with Subversion 1.7

2009-05-24 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
type:  -> compile error
versions:  -Python 2.4

___
Python tracker 

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



[issue5794] pickle/cPickle of recursive tuples create pickles that cPickle can't load

2009-05-24 Thread Collin Winter

Collin Winter  added the comment:

Bug-fix patch attached. Alexandre, can you take a look? Feel free to
bounce it back if you don't have time.

I'll port to 2.6 and py3k once this is reviewed for trunk.

--
keywords: +26backport, easy, patch
nosy: +alexandre.vassalotti
stage:  -> patch review
versions: +Python 2.7, Python 3.1 -Python 2.5
Added file: http://bugs.python.org/file14064/rec_tuple.patch

___
Python tracker 

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



[issue5866] cPickle defect with tuples and different from pickle output

2009-05-24 Thread Collin Winter

Changes by Collin Winter :


--
status: pending -> closed

___
Python tracker 

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



[issue6088] Python3.0.1.1 is not available when system locale is zh_TW.eucTW

2009-05-24 Thread Leeon

Leeon  added the comment:

Hello David,

Thanks for your quick response!
I just downloaded Python3.0.1 source code and compiled it on my Debian
5.0 Linux using following commands:
r...@li-le01-d5:~# ./configure
r...@li-le01-d5:~# make
r...@li-le01-d5:~# make altinstall

Then I try Python in interactive mod and found the problem. On my
system, there is not any output and error message in python3.0 console
when I try to execute some statments. See following screen reaction:

r...@li-le01-d5:~# python3.0
Python 3.0.1 (r301:69556, May 26 2009, 19:48:24)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> loacle.getlocale()
>>> help()
>>> exit()
>>> 

Then I try to execute a script file hello.py.
My script contains only one python statement: print('Hello World!')
On my system, there is not any output and error message also when I run
"python3.0 hello.py".
r...@li-le01-d5:~# locale
LANG=zh_TW.EUC-TW
LC_CTYPE="zh_TW.EUC-TW"
LC_NUMERIC="zh_TW.EUC-TW"
LC_TIME="zh_TW.EUC-TW"
LC_COLLATE="zh_TW.EUC-TW"
LC_MONETARY="zh_TW.EUC-TW"
LC_MESSAGES="zh_TW.EUC-TW"
LC_PAPER="zh_TW.EUC-TW"
LC_NAME="zh_TW.EUC-TW"
LC_ADDRESS="zh_TW.EUC-TW"
LC_TELEPHONE="zh_TW.EUC-TW"
LC_MEASUREMENT="zh_TW.EUC-TW"
LC_IDENTIFICATION="zh_TW.EUC-TW"
LC_ALL=
r...@li-le01-d5:~# /usr/local/bin/python3.0 hello.py
r...@li-le01-d5:~#

Then I witch to zh_TW.utf8 and try it again.
r...@li-le01-d5:~# LANG=zh_TW.utf8
r...@li-le01-d5:~# locale
LANG=zh_TW.utf8
LC_CTYPE="zh_TW.utf8"
LC_NUMERIC="zh_TW.utf8"
LC_TIME="zh_TW.utf8"
LC_COLLATE="zh_TW.utf8"
LC_MONETARY="zh_TW.utf8"
LC_MESSAGES="zh_TW.utf8"
LC_PAPER="zh_TW.utf8"
LC_NAME="zh_TW.utf8"
LC_ADDRESS="zh_TW.utf8"
LC_TELEPHONE="zh_TW.utf8"
LC_MEASUREMENT="zh_TW.utf8"
LC_IDENTIFICATION="zh_TW.utf8"
LC_ALL=
r...@li-le01-d5:~# /usr/local/bin/python3.0 hello.py
Hello world!
r...@li-le01-d5:~#

This problem was also occurs when I try the same steps on HP-UX 11.11
and SUSE sles10.
Would you please kindly to tell me if I missed some steps when I compile
from source or some env variables from shell or some others.
The problem was strange and made me crazy.
I am very appreciated if you can tell me how to resolve it.

Thank you very much.
Leeon

--
status: pending -> open

___
Python tracker 

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



[issue6103] Static library (libpythonX.Y.a) installed in incorrect location

2009-05-24 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis 
:

When Python has been configured without --enable-shared option, then
`make install` installs $(LIBDIR)/libpythonX.Y.a and
$(LIBDIR)/pythonX.Y/config/libpythonX.Y.a (these files are identical).

When Python has been configured with --enable-shared option, then `make
install` installs $(LIBDIR)/libpythonX.Y.so and
$(LIBDIR)/pythonX.Y/config/libpythonX.Y.a.
It is inconsistent and causes using of static library instead of shared
library when a program is linked using "-L$(LIBDIR)/pythonX.Y/config -
(It was reported at https://bugs.gentoo.org/show_bug.cgi?id=252372)

I suggest to install libpythonX.Y.a only in $(LIBDIR).

--
components: Installation
files: python-2.6.2-fix_static_library_location.patch
keywords: patch
messages: 88302
nosy: Arfrever
severity: normal
status: open
title: Static library (libpythonX.Y.a) installed in incorrect location
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: 
http://bugs.python.org/file14065/python-2.6.2-fix_static_library_location.patch

___
Python tracker 

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



[issue5670] Speed up pickling of dicts in cPickle

2009-05-24 Thread Collin Winter

Collin Winter  added the comment:

Fixed the len(d) == 1 size regression. Final performance of the patch
relative to trunk:

Using Unladen Swallow's perf.py -b pickle,pickle_dict on trunk:
pickle:
Min: 2.238 -> 1.895: 18.08% faster
Avg: 2.241 -> 1.898: 18.04% faster
Significant (t=282.066701, a=0.95)

pickle_dict:
Min: 2.163 -> 1.375: 57.36% faster
Avg: 2.168 -> 1.376: 57.50% faster
Significant (t=527.668441, a=0.95)


Performance for py3k:
pickle:
Min: 2.849 -> 2.790: 2.10% faster
Avg: 2.854 -> 2.796: 2.09% faster
Significant (t=27.624303, a=0.95)

pickle_dict:
Min: 2.121 -> 1.512: 40.27% faster
Avg: 2.128 -> 1.519: 40.13% faster
Significant (t=283.406572, a=0.95)


regrtest.py -uall test_xpickle passes all backwards-compatibility tests
for trunk, and all other tests run by regrtest.py on Linux pass.

Committed as r72909 (trunk), r72910 (py3k).

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