[issue6713] Integer Long types: Performance improvement of 1.6x to 2x for base 10 conversions

2009-09-12 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
assignee:  - marketdickinson

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



[issue6108] unicode(exception) behaves differently on Py2.6 when len(exception.args) 1

2009-09-12 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

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



[issue6875] add os.close() suggestion to mkstemp documentation

2009-09-12 Thread Vincent Legoll

Vincent Legoll vincent.leg...@gmail.com added the comment:

The real question I had is why mkstemp return an os-level opened file
descriptor instead of a python file object...

--

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



[issue6894] urllib2 doesn't respect no_proxy environment (python2.6.2)

2009-09-12 Thread Raphaël Barrois

New submission from Raphaël Barrois xelnor_pyt...@melix.net:

I discovered recently that urllib2 doesn't respect the no_proxy 
environment variable on linux (and on other platforms too, I think).

Here is an example of the problem :
- Set http_proxy and no_proxy environment variables (for instance 
no_proxy=localhost)

proxy_handler = urllib2.ProxyHandler()
opener = urllib2.build_opener(proxy_handler)
urllib2.install_opener(opener)

and then open an outside url : everything is OK (urllib2 reads 
correctly http_proxy), but for localhost, it tries to open it 
through the proxy.

You would expect urllib2 to understand no_proxy, all the more since 
all the needed code is already available in urllib.

I have prepared a patch for urllib2 which does correct that bug.

I don't have other versions of python installed, so I couldn't check 
that se bug is still present there.

--
components: Library (Lib)
files: python2.6.2-urllib2-no_proxy.patch
keywords: patch
messages: 92538
nosy: xelnor
severity: normal
status: open
title: urllib2 doesn't respect no_proxy environment  (python2.6.2)
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file14880/python2.6.2-urllib2-no_proxy.patch

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



[issue6856] allow setting uid and gid when creating tar files

2009-09-12 Thread Lars Gustäbel

Lars Gustäbel l...@gustaebel.de added the comment:

I applied the patch with some more small fixes to the trunk (r74750) and
the py3k branch (r74751).

--
resolution:  - accepted
status: open - closed

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



[issue6863] Wrong linker command if CXX set to ccache g++

2009-09-12 Thread Akira Kitada

Akira Kitada akit...@gmail.com added the comment:

Aren't CC and CXX variables just for compilers?


CC
Program for compiling C programs; default `cc'.
CXX
Program for compiling C++ programs; default `g++'.

http://www.gnu.org/software/make/manual/make.html#index-CXX-848

--
nosy: +akitada

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



[issue1294959] Problems with /usr/lib64 builds.

2009-09-12 Thread Akira Kitada

Akira Kitada akit...@gmail.com added the comment:

I think this is duplicate of issue858809.

--

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



[issue1019715] distutils ignores configure's --includedir

2009-09-12 Thread Akira Kitada

Akira Kitada akit...@gmail.com added the comment:

I think this is duplicate of issue858809.

--

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



[issue6863] Wrong linker command if CXX set to ccache g++

2009-09-12 Thread Pertti Kellomäki

Pertti Kellomäki pertti.kellom...@tut.fi added the comment:

The linker is usually called via a compiler, which arranges for compiler
specific libraries to be included in the linking. See e.g. section 10.2
in the GNU Make manual:

Linking a single object file

n is made automatically from n.o by running the linker (usually called
ld) via the C compiler. The precise command used is `$(CC) $(LDFLAGS)
n.o $(LOADLIBES) $(LDLIBS)'.

--

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



[issue6873] posix_lchown: possible overflow of uid, gid

2009-09-12 Thread Martin v . Löwis

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

  You are saying that if I pass a long to the i argument parser it will
 cause a problem. But if I passed a int, it will be same as before and
 overflow will not be detected at all.  

Correct. So you should use the l argument parser.

--

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



[issue6831] 2to3 assignment division conversion

2009-09-12 Thread Jonas Byström

Jonas Byström highfest...@gmail.com added the comment:

I would like something like a regexp-replace of

def[ \t]*__idiv__\((.*?)\)

into

def __floordiv__(\1): self.__truediv__(arg[-1:] goes here)
def __truediv__(\1)

--

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



[issue6895] locale._parse_localename fails when localename does not contain encoding information

2009-09-12 Thread Santhosh Thottingal

New submission from Santhosh Thottingal santhosh.thottin...@gmail.com:

locale._parse_localename fails when the locale name is in xx_YY format.
For example when the system locale is Malayalam(India),  ml_IN we get
the following result
 locale._parse_localename(ml_IN)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /opt/python311/lib/python3.1/locale.py, line 424, in
_parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: ml_IN
The expected result is ('ml_IN', None)
For Latin languages, locale.py assumes iso-8859-15 as the encoding type
if encoding type is not given in localename. In case 
of other locales, None can be returned for encoding type.
Attached patch fixes this.
The result after applying patch to locale.py
 import locale
 locale._parse_localename(ml_IN)
('ml_IN', None)

--
components: Library (Lib)
files: locale.py-parselocale-patch.diff
keywords: patch
messages: 92546
nosy: santhosh.thottingal
severity: normal
status: open
title: locale._parse_localename fails when localename does not contain encoding 
information
type: crash
versions: Python 3.1
Added file: http://bugs.python.org/file14881/locale.py-parselocale-patch.diff

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



[issue6831] 2to3 assignment division conversion

2009-09-12 Thread Benjamin Peterson

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

That would not always be correct because __div__ implements a default
division that doesn't exist in Py3k. It's easiest to implement
__floordiv__ and __truediv__ in for 2.x for correct behavior there, too.

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

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



[issue2650] re.escape should not escape underscore

2009-09-12 Thread Björn Lindqvist

Björn Lindqvist bjou...@gmail.com added the comment:

In my app, I need to transform the regexp created from user input so
that it matches unicode characters with their ascii equivalents. For
example, if someone searches for el nino, that should match the string
el ñino. Similarly, searching for el ñino should match el nino.

The code to transform the regexp looks like this:

s = re.escape(user_input)
s = re.sub(u'n|ñ', u'[n|ñ]')
matches = list(re.findall(s, data, re.IGNORECASE|re.UNICODE))

It doesn't work because the ñ in the user_input is escaped with a
backslash. My workaround, to compensate for re.escape's to eager
escaping, is to escape re.sub pattern:

s = re.sub(u'n|ñ', u'[n|ñ]')

It works but is not very nice. It would have been much better if
re.escape worked like one could expect in the first place.

--
nosy: +bjourne

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



[issue6875] add os.close() suggestion to mkstemp documentation

2009-09-12 Thread R. David Murray

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

Because if you want the Python file object, you should use TemporaryFile
or NamedTemporaryFile.  mkstemp is a lower level (closer to the os)
interface, and is provided because Python has a philosophy of providing
those low level interfaces when possible.  Note that the TemporaryFile
classes use mkstemp in their implementation.

--

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



[issue6896] Intermittent failures in test_mailbox

2009-09-12 Thread Ezio Melotti

New submission from Ezio Melotti ezio.melo...@gmail.com:

While running test.regrtest, test_mailbox failed with the error:

test test_mailbox failed -- Traceback (most recent call last):
  File /home/wolf/py3k/Lib/test/test_mailbox.py, line 116, in 
test_discard
self.assertEqual(len(self._box), 1)
AssertionError: 2 != 1

I ran the test again several times and got intermittent failures in 
several different methods. Attached there's a file with the errors I 
got. 

During the first tests I was running test_mailbox after 
test_zipimport, but then I was able to reproduce the failures running 
test_mailbox alone.

I'm using Python 3.2a0 on Ubuntu 8.04.

--
components: Tests
files: mailboxfailures.txt
messages: 92550
nosy: ezio.melotti
priority: normal
severity: normal
status: open
title: Intermittent failures in test_mailbox
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file14882/mailboxfailures.txt

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



[issue6026] test_(zipfile|zipimport|gzip|distutils|sqlite) fail if zlib is not available

2009-09-12 Thread Ezio Melotti

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

Fixed in r74754 (trunk) and r74755 (py3k).

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

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



[issue6574] List the __future__ features in a table

2009-09-12 Thread Ezio Melotti

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


--
nosy: +georg.brandl
stage: needs patch - patch review

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



[issue6897] imaplib fails during login

2009-09-12 Thread geremy condra

New submission from geremy condra debat...@gmail.com:

Getting the following issue- this code:

#! /usr/bin/env python3

import getpass, imaplib

M = imaplib.IMAP4_SSL(imap.gmail.com)
M.login(username, password)
M.select()
typ, data = M.search(None, 'ALL')
for num in data[0].split():
typ, data = M.fetch(num, '(RFC822)')
print('Message %s\n%s\n' % (num, data[0][1]))
M.close()
M.logout()

taken almost verbatim from the documentation, produces this error:

Traceback (most recent call last):
  File ./imaptest.py, line 6, in module
M.login(username, password)
  File /usr/lib/python3.0/imaplib.py, line 514, in login
typ, dat = self._simple_command('LOGIN', user, self._quote(password))
  File /usr/lib/python3.0/imaplib.py, line 1072, in _quote
arg = arg.replace(b'\\', b'')
TypeError: Can't convert 'bytes' object to str implicitly

username and password obviously redeacted.

Changing imaplib.py's _quote function to this:

def _quote(self, arg):

arg = arg.replace('\\', '')
arg = arg.replace('', '\\')

return '' + arg + ''

seems to resolve the issue.

--
components: Library (Lib)
messages: 92552
nosy: debatem1
severity: normal
status: open
title: imaplib fails during login
versions: Python 3.0

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



[issue6574] List the __future__ features in a table

2009-09-12 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Accepted, except for two things:

* I'd drop the a0 suffix for the mandatory version. 2.2 instead of
2.2.0a0 is much better to comprehend.

* Why the ugly markup with the PEP refs? ``:pep:`number`: blah`` should
work well.

For 3k, all previous future features are still supported, so they can go
in there as well.

--
resolution:  - accepted

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



[issue5511] zipfile - add __exit__ attribute to make ZipFile object compatible with with_statement

2009-09-12 Thread Ezio Melotti

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

I think there should also be one or more tests that check if the file is
closed correctly after the __exit__, in normal conditions and possibly
in different situations (e.g. when an error is raised ).
Unlike regular file objects, ZipFile objects don't have a 'closed'
attribute, instead they set self.fp to None when the 'close' method is
called.

--
resolution:  - accepted

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



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

2009-09-12 Thread mkp

mkp mkpmkpmkp9...@gmail.com added the comment:

on python2.5 / mac os x 10.5.7:

$ cat main.c
#include stdio.h
#include python.h

int main()
{
int i;
for (i=0; i10; i++)
{
printf(--- %d ---\n, i);
Py_Initialize();
PyRun_SimpleString(import ctypes);
Py_Finalize();
}
return 0;
}

$ gcc -I/usr/include/python2.5/ -L/usr/lib/python2.5/ -lpython main.c
$ ./a.out 
--- 0 ---
--- 1 ---
--- 2 ---
--- 3 ---
Assertion failed: (type-tp_flags  Py_TPFLAGS_HEAPTYPE), function 
type_dealloc, file Objects/typeobject.c, line 2148.
Abort trap
$ uname -mprsv
Darwin 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; 
root:xnu-1228.12.14~1/RELEASE_I386 i386 i386

--
nosy: +mkp

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



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-12 Thread Alan Isaac

Alan Isaac alan.is...@gmail.com added the comment:

Since you are working on this, can you see if 
http://bugs.python.org/issue6108 
is related or in any case can be fixed at the same time?

Thanks.

--

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



[issue6898] Unicode Error

2009-09-12 Thread vitvn

New submission from vitvn caothucodon...@gmail.com:

viet= â ă á à ấ ầ ắ ằ ạ ậ  ặ 

print(viet)


Traceback (most recent call last):
  File tiengviet.py, line 4, in module
print(viet)
  File I:\python\python.v3.1_portable\App\lib\encodings\cp1252.py,
line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0103' in
position 2: character maps to undefined
Exit code: 1

how to fix it ?

--
components: Unicode
messages: 92557
nosy: vitvn
severity: normal
status: open
title: Unicode  Error
versions: Python 3.1

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



[issue6898] Unicode Error

2009-09-12 Thread Benjamin Peterson

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

Change your terminal's encoding.

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

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



[issue6898] Unicode Error

2009-09-12 Thread Ezio Melotti

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

It looks like you are using the Windows terminal, that, afaik, is not
able to display the characters you are trying to print. This is because
its default encoding - cp1252 - can encode only a small subset of the
Unicode characters.
If changing the encoding of the terminal doesn't work, you can try to
use a better terminal or IDLE instead.

--
nosy: +ezio.melotti

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



[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

2009-09-12 Thread Ezio Melotti

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

I fixed the machine and tried the file that you uploaded, but nothing 
changed. This is what I used (traceback.print_exc() prints to stderr, 
so the traceback should be visible):
$ while ./python Lib/test/regrtest.py -v test_docxmlrpc.py; do :; done 
 /dev/null
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:
...

--

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



[issue6108] unicode(exception) behaves differently on Py2.6 when len(exception.args) 1

2009-09-12 Thread Jean-Paul Calderone

Jean-Paul Calderone exar...@divmod.com added the comment:

Perhaps also worth noting is that in Python 2.4 as well, str(exception)
and unicode(exception) returned the same thing.  Unlike some other
exception changes in 2.6, this doesn't seem to be a return to older
behavior, but just a new behavior.  (Or maybe no one cares about that;
just wanted to point it out, though.)

--
nosy: +exarkun

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



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-12 Thread Jean-Paul Calderone

Jean-Paul Calderone exar...@divmod.com added the comment:

FWIW, I'm waiting to hear about the acceptability of adding fields to
the exception structure(s) before I work on this patch.

--

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



[issue6844] BaseException DeprecationError raises inappropriately

2009-09-12 Thread Ezio Melotti

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


--
nosy: +ezio.melotti

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