[issue4815] idle 3.1a1 utf8

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

IDLE is right to save the file as UTF-8; the file is invalid Python 3.0
code. In Python 3.0, the source encoding *is* UTF-8; nothing else is
allowed unless you have an encoding declaration.

Perhaps IDLE should offer to convert it on opening.

--
nosy: +loewis

___
Python tracker 

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



[issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> OK cool, that's the development strategy we've already adopted. Is this
> limitation of Python's garbage collector in relation to real-time
> applications documented anywhere?

Why do you ask? (this is OT for the bug tracker)
It's not in the Python documentation. However, any good
book on real-time systems will tell you that garbage collection
is a problem.

___
Python tracker 

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



[issue3638] tkinter.mainloop() is meaningless and crash: remove it

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

The patch is incorrect. Tkapp_Mainloop is supposed to work both as a
module function and a method, and it tests for self to find out which
case it is. Now, this test is apparently broken in 3.x, but that could
be fixed, instead of ripping the module function out. Or, if that
function is removed, the code to support it should also be removed.

The same issue probably also affects other functions that double both as
instance methods and module functions.

--
nosy: +loewis

___
Python tracker 

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



[issue4805] Make python code compilable with a C++ compiler

2009-01-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Removed file: http://bugs.python.org/file12530/c++-patch-1.diff

___
Python tracker 

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



[issue4805] Make python code compilable with a C++ compiler

2009-01-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Added file: http://bugs.python.org/file12560/c++-patch-2.diff

___
Python tracker 

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



[issue4008] IDLE: checksyntax() doesn't support Unicode?

2009-01-02 Thread Pavel Kosina

Pavel Kosina  added the comment:

I vote for fixing this too. This might be simplified/another example of
above mentioned issues:

# -*- coding: utf-8 -*-
print ("ěščřžýáíé")

in IDLE prints this:
>>> 
ěščřžýáíé

When running this script under python command line from another editor,
I get the output readable as expected.

--
nosy: +geon

___
Python tracker 

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



[issue4815] idle 3.1a1 utf8

2009-01-02 Thread Pavel Kosina

New submission from Pavel Kosina :

When you open file without encoding declaration, make changes and save,
then IDLE changes without any question encodings to utf8. You can try it
on attached file that is cp1250 now. 

It could be that at first saving we are asked to use 
*utf8 
*current one.

--
components: IDLE
files: cp1250.py
messages: 78932
nosy: geon
severity: normal
status: open
title: idle 3.1a1 utf8
versions: Python 3.1
Added file: http://bugs.python.org/file12559/cp1250.py

___
Python tracker 

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



[issue4796] Decimal to receive from_float method

2009-01-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

See attached patch for Py27.

--
keywords: +patch
Added file: http://bugs.python.org/file12558/decimal.diff

___
Python tracker 

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



[issue4626] compile() doesn't ignore the source encoding when a string is passed in

2009-01-02 Thread Brett Cannon

Brett Cannon  added the comment:

So explicitly converting to UTF-8 didn't work, or at least as simply as
I had hoped.

___
Python tracker 

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



[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2009-01-02 Thread Nick Coghlan

Nick Coghlan  added the comment:

Finally got around to looking at the most recent patch
(issue4580-2.patch). It looks good to me.

I still think something needs to change when it comes to item assignment
for memoryviews with itemsize > 1, but that's not as urgent as fixing
the rest of the slicing behaviour (and probably should be a different
issue).

___
Python tracker 

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



[issue4805] Make python code compilable with a C++ compiler

2009-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Fri, Jan 2, 2009 at 10:54 AM, Marc-Andre Lemburg
 wrote:
>
> Marc-Andre Lemburg  added the comment:
>
> Also note that by removing the extern "C" declarations, you not only
> change the exported symbol names of functions, but also those of
> exported globals.
>
What are " exported globals" other than "exported symbol names of
functions"?  AFAIK, C++ does not mangle non-function symbols.

> Those would also have to get declared in the header files, to prevent
> their names from being mangled (causing the exported C API to change).

I believe .c files should only contain static functions and functions
that are declared in an included header file.  If a function that is
not advertised in a header, it is not part of API and it is a fair
game to mangle it.  The only exception is the module init functions
that are part of the ABI rather than API.

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

ebfe> Here is another patch, this time for the fallback-md5-module

Please open a separated issue for each module, this issue is already 
too long and complex ;-) And it would be easier to fix other modules 
when patches for hashlib will be accepted ;-)

___
Python tracker 

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



[issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects

2009-01-02 Thread darrenr

darrenr  added the comment:

OK cool, that's the development strategy we've already adopted. Is this
limitation of Python's garbage collector in relation to real-time
applications documented anywhere?

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Paolo 'Blaisorblade' Giarrusso

Paolo 'Blaisorblade' Giarrusso  added the comment:

> I'm not an expert in this kind of optimizations. Could we gain more
speed by making the dispatcher table more dense? Python has less than
128 opcodes (len(opcode.opmap) == 113) so they can be squeezed in a
smaller table. I naively assume a smaller table increases the amount of
cache hits.

Well, you have no binary compatibility constraint with a new release, so
it can be tried and benchmarked, or it can be done anyway!
On x86_64 the impact of the jump table is 8 bytes per pointer * 256
pointers = 2KiB, and the L1 data cache of Pentium4 can be 8KiB or 16KiB
wide.
But I don't expect this to be noticeable in most synthetic
microbenchmarks. Matrix multiplication would be the perfect one I guess;
the repeated column access would kill the L1 data cache, if the whole
matrixes don't fit.

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread ebfe

ebfe  added the comment:

Here is another patch, this time for the fallback-md5-module. I know
that situations are rare where openssl is not present but threading is.
However they might occur out there and the md5module needed some love
anyway:

- The MD5 class from the fallback module can now also use threads with
'small locks'
- The behaviour regarding unicode data input is now consistent as to
what the openssl-driven classes do.
- Some code cleanup.


I might act on the sha modules as way the next days. sha256.c still
accepts 's#'...

I might a

Added file: http://bugs.python.org/file12557/md5module_small_locks.diff

___
Python tracker 

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



[issue3959] Add Google's ipaddr.py to the stdlib

2009-01-02 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy:  -haypo

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Paolo 'Blaisorblade' Giarrusso

Paolo 'Blaisorblade' Giarrusso  added the comment:

About miscompilations: the current patch is a bit weird for GCC, because
you keep both the switch and the computed goto.

But actually, there is no case in which the switch is needed, and
computed goto give less room to GCC's choices.

So, can you try dropping the switch altogether, using always computed
goto and seeing how does the resulting code get compiled? I see you'll
need two labels (before and after argument fetch) per opcode and two
dispatch tabels, but that's no big deal (except for code alignment -
align just the common branch target).

An important warning is that by default, on my system, GCC 4.2 aligns
branch targets for switch to a 16-byte boundary (as recommended by the
Intel optimization guide), by adding a ".p2align 4,,7" GAS directive,
and it does not do that for computed goto.

Adding the directive by hand gave a small speedup, 2% I think; I should
try -falign-jumps=16 if it's not enabled (some -falign-jumps is enabled
by -O2), since that is supposed to give the same result.

Please use that yourself as well, and verify it works for labels, even
if I fear it doesn't.

> However, I don't know why the speed up due to the patch is much
more significant on x86-64 than on x86.

It's Amdahl's law, even if this is not about parallel code. When the
rest is faster (x86_64), the same speedup on dispatch gives a bigger
overall speedup.

To be absolutely clear: x86_64 has more registers, so the rest of the
interpreter is faster than x86, but dispatch still takes the same
absolute time, which is 70% on x86_64, but only 50% on x86 (those are
realistic figures); if this patch halved dispatch time on both (we're
not so lucky), we would save 35% on x86_64 but only 25% on x86.
In fact, on inefficient interpreters, indirect threading is useless
altogether.

So, do those extra register help _so_ much? Yes. In my toy interpreter,
computing last_i for each dispatch doesn't give any big slowdown, but
storing it in f->last_i gives a ~20% slowdown - I cross-checked multiple
times because I was astonished. Conversely, when the program counter had
to be stored in memory, I think it was like 2x slower.

___
Python tracker 

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



[issue4705] python3.0 -u: unbuffered stdout

2009-01-02 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12478/unbufferedstdout-3.patch

___
Python tracker 

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



[issue4705] python3.0 -u: unbuffered stdout

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

> Instead of importing IO each time in create_stdio, 
> maybe you should just pass io.open to create_stdio

create_stdio() uses io.open() but also io.TextIOWrapper. Since io 
module is already imported in initstdio(), I updated the patch to just 
pass the pointer to the module to create_stdio().

Added file: http://bugs.python.org/file12556/unbufferedstdout-4.patch

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Christian Heimes

Christian Heimes  added the comment:

> Alexandre Vassalotti  added the comment:
> The patch make a huge difference on 64-bit Linux. I get a 20% speed-up
> and the lowest run time so far. That is quite impressive!

I'm really, REALLY impressed by the speed up. Good work!

I'm not an expert in this kind of optimizations. Could we gain more
speed by making the dispatcher table more dense? Python has less than
128 opcodes (len(opcode.opmap) == 113) so they can be squeezed in a
smaller table. I naively assume a smaller table increases the amount of
cache hits.

Christian

___
Python tracker 

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



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Christopher Mahan

Christopher Mahan  added the comment:

When running scritp with python 2.5.4, got this error. I'll remove the
"timeout=2" and run again. see below.

Traceback (most recent call last):
  File "C:\python_scripts\python3\candee_processor.py", line 3, in 
ftp = ftplib.FTP('ftp.edgecastcdn.net',
user='clie...@arcostream.com', passwd='1210184520', timeout=2)
TypeError: __init__() got an unexpected keyword argument 'timeout'

Same without the timeout argument:

>>> 
*cmd* 'CWD chrismahan-675'
*put* 'CWD chrismahan-675\r\n'
*get* '250 CWD command successful\r\n'
*resp* '250 CWD command successful'
*cmd* 'TYPE A'
*put* 'TYPE A\r\n'
*get* '200 Type set to A\r\n'
*resp* '200 Type set to A'
*cmd* 'PASV'
*put* 'PASV\r\n'
*get* '227 Entering Passive Mode (72,21,82,190,228,195).\r\n'
*resp* '227 Entering Passive Mode (72,21,82,190,228,195).'
*cmd* 'LIST'
*put* 'LIST\r\n'
*get* '150 Opening ASCII mode data connection for file list\r\n'
*resp* '150 Opening ASCII mode data connection for file list'
*retr* '-rwxrwxrwx   1 nobody   nogroup   3905538 Dec 29 09:51 Bronski
Beat - Why.mp3\r\n'
-rwxrwxrwx   1 nobody   nogroup   3905538 Dec 29 09:51 Bronski Beat -
Why.mp3
*retr* '-rwxrwxrwx   1 nobody   nogroup873966 Dec 28 13:53
test9.avi\r\n'
-rwxrwxrwx   1 nobody   nogroup873966 Dec 28 13:53 test9.avi
*retr* '-rwxrwxrwx   1 nobody   nogroup   2512653 Dec 29 08:28
test9_lg.wmv\r\n'
-rwxrwxrwx   1 nobody   nogroup   2512653 Dec 29 08:28 test9_lg.wmv
*retr* '-rwxrwxrwx   1 nobody   nogroup  6549 Dec 29 08:28
test9_lg.wmv.jpg\r\n'
-rwxrwxrwx   1 nobody   nogroup  6549 Dec 29 08:28 test9_lg.wmv.jpg
*retr* '-rwxrwxrwx   1 nobody   nogroup   1788466 Dec 29 03:04
test9_med.flv\r\n'
-rwxrwxrwx   1 nobody   nogroup   1788466 Dec 29 03:04 test9_med.flv
*retr* '-rwxrwxrwx   1 nobody   nogroup  6394 Dec 29 03:04
test9_med.flv.jpg\r\n'
-rwxrwxrwx   1 nobody   nogroup  6394 Dec 29 03:04 test9_med.flv.jpg
*retr* '-rwxrwxrwx   1 nobody   nogroup   1263041 Dec 28 13:53
test9_sm.flv\r\n'
-rwxrwxrwx   1 nobody   nogroup   1263041 Dec 28 13:53 test9_sm.flv
*retr* '-rwxrwxrwx   1 nobody   nogroup  6465 Dec 28 13:53
test9_sm.flv.jpg\r\n'
-rwxrwxrwx   1 nobody   nogroup  6465 Dec 28 13:53 test9_sm.flv.jpg
*retr* ''
*get* '226 Transfer complete\r\n'
*resp* '226 Transfer complete'
>>>

___
Python tracker 

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



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

Christopher: Can you paste the full output with debuglevel=3 of Python 
2.x (python2.5)?

___
Python tracker 

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



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

The traceback shows that the problem is not related to the socket 
created to retrieve the content of the directory listing, but 
the "main" socket (the one used for the whole ftp session) used by 
dir() command the retrieve the command answer code:

   Traceback (most recent call last):
 ftp.dir()
  => self.retrlines(cmd, func)
  => return self.voidresp()
  => line = self.getline()
  => line = self.file.readline() (ftplib.py:184)
  ...
socket.timeout: timed out

I don't understand why the readline() blocks. It's maybe related to 
the newline: voidresp() uses getline() which reads a line using 
self.file. The file is created by self.sock.makefile('r', 
encoding=self.encoding) and so the newline is always \n whereas ftplib 
of Python2 uses \r\n (CRLF) or \n (LF).

___
Python tracker 

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



[issue4626] compile() doesn't ignore the source encoding when a string is passed in

2009-01-02 Thread Brett Cannon

Brett Cannon  added the comment:

Here is what I have found out so far.
Python/bltinmodule.c:builtin_compile takes in a PyObject and gets the
char * representation of that object and passes it to
Python/pythonrun.c:Py_CompileStringFlags. Unfortunately no other
information is passed along in the call, including what the encoding
happens to be. This is unfortunate as builtin_compile makes sure that
the char* data is encoded using the default encoding before calling
Py_CompileStringFlags.

I just tried setting a PyCF flag to denote that the char* data is
encoded using the default encoding, but Parser/tokenizer.c is not
compiled against unicodeobject.c and thus one cannot use
PyUnicode_GetDefaultEncoding() to know what the data is stored as.

I'm going to try to explicitly convert to UTF-8 and see if that works.

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Skip Montanaro

Changes by Skip Montanaro :


Added file: http://bugs.python.org/file12555/ceval.i.threaded

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

> haypo, the patch will not compile when WITH_THREADS is not defined.

Ooops, fixed (patch version 3).

Added file: http://bugs.python.org/file12554/hashlibopenssl_small_lock-3.patch

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Skip Montanaro

Skip Montanaro  added the comment:

Alexandre's last comment reminded me I forgot to post the PPC assembler
code.  Next two files are the output as requested by Antoine.

Added file: http://bugs.python.org/file12553/ceval.i.unthreaded

___
Python tracker 

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



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Christopher Mahan

Christopher Mahan  added the comment:

Per Giampaolo's suggestion, I added the timeout. Program listing and
output below:

-begin listing
import ftplib

ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername',
passwd='thepassword', timeout=2)
ftp.set_debuglevel(3)
ftp.cwd('chrismahan-675')
ftp.dir()
#ftp.retrlines('LIST')
ftp.close()
end listing

*cmd* 'CWD chrismahan-675'
*put* 'CWD chrismahan-675\r\n'
*get* '250 CWD command successful\n'
*resp* '250 CWD command successful'
*cmd* 'TYPE A'
*put* 'TYPE A\r\n'
*get* '200 Type set to A\n'
*resp* '200 Type set to A'
*cmd* 'PASV'
*put* 'PASV\r\n'
*get* '227 Entering Passive Mode (72,21,82,190,172,22).\n'
*resp* '227 Entering Passive Mode (72,21,82,190,172,22).'
*cmd* 'LIST'
*put* 'LIST\r\n'
*get* '150 Opening ASCII mode data connection for file list\n'
*resp* '150 Opening ASCII mode data connection for file list'
*retr* '-rwxrwxrwx   1 nobody   nogroup   3905538 Dec 29 09:51 Bronski
Beat - Why.mp3\n'
-rwxrwxrwx   1 nobody   nogroup   3905538 Dec 29 09:51 Bronski Beat -
Why.mp3
*retr* '-rwxrwxrwx   1 nobody   nogroup873966 Dec 28 13:53 test9.avi\n'
-rwxrwxrwx   1 nobody   nogroup873966 Dec 28 13:53 test9.avi
*retr* '-rwxrwxrwx   1 nobody   nogroup   2512653 Dec 29 08:28
test9_lg.wmv\n'
-rwxrwxrwx   1 nobody   nogroup   2512653 Dec 29 08:28 test9_lg.wmv
*retr* '-rwxrwxrwx   1 nobody   nogroup  6549 Dec 29 08:28
test9_lg.wmv.jpg\n'
-rwxrwxrwx   1 nobody   nogroup  6549 Dec 29 08:28 test9_lg.wmv.jpg
*retr* '-rwxrwxrwx   1 nobody   nogroup   1788466 Dec 29 03:04
test9_med.flv\n'
-rwxrwxrwx   1 nobody   nogroup   1788466 Dec 29 03:04 test9_med.flv
*retr* '-rwxrwxrwx   1 nobody   nogroup  6394 Dec 29 03:04
test9_med.flv.jpg\n'
-rwxrwxrwx   1 nobody   nogroup  6394 Dec 29 03:04 test9_med.flv.jpg
*retr* '-rwxrwxrwx   1 nobody   nogroup   1263041 Dec 28 13:53
test9_sm.flv\n'
-rwxrwxrwx   1 nobody   nogroup   1263041 Dec 28 13:53 test9_sm.flv
*retr* '-rwxrwxrwx   1 nobody   nogroup  6465 Dec 28 13:53
test9_sm.flv.jpg\n'
-rwxrwxrwx   1 nobody   nogroup  6465 Dec 28 13:53 test9_sm.flv.jpg
*retr* ''
Traceback (most recent call last):
  File "C:\python_scripts\python3\candee_processor.py", line 6, in 
ftp.dir()
  File "c:\python30\lib\ftplib.py", line 511, in dir
self.retrlines(cmd, func)
  File "c:\python30\lib\ftplib.py", line 433, in retrlines
return self.voidresp()
  File "c:\python30\lib\ftplib.py", line 225, in voidresp
resp = self.getresp()
  File "c:\python30\lib\ftplib.py", line 211, in getresp
resp = self.getmultiline()
  File "c:\python30\lib\ftplib.py", line 197, in getmultiline
line = self.getline()
  File "c:\python30\lib\ftplib.py", line 184, in getline
line = self.file.readline()
  File "C:\Python30\lib\io.py", line 1813, in readline
while self._read_chunk():
  File "C:\Python30\lib\io.py", line 1560, in _read_chunk
input_chunk = self.buffer.read1(self._CHUNK_SIZE)
  File "C:\Python30\lib\io.py", line 994, in read1
self._peek_unlocked(1)
  File "C:\Python30\lib\io.py", line 981, in _peek_unlocked
current = self.raw.read(to_read)
  File "C:\Python30\lib\io.py", line 575, in read
n = self.readinto(b)
  File "C:\Python30\lib\socket.py", line 214, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

About HASHLIB_GIL_MINSIZE, I'm unable to mesure the overhead. I tried 
timeit with 8190 and 8200 but the results are *very* close. I'm 
running Linux, it's maybe different on other OS.

___
Python tracker 

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



[issue4814] ftplib does not honour "timeout" parameter for active data connections

2009-01-02 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

When using the optional ftplib.FTP()'s timeout parameter which 
specifies a timeout in seconds for blocking operations like the 
connection attempt, it is applied on both FTP control and passive data 
channel (if any).
It is not applied for active (PORT/EPRT) data connections.
The patch in attachment modifies ftplib so that when ntransfer method 
is called in active mode, timeout is applied on the resulting data 
connection.

--
files: ftplib.patch
keywords: patch
messages: 78912
nosy: giampaolo.rodola
severity: normal
status: open
title: ftplib does not honour "timeout" parameter for active data connections
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file12552/ftplib.patch

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

One more thing, the patch causes the following warnings to be emited by
GCC when USE_COMPUTED_GOTOS is undefined.  

Python/ceval.c: In function ‘PyEval_EvalFrameEx’:
Python/ceval.c:2420: warning: label ‘_make_function’ defined but not used
Python/ceval.c:2374: warning: label ‘_call_function_var_kw’ defined but
not used
Python/ceval.c:2280: warning: label ‘_setup_finally’ defined but not used

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

The patch make a huge difference on 64-bit Linux. I get a 20% speed-up
and the lowest run time so far. That is quite impressive!

At first glance, it seems the extra registers of the x86-64 architecture
permit GCC to avoid spilling registers onto the stack (see assembly just
below). However, I don't know why the speed up due to the patch is much
more significant on x86-64 than on x86.

This is the x86 assembly generated by GCC 4.3 (annotated and
slightly edited for readability):

movl-440(%ebp), %eax  # tmp = next_instr
movl$145, %esi# opcode = LIST_APPEND
movl8(%ebp), %ecx # f
subl-408(%ebp), %eax  # tmp -= first_instr
movl%eax, 60(%ecx)# f->f_lasti = tmp
movl-440(%ebp), %ebx  # next_instr
movzbl  (%ebx), %eax  # tmp = *next_instr
addl$1, %ebx  # next_instr++
movl%ebx, -440(%ebp)  # next_instr
movlopcode_targets(,%eax,4), %eax  # tmp = opcode_targets[tmp]
jmp *%eax # goto *tmp


And this is the x86-64 assembly generated also by GCC 4.3:

movl%r15d, %eax  # tmp = next_instr
subl76(%rsp), %eax   # tmp -= first_instr
movl$145, %ebp   # opcode = LIST_APPEND
movl%eax, 120(%r14)  # f->f_lasti = tmp
movzbl  (%r15), %eax # tmp = *next_instr
addq$1, %r15 # next_instr++
movqopcode_targets(,%rax,8), %rax  # tmp = opcode_targets[tmp]
jmp *%rax# goto *tmp


The above assemblies are equivalent to the following C code:

opcode = LIST_APPEND;
f->f_lasti = ((int)(next_instr - first_instr));
goto *opcode_targets[*next_instr++];

On the register-starved x86 architecture, the assembly has 4 stack load
and 1 store operations. While on the x86-64 architecture, most variables
are kept in registers thus it only uses 1 stack store operation. And
from what I saw from the assemblies, the extra registers with the
traditional switch dispatch aren't much used, especially with the opcode
prediction macros which avoid manipulations of f->f_lasti.

That said, I am glad to hear the patch makes Python on PowerPC faster,
because this supports the hypothesis that extra registers are better
used with indirect threading (PowerPC has 32 general-purpose registers).

Added file: http://bugs.python.org/file12551/amd-athlon64-x2-64bit-pybench.txt

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread ebfe

ebfe  added the comment:

haypo, the patch will not compile when WITH_THREADS is not defined. The
'lock'-member in the object structure is not present without
WITH_THREADS however the line 'if (self->lock == NULL && view.len >=
HASHLIB_GIL_MINSIZE)' will always refer to it.

___
Python tracker 

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



[issue3959] Add Google's ipaddr.py to the stdlib

2009-01-02 Thread pmoody

pmoody  added the comment:

> That is not sufficient for inclusion to Python. We also want support
> from the author (along with a promise to eventually give up the external
> project).

As Guido had mentioned in a previous message, this is along the lines
of my thinking wrt ipaddr.

Cheers,
/peter

___
Python tracker 

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



[issue4812] Junk in the decimals namespace

2009-01-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Let's spell them out:  _Infinity, _NegativeInfinity, _NaN, and
_SignedInfinity.

___
Python tracker 

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



[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

> By the password database, I mean /etc/passwd or replacements that
> are accessible via getpwnam() and friends.  Users are often
> allowed to change things like the GECOS field, and can generally
> stick any old junk in there, regardless of encoding.

I started to patch pwd module to return bytes instead of unicode, but I didn't 
finished my work and the lost it :-/ Today, most UNIX uses UTF-8 as the 
default charset. About GECOS: is it really used? If you have real problems, 
open a new issue as proposed by Martin.

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread ebfe

ebfe  added the comment:

I don't think so.

The interface should stay simple - python has very few such magic knobs.
People will optimize for their own box as you said - and that code will
run worse on all the others...

Besides, we've lived so long with single-threaded openssl. Let's make
HASHLIB_GIL_MINSIZE such that there is no risk of additional overhead
introduced by this patch and refer to it's current value in the
hashlib-module's documentation.

___
Python tracker 

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



[issue4813] On OS-X the directories searched by setup.py for Tk are in the wrong order.

2009-01-02 Thread Mitchell Model

New submission from Mitchell Model :

In function detect_tkinter_darwin of setup.py framework_dirs should be 
the reverse of what it is: first the user's library should be searched, 
then /Library, and finally /System/Library.  If Tk 8.5 is installed in 
/Library or ~/Library make will otherwise find the headers from 8.4 but 
the libraries from 8.5.

Issue 4017 discusses this problem, among others, and is marked fixed, 
but it is still incorrect in the 2.6 and 3.0 downloads as well as in the 
trunk, 3.0, and 3.1 subversion repositories.  It may have been "fixed" 
in so far as someone was able to make a .dmg by manually altering 
setup.py, and that's great, but it isn't fixed in the source and the 
problem will reappear with each new version.

--
components: Build
messages: 78904
nosy: MLModel
severity: normal
status: open
title: On OS-X the directories searched by setup.py for Tk are in the wrong 
order.
type: compile error
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker 

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



[issue4705] python3.0 -u: unbuffered stdout

2009-01-02 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12477/unbufferedstdout-2.patch

___
Python tracker 

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



[issue4811] invalid reST markup in several documents

2009-01-02 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

I did a search on the .html files using a regular expression, and 
manually filtered out the false positives.
The expression used was this "::[^=]|:[a-zA-Z][a-zA-Z0-9]+|`|\.\.\s*\w
+:"
I'll try to come up with a useable tool.

___
Python tracker 

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



[issue4812] Junk in the decimals namespace

2009-01-02 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fine.  Will re-rename in the morning.  Are _Inf, _negInf, _NaN and 
_Infsign okay as they are?

___
Python tracker 

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



[issue4812] Junk in the decimals namespace

2009-01-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks.  BTW, my preferred new names are _One _Zero and _NegativeOne.
Names like dec_n1 are cryptic in places other than where they're defined.

___
Python tracker 

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



[issue4812] Junk in the decimals namespace

2009-01-02 Thread Mark Dickinson

Mark Dickinson  added the comment:

I assume you're referring to Dec_0 and friends?

Fixed in the trunk in r68182.  Leaving open until I get the chance to 
merge it to the other branches.

--
resolution:  -> fixed
versions:  -Python 2.7

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Skip Montanaro

Skip Montanaro  added the comment:

Antoine> Ok, so the threaded version is actually faster by 20% on your
Antoine> PPC, and slower by 5% on your Core 2 Duo. Thanks for doing the
Antoine> measurements!

Confirmed by pystone runs as well.  Sorry for the earlier misdirection.

Skip

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> OK, I think I'm misreading the output of pybench.  Let me reset.  Ignore
> anything I've written previously on this topic.  Instead, I will just
> post the output of my pybench comparison runs and let more expert people
> interpret as appropriate.  The first file is the result of the run on
> PowerPC (Mac G5).

Ok, so the threaded version is actually faster by 20% on your PPC, and
slower by 5% on your Core 2 Duo. Thanks for doing the measurements!

___
Python tracker 

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



[issue4804] Python on Windows disables all C runtime library assertions

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> Can anyone point me at a test that failed in this case?

See issue 1350409 (and subsequently #1167262 and #1311784). Python
fails to start when assertions are turned on (haven't tested for
VS 2008, though).

If you were looking for a test case that fails specifically - there
might none. However, try Amaury's example.

> On the broader point, it could be argued that if it is the apps
> responsibility to re-enable assertions, it is also the apps
> responsibility to disable them in the first place.

Ideally, assertions should be enabled in debug builds, and disabled
in release builds, and there should be no runtime configuration.
Unfortunately, Microsoft chose to add bogus assertions, so this general
rule is useless within the context of MSC.

(it's not just that the signal issue is a standards violation. Assuming
that _close apparently follows POSIX close, it should always set
errno to EBADF for a double-close, rather than raising an assertion. It
is conforming in release mode, but loses conformance in debug mode)

> From
> a pragmatic POV, if we know the MS crt asserts on certain constants
> signal numbers, can't we just avoid passing those numbers?

It's the other way 'round: it rejects all but a list of known signals.
Still, it would be possible to hack around - one such hack is currently
implemented.

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

First:  thanks for doing this.  I've had a patch sitting in my own
sandbox to release the GIL while hashing for a while but I hadn't
finished testing it.  It looks pretty similar to what you've done so
lets go with the patch being developed in this issue.

Rather than making HASHLIB_GIL_MINSIZE a constant I suggest making it a
property of the hash object so that it can be set by the user.  Most
users will be fine with the default but depending upon the application,
platform and hash algorithm being used other values may make more sense.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue1581476] Text search gives bad count if called from variable trace

2009-01-02 Thread Guilherme Polo

Guilherme Polo  added the comment:

Fixed the issue now.
_tkinter.call needs to use the TCL_EVAL_GLOBAL flag since all the
variables in Tkinter are global variables.

Matthias: your issue about the pattern should be placed in a different
issue.

--
keywords: +patch
versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 -Python 2.4
Added file: http://bugs.python.org/file12550/issue_1581476.diff

___
Python tracker 

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



[issue4812] Junk in the decimals namespace

2009-01-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Mark, it looks like r59144 merely moved these around and that they
existed beforehand.  Can we go ahead and get them renamed?  They are
defeating the extensive efforts we've made to keep that namespace free
of anything that isn't part of the documented spec.

--
assignee: facundobatista -> marketdickinson
nosy: +marketdickinson

___
Python tracker 

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



[issue4812] Junk in the decimals namespace

2009-01-02 Thread Raymond Hettinger

New submission from Raymond Hettinger :

In r59144 , a bunch of internal-use constants were dumped in the main
namespace.  These all need to be prefixed with an underscore.  

They should be fixed right-away before people start using them.  Since
they are externally undocumented and since the internal notes describe
them as being only for internal-use, I think this can go in as a bugfix.

--
assignee: facundobatista
components: Library (Lib)
messages: 78893
nosy: facundobatista, rhettinger
priority: high
severity: normal
status: open
title: Junk in the decimals namespace
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker 

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



[issue4804] Python on Windows disables all C runtime library assertions

2009-01-02 Thread Mark Hammond

Mark Hammond  added the comment:

Can anyone point me at a test that failed in this case?  A quick look
over winsig.c shows no asserts.  I didn't compare the vs2005 crt source
though, so its highly likely I just missed it...

On the broader point, it could be argued that if it is the apps
responsibility to re-enable assertions, it is also the apps
responsibility to disable them in the first place.  If other libraries
on the system attempted the same as Python, it would obviously be
undefined if Python's attempt had any actual affect - the last called
would win.  As we found with the old locale() issues, we really can't
rely on Python setting a global shared state to keep things nice.  From
a pragmatic POV, if we know the MS crt asserts on certain constants
signal numbers, can't we just avoid passing those numbers?

___
Python tracker 

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



[issue2827] IDLE 3.0a5 cannot handle UTF-8

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> Moreover: do you think its good idea to change the file encoding at
> opened and then saved file without any question when there is no
> encoding declaration?

See my previous comment: one issue at a time. This issue was about
code that IDLE 3.0a5 cannot parse, but IDLE 3.0 can. If you have
a further issue with the proposed solution, please report it separately.

> Users do not edit just python programs, they
> can edit also config files, text files, etc 

I don't think IDLE was designed to support editing any other files.
I would be opposed to adding user interface relevant only for editing
non-Python text files. If IDLE would assume a different encoding at save
time than was assumed at load time, this might be still considered
a bug; you would need to provide detailed instructions to reproduce
such a bug.

___
Python tracker 

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



[issue4566] 2.6.1 breaks many applications that embed Python on Windows

2009-01-02 Thread Mark Hammond

Mark Hammond  added the comment:

Uploading a corrected patch; some old docs I saw said DWORD, and I
obviously neglected to fix every spot I used that, and I've changed
'Vista' to 'XP' in the patch comments.

Added file: http://bugs.python.org/file12549/bug4566.patch

___
Python tracker 

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



[issue4566] 2.6.1 breaks many applications that embed Python on Windows

2009-01-02 Thread Mark Hammond

Changes by Mark Hammond :


Removed file: http://bugs.python.org/file12537/bug4566.patch

___
Python tracker 

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



[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> By the password database, I mean /etc/passwd or replacements that
> are accessible via getpwnam() and friends. 

Please only discuss one issue at the time in the bug tracker. This
issue is about "invalidly-encoded command-line arguments", not about
the password database. If you want to report an issue with the password
database, please do so in a separate report.

___
Python tracker 

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



[issue2827] IDLE 3.0a5 cannot handle UTF-8

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> Thank you. Not sure, what to do now, cause the putting down of IDLE is
> fixed, but still within IDLE I get wrong output:

In general, when a reported issue is closed, and you have a further
issue, the right thing is to report this as a new issue, rather than
following up on closed one.

In the specific case, I believe you are referring to issue 4008, and
its duplicates #4410, and #4623. There might be more duplicate reports,
so no need to report yet another one.

___
Python tracker 

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



[issue2827] IDLE 3.0a5 cannot handle UTF-8

2009-01-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Well, if you're still using 3.0, it's not patched yet. :)

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue4705] python3.0 -u: unbuffered stdout

2009-01-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Instead of importing IO each time in create_stdio, maybe you should just
pass io.open to create_stdio.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue2827] IDLE 3.0a5 cannot handle UTF-8

2009-01-02 Thread Pavel Kosina

Pavel Kosina  added the comment:

Moreover: do you think its good idea to change the file encoding at
opened and then saved file without any question when there is no
encoding declaration? :-( Users do not edit just python programs, they
can edit also config files, text files, etc 

It could be that at first saving we are asked to use 
*utf8 
*used one.

___
Python tracker 

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



[issue4793] Glossary incorrectly describes a decorator as "merely syntactic sugar"

2009-01-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Based on my reading of the pydev discussion, the doc correctly describes
the design intent.  If there is any bug, it is in the optimization of
skipping the apparently redundant first name binding.  I presume the
thinking was that since the decorator gets the function as an input,
there is no sensible need to access it again via its name.  A conforming
implementation should be free to not do this optimization, but to simply
make the easy and obvious translation.

--
nosy: +tjreedy

___
Python tracker 

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



[issue1533] Bug in range() function for large values

2009-01-02 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-01-02 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
versions: +Python 2.7, Python 3.1 -Python 2.6, Python 3.0

___
Python tracker 

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



[issue980098] Module to dynamically generate structseq objects

2009-01-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I agree with Georg.

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



[issue1402289] Allow mappings as globals (was: Fix dictionary subclass ...)

2009-01-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Haven't had a chance to work on this one.  Unassigning.

--
assignee: rhettinger -> 
versions: +Python 2.7, Python 3.1 -Python 2.6

___
Python tracker 

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



[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2009-01-02 Thread David Watson

David Watson  added the comment:

@ Victor Stinner: Yes, the behaviour of those functions is as you
describe - it's been changed since I filed this issue.  I do
consider it an improvement.

By the password database, I mean /etc/passwd or replacements that
are accessible via getpwnam() and friends.  Users are often
allowed to change things like the GECOS field, and can generally
stick any old junk in there, regardless of encoding.  Now that I
come to check, it seems that in the Python 3.0 release, the pwd.*
functions do raise UnicodeDecodeError when the GECOS field can't
be decoded (bizarrely, they try to interpret it as a Python
string literal, and thus choke on invalid backslash escapes).
Unfortunately, this allows a user to change their GECOS field so
that system programs written in Python can't determine the
username corresponding to that user's UID or vice versa.

___
Python tracker 

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



[issue4608] urllib.request.urlopen does not return an iterable object

2009-01-02 Thread Senthil

Senthil  added the comment:

Jakub,

I have attached a revision to the patch.
You are right, when __iter__ returns self.fp (as in previous patch), the
__next__ is superflous. 
But, I was thinking of __iter__ returning an instance of addbase,
instead of self.fp and in that case __next__ was required. But I see
that i had not changed self.fp to self. 

This is implemented in the similar lines of  IOBase class, io.py
w.r.t to your other comment, why do you think __next__ implementation is
incorrect?

Thanks,
Senthil

Added file: http://bugs.python.org/file12548/issue4608_py31-v2.diff

___
Python tracker 

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



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I'm unable to reproduce the issue.
Could you please repeat the test by using the "timeout" parameter as 
such?

< ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername', 
passwd='thepassword')
> ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername', 
passwd='thepassword', timeout=2)

___
Python tracker 

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



[issue4615] de-duping function in itertools

2009-01-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Added recipes to the itertools docs: r68177 .

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



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2009-01-02 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue2827] IDLE 3.0a5 cannot handle UTF-8

2009-01-02 Thread Pavel Kosina

Pavel Kosina  added the comment:

Thank you. Not sure, what to do now, cause the putting down of IDLE is
fixed, but still within IDLE I get wrong output:

x="ěščřžýáíé"
print (x)

>>> 
ěščřžýáíé

when running this script under python command line form another editor,
I get the output readable as expected. Shall I open another issue?

Added file: http://bugs.python.org/file12547/q.py

___
Python tracker 

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



[issue1135] xview/yview of Tix.Grid is broken

2009-01-02 Thread Guilherme Polo

Guilherme Polo  added the comment:

I would actually prefer to move xview and yview method to classes like
it was done in xview_yview.patch (I've done this on a personal branch
some time ago too, but named them as XScroll, YScroll), we can see they
are used in several places in Tkinter, Tix and other extensions, and we
are just duplicating code for them all the time.

Also, what I would prefer to see in place of this:

if not args:
return self._getdoubles(self.tk.call(self._w, 'xview'))
self.tk.call((self._w, 'xview') + args)

would be this:

res = self.tk.call(self._w, 'xview', *args)
if args:
return self._getdoubles(res)

--
nosy: +gpolo

___
Python tracker 

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



[issue4796] Decimal to receive from_float method

2009-01-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> once you've converted your float to Decimal it's trivial 
> to round it to whatever precision you feel like, so #2 
> seems unnecessary to me.

Agree with Mark on how to control rounding.  The DecimalWay(tm) is that
used by Context.create_decimal().  A second argument is problematic for
two reasons.  First, it demands that some rounding take place but
doesn't let you control the rounding method or signal an Inexact
conversion -- you need a context for that.  Second, the API for decimal
is already somewhat complex and we don't want to make it worse by
introducing a new variant with a second argument that has no parallel
elsewhere in the API.

Also agree with Mark regarding Decimal.from_float() which needs to be
lossless and exact.  It parallels fractions.from_float() which does the
same thing for rationals.

The DecimalWay(tm) is to have Decimal constructors be exact and to use
Context based constructors when rounding is desired.

I'll submit a patch to this effect (unless someone beats me to it).

___
Python tracker 

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



[issue4051] UNICODE macro in cPickle conflicts with Windows define

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

Thanks for the patch. Committed as r68173.

--
status: open -> closed

___
Python tracker 

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



[issue4075] Use WCHAR variant of OutputDebugString

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

Thanks for the patch. Committed as r68172.

--
status: open -> closed

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Skip Montanaro

Skip Montanaro  added the comment:

The next is the result of running on my MacBook Pro (Intel Core 2 Duo).

Added file: http://bugs.python.org/file12546/pybench.sum.Intel

___
Python tracker 

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



[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Skip Montanaro

Skip Montanaro  added the comment:

OK, I think I'm misreading the output of pybench.  Let me reset.  Ignore
anything I've written previously on this topic.  Instead, I will just
post the output of my pybench comparison runs and let more expert people
interpret as appropriate.  The first file is the result of the run on
PowerPC (Mac G5).

Added file: http://bugs.python.org/file12545/pybench.sum.PPC

___
Python tracker 

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



[issue4811] invalid reST markup in several documents

2009-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

Many thanks! Applied in r68171.

Did you find those yourself, or with some sort of tool?

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



[issue1482122] Shift+Backspace exhibits odd behavior

2009-01-02 Thread Guilherme Polo

Guilherme Polo  added the comment:

Just for future reference it is now on
http://tkinter.unpy.net/wiki/Linux_Shift-Backspace

___
Python tracker 

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



[issue4614] Document PyModule_Create()

2009-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

Attaching a doc patch -- Martin, could you please confirm that I didn't
write nonsense?

--
assignee:  -> loewis
keywords: +patch
Added file: http://bugs.python.org/file12544/new-module-apis.diff

___
Python tracker 

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



[issue2827] IDLE 3.0a5 cannot handle UTF-8

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

This is now fixed in r68022.

--
nosy: +loewis
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



[issue4811] invalid reST markup in several documents

2009-01-02 Thread Gabriel Genellina

New submission from Gabriel Genellina :

Several documents contain invalid reST markup that "leaks" into the 
html output (missing ``, incorrect indentation, etc.)
This patch fixes the obvious ones.

--
assignee: georg.brandl
components: Documentation
files: invalid-doc-markup.diff
keywords: patch
messages: 78866
nosy: gagenellina, georg.brandl
severity: normal
status: open
title: invalid reST markup in several documents
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file12543/invalid-doc-markup.diff

___
Python tracker 

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



[issue4808] doc issue for threading module (name/daemon properties)

2009-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

OK, moved the old methods below the new properties in r68170.

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



[issue1482122] Shift+Backspace exhibits odd behavior

2009-01-02 Thread Guilherme Polo

Guilherme Polo  added the comment:

I'm closing this as won't fix but let me tell what you can do to solve
the problem yourself (this may be added somewhere else then, like in the
tkinter wiki).

First, check the keysym you get when pressing Shift-BackSpace:

import Tkinter

def show_key(event):
print event.keysym, event.keycode, hex(event.keysym_num)

root = Tkinter.Tk()
root.bind("", show_key)

root.mainloop()

While running this I pressed Shift-BackSpace, this is what I got:

Shift_L 50 0xffe1
Terminate_Server 22 0xfed5

You can clearly see that Shift-BackSpace is assigned to something else
here, Terminate_Server. You can confirm this by doing:

$ xmodmap -pk | grep 0xfed5

 22 0xff08 (BackSpace)  0xfed5 (Terminate_Server)   0xff08
(BackSpace) 0xfed5 (Terminate_Server)   0xff08 (BackSpace)  0xfed5
(Terminate_Server)

The second field in this output indicates that when I press the key 22
(BackSpace) while holding shift, a Terminate_Server is sent. For more
information about xmodmap you should consult its documentation.
Then, to fix the initial problem you can do the following:

$ xmodmap -e "keycode 22 = BackSpace"

But then it may happen that you can no longer issue a Ctrl-Alt-BackSpace
to finalize your X (till you end this session and start another, since
nothing was permanently saved here). To solve this issue I suggest
checking conflicts between xkb and xmodmap.

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

___
Python tracker 

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



[issue4808] doc issue for threading module (name/daemon properties)

2009-01-02 Thread Corey Goldberg

Corey Goldberg  added the comment:

yes if the new style was listed first, and the old style was below and
marked as "Old API", it would help with some confusion (like I ran into).

___
Python tracker 

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



[issue4808] doc issue for threading module (name/daemon properties)

2009-01-02 Thread Corey Goldberg

Corey Goldberg  added the comment:

Just took another look.  The doc is correct and already shows name and
daemon properties.

it was just confusing at first since where it says "Old API for name",
it links to the new style API and you jump to that section.

perhaps it could be stated more clearly?  If this is just a nit, please
close this issue.

___
Python tracker 

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



[issue4808] doc issue for threading module (name/daemon properties)

2009-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

Hmm, I do see docs for name and daemon, directly below the respective
getter/setter entries.

For more clarity, I can only offer moving the getter/setter entries
below the property entries.

___
Python tracker 

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



[issue4808] doc issue for threading module (name/daemon properties)

2009-01-02 Thread Corey Goldberg

Corey Goldberg  added the comment:

sorry for the confusion.  The doc might actually be correct, but it
seems ambiguous and confusing with respect to the name and daemon
properties.


if you look here:
http://docs.python.org/dev/py3k/library/threading.html

scroll down to where it says:

Thread.getName()
Thread.setName()
Old API for name.

when you click on "name", it expands and shows you the 'name' property.
 However, it looks like it is denoting this as the "Old API".

at first glance it appears as though Thread.getName() and
Thread.setName() are the new way, and you can click on 'name' to see the
old API.  

I think the issue is actually the fact that Thread.name and
Thread.daemon are not expanded in the HTML doc until you click on their
names (unlike other properties/attributes in the doc which are already
expanded)

Let me know if I am not explaining well.

___
Python tracker 

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



[issue4808] doc issue for threading module (name/daemon properties)

2009-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

I don't understand -- both name and daemon are already documented on
their own.

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12541/hashlibopenssl_small_lock.patch

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

Update small lock patch: replace all tabs by spaces! I forget a change 
between Python trunk and my patch: there is also the error message for 
Unicode object. Before:
   >>> import hashlib; hashlib.md5("abc")
   TypeError: object supporting the buffer API required
after:
   >>> import hashlib; hashlib.md5("abc")
   TypeError: Unicode-objects must be encoded before hashing

Added file: http://bugs.python.org/file12542/hashlibopenssl_small_lock-2.patch

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12459/hashopenssl_threads-2.diff

___
Python tracker 

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



[issue4751] Patch for better thread support in hashlib

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

New implementation of finer lock grain in _hashlibopenssl: only create 
the lock at the first update with more than 8 KB bytes. Object 
creation/deallocation is faster if we hash less than 8 KB.

Changes between hashopenssl_threads-4.diff and my new patch: fix the 
deadlock in ENTER_HASHLIB() (for the GIL) without speed change 
(because we don't change the GIL state if we don't use a lock).

Changes between py3k trunk and my new patch:
 - release the GIL with large byte string => faster with multiple CPUs
 - fix EVP_get_block_size() and EVP_get_digest_size(): the context was 
not protected by the lock!

Added file: http://bugs.python.org/file12541/hashlibopenssl_small_lock.patch

___
Python tracker 

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



[issue4472] Is shared lib building broken on trunk for Mac OS X?

2009-01-02 Thread Roumen Petrov

Roumen Petrov  added the comment:

10x cygwin is now not impacted.

___
Python tracker 

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



[issue4809] 2.5.4 release missing from python.org/downloads

2009-01-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

webmas...@python.org is better.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue4804] Python on Windows disables all C runtime library assertions

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> We've had this discussion before, you know, 2006.
> MS is asserting on preconditions that are undefined by the standard.
> As such, they are not in violation.

I remember, and you were already wrong back then :-)

MS asserts (in winsig.c) that the signal number in signal() is one
of the explicit list of supported or ignored signals; if it isn't,
it aborts. This is in violation to ISO C, 7.14.1.1p8, which specifies
that SIG_ERR must be returned and errno set.

It is true that Python *also* invokes undefined behavior in certain
cases; contributions to eliminate these are welcome.

___
Python tracker 

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



[issue1717] Get rid of more refercenes to __cmp__

2009-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

Doc/extending/newtypes.rst

  I'll fix this one after the patch has landed.

Misc/cheatsheet

  This needs a general overhaul.

Misc/python-mode.el

  I think this should be removed from the distribution; it's maintained
externally.

Parser/spark.py   # (I don't know what this does.  Anyone?)

  This is used by asdl_c.py which generates Python-ast.c -- it should be
updated.

___
Python tracker 

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



[issue4809] 2.5.4 release missing from python.org/downloads

2009-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

Normally this bug tracker isn't meant for website problems (mail to
pydot...@python.org instead), but since this is minor, I've fixed it
right now. 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



[issue4614] Document PyModule_Create()

2009-01-02 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> It would be really nice if there were some notes on use of the tracker.

I think Brett has a vision here; you might ping him what the status
of that is.

___
Python tracker 

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



[issue4738] Patch to make zlib-objects better support threads

2009-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

@pitrou: You added "Also, the GIL is now released when computing the 
CRC of a large buffer." in the NEWS. The GIL released for crc32 but 
also for adler32.

___
Python tracker 

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



[issue4738] Patch to make zlib-objects better support threads

2009-01-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Checked in r68165. 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



  1   2   >