[issue11429] ctypes is highly eclectic in its raw-memory support

2011-03-06 Thread benrg

New submission from benrg :

ctypes accepts bytes objects as arguments to C functions, but not bytearray 
objects. It has its own array types but seems to be unaware of array.array. It 
doesn't even understand memoryview objects. I think that all of these types 
should be passable to C code.

Additionally, while passing a pointer to a bytes value to a C function is easy, 
it's remarkably difficult to pass that same pointer with an offset added to it. 
I first tried byref(buf, offset), but byref wouldn't accept bytes. Then I tried 
addressof(buf), but that didn't work either, even though ctypes is clearly able 
to obtain this address when it has to. After banging my head against the wall 
for longer than I care to think about, I finally came up with something like 
byref((c_char*length).from_buffer(buf), offset). But that broke in 3.2. After 
wasting even more time, I came up with addressof(cast(buf, 
POINTER(c_char)).contents) + offset. This is nuts. There should be a simple and 
documented way to do this. My first preference would be for the byref method, 
since it was the first thing I tried, and would have saved me the most time. 
Ideally both byref and addressof should work for bytes objects as they do for 
ctypes arrays (and also for bytearray, memoryview, etc.)

--
assignee: theller
components: ctypes
messages: 130236
nosy: benrg, theller
priority: normal
severity: normal
status: open
title: ctypes is highly eclectic in its raw-memory support
type: feature request
versions: Python 3.2

___
Python tracker 

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



[issue11427] ctypes from_buffer no longer accepts bytes

2011-03-06 Thread Georg Brandl

Changes by Georg Brandl :


--
keywords: +3.2regression

___
Python tracker 

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



[issue11428] with statement looks up __exit__ incorrectly

2011-03-06 Thread Georg Brandl

Georg Brandl  added the comment:

The bug is actually in 3.1 and fixed in 3.2: special methods (those with 
__underscore__ names) are supposed to be looked up on the class, not the 
instance.

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue11425] Cleanup sample codes in tutorial.

2011-03-06 Thread Georg Brandl

Georg Brandl  added the comment:

I made the c -> cls change in 88fe1ac48460. Some other fixes have already been 
made in py3k (like removing the duplicate index keyword), and for the others I 
completely agree with Raymond.

--
nosy: +georg.brandl
resolution: rejected -> fixed

___
Python tracker 

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



[issue8847] crash appending list and namedtuple

2011-03-06 Thread benrg

benrg  added the comment:

The bug is still present in 3.2.

--
versions: +Python 3.2

___
Python tracker 

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



[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2011-03-06 Thread Daniel Urban

Daniel Urban  added the comment:

I'm attaching an updated patch. Instead !PyIter_Check() this patch checks for 
tp_iter == NULL && !PySequence_Check.  If this condition is false, 
PyObject_GetIter has a chance to succeed (and if it fails, we shouldn't mask 
the exception).  I also added more tests which show why the previous patch was 
incorrect.

--
Added file: http://bugs.python.org/file21028/issue4806.patch

___
Python tracker 

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



[issue11428] with statement looks up __exit__ incorrectly

2011-03-06 Thread benrg

New submission from benrg :

class MakeContextHandler:
  def __init__(self, enter, exit):
self.__enter__ = enter
self.__exit__ = exit

with MakeContextHandler(lambda: None, lambda *e: None): pass

In 3.1.3 this worked; in 3.2 it raises AttributeError('__exit__'), which 
appears to be a bug.

--
components: Interpreter Core
messages: 130231
nosy: benrg
priority: normal
severity: normal
status: open
title: with statement looks up __exit__ incorrectly
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue11425] Cleanup sample codes in tutorial.

2011-03-06 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Sorry, but I think many of these changes should not be made.

Sometime the tight spacing is used for visual grouping.  The following look 
fine and should not be changed because adding spaces around the + or * operator 
makes the whole sentence harder to mentally parse correctly:

   sum(x*y for x,y in zip(xvec, yvec))
   a, b = b, a+b

Also, it is perfectly correct to use:
   raise StopIteration
We use the parentheses when there is an argument:
   raise KeyError('key not found: {!r}'.format(k))

Sometimes one-liners are okay in the interactive mode for quick filter 
functions and whatnot.  Spreading them out with '...' lines makes the example 
harder to follow and expands the set-up part of the example rather than the 
part being explained.

It's perfectly valid to use x * x * x instead of x**3 in an example of how to 
use map.  We want the example to be as simple as possible.  

Also, the interactive prompt examples should be left as-is.  They communicate 
the free-form nature of experimentation at the prompt.

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



[issue11427] ctypes from_buffer no longer accepts bytes

2011-03-06 Thread benrg

New submission from benrg :

In Python 3.1.3, (c_char*5).from_buffer(b'abcde') worked. In 3.2 it fails with 
"TypeError: expected an object with a writable buffer interface".

This seems to represent a significant decrease in the functionality of ctypes, 
since, if I understand correctly, it has no notion of a const array or a const 
char. I used from_buffer with a bytes argument in 3.1 and it was far from 
obvious how to port to 3.2 without introducing expensive copying. I understand 
the motivation behind requiring a writable buffer, but I think it's a bad idea. 
If you take this to its logical conclusion, it should not be possible to pass 
bytes or str values directly to C functions, since there's no way to be sure 
they won't write through the pointer.

--
assignee: theller
components: ctypes
messages: 130229
nosy: benrg, theller
priority: normal
severity: normal
status: open
title: ctypes from_buffer no longer accepts bytes
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue11426] CSV examples can't close their files

2011-03-06 Thread Graham Wideman

New submission from Graham Wideman :

On the csv doc page  (.../library/csv.html) most of the examples show creation 
of an anonymous file object within the csv.reader or csv.writer function, for 
example...

spamWriter = csv.writer(open('eggs.csv', 'w'), delimiter=' ',

This anonymity prevents later closing the file, which seems especially 
problematic for a writer.  It also confuses users as to whether there's some 
sort of close function on a csv.reader or csv.writer object which should be 
called, or perhaps some other magic behind the scenes.

I'm pretty sure that it's the doc that is incorrect here.  

This issue was raised pernthetically here 
http://bugs.python.org/issue7198#msg124678 by sjmachin, though mysteriously 
overlooked in his later suggested patch 
http://bugs.python.org/issue7198#msg126593

I suggest changing all examples to include the complete cycle of opening an 
explicit file, and later closing it.

--
assignee: docs@python
components: Documentation
messages: 130228
nosy: docs@python, gwideman
priority: normal
severity: normal
status: open
title: CSV examples can't close their files
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue11425] Cleanup sample codes in tutorial.

2011-03-06 Thread INADA Naoki

INADA Naoki  added the comment:

This patch inserts spaces around ** operator but I prefer no spaces around **.
Any thoughts?

--

___
Python tracker 

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



[issue11422] indentation problem in if, elif, else statements

2011-03-06 Thread Victor

Victor  added the comment:

Thanks, people.
Now I understood that both "if" and "else" should be always at the beginning of 
the lines they are sitting on.

--

___
Python tracker 

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



[issue11425] Cleanup sample codes in tutorial.

2011-03-06 Thread INADA Naoki

New submission from INADA Naoki :

* Insert spaces around operators and after commas.
* Split one liner blocks (ex. def foo(x, y): return x + y) to
  multi-line blocks.
* Insert empty line after def block for scripts (not interactive mode).
* Use new-style raise (s/ralse KeyboardInterrupt/raise KeyboardInterrupt()/)
* Use x ** 3 instead of x * x * x.

Attached patch is for Python 2.6.
I'll make same changes for Python 3.1 if this patch is accepted.

--
assignee: docs@python
components: Documentation
files: cleanup_tutorial_codes.patch
keywords: patch
messages: 130225
nosy: docs@python, naoki
priority: normal
severity: normal
status: open
title: Cleanup sample codes in tutorial.
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file21027/cleanup_tutorial_codes.patch

___
Python tracker 

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



[issue11424] logging fileConfig may not correctly detect children

2011-03-06 Thread Mark Hammond

New submission from Mark Hammond :

fileConfig has code to detect existing "child" loggers and ensure they are 
enabled if the parent is configured.  However, the approach it takes of sorting 
the log names can fail in some cases.  eg, if 3 loggers exist with names like 
"bar", "bar.child" and "bar-etc", "bar.child" is not detected as a child of 
"bar" as "bar-etc" sorts in between "bar" and "bar.child".

Attaching a test case demonstrating this - things work correctly for "foo" and 
"foo.child" but not for "bar" and "bar.child" given the fact that "bar-etc" 
exists.

--
files: log_test.py
messages: 130224
nosy: mhammond, vinay.sajip
priority: normal
severity: normal
status: open
title: logging fileConfig may not correctly detect children
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file21026/log_test.py

___
Python tracker 

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



[issue11422] indentation problem in if, elif, else statements

2011-03-06 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

In both cases, if-clause and the else-clause are at the beginning of the line 
(from Python's point of view).

The difference is that the Python command line interpreter adds a "..." to the 
beginning of secondary lines.  That makes the else-clause visually line-up with 
the if-clause which is prefixed with ">>>". 

With IDLE, the prefix for a secondary line is "", so the else-clause is still 
at the beginning of the line eventhough it doesn't visually line-up with the 
if-clause.

--
nosy: +rhettinger

___
Python tracker 

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



[issue11423] .py file does not open on click

2011-03-06 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Yes, the behaviour you observe is perfectly normal. When you double-click a 
Python file, it is executed right away. If execution completes quickly, the 
window it opens is closed before you can even notice it.

--
nosy: +loewis
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue11422] indentation problem in if, elif, else statements

2011-03-06 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue11422] indentation problem in if, elif, else statements

2011-03-06 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

It is consistent: the else goes *always* under the if. If the if is unindented, 
so must be the else.

--
nosy: +loewis

___
Python tracker 

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



[issue11423] .py file does not open on click

2011-03-06 Thread Victor

New submission from Victor :

Hi dear developers,
**Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on 
win32** (windows vista; standard python installer for windows)
I am new to python. In the documentation I read that a .py file should run just 
on clicking it. 
I do so, but nothing happens (or at most, I can see something opening for just 
a fraction of second, then it immediately closes). Same when I try to open it 
(with the right-click open menu) with python, pythonw.
Is that normal? The way I do then, is to open the IDLE (python shell) and from 
there--"open file".
(Also, I don't manage to use the "from file_name import*" command (in python 
shell IDLE), but I guess that will be another report.)

--
components: None
messages: 130220
nosy: victorywin
priority: normal
severity: normal
status: open
title: .py file does not open on click
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue11422] indentation problem in if, elif, else statements

2011-03-06 Thread Victor

New submission from Victor :

Hi dear developers,
"Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on 
win32"
Hello,
Several days ago I downloaded Python 3.2, the standard windows installer, for 
windows vista. Here's the bug:
in the Python-command line, the following works:
"
>>>if 2==2:print('yes')
...else:print('n')
...
yes
"
Now, in the Python shell (IDLE-python gui, the standard one included with the 
installer of python), the only way it works is:
>>> if 2==2:print('yes')
else:print('n')

yes

So, it requires me to put "else" unindented. On the other hand, if the 
"if--else" statement is included in the definition of a function, then it 
requires that "else" be exactly under "if". Same is true when using "elif".
This was frustrating, when trying to learn "if-else" statement, because it took 
me half an hour of experimenting.
Shouldn't it be consistent?

Victor

--
components: Regular Expressions
messages: 130219
nosy: victorywin
priority: normal
severity: normal
status: open
title: indentation problem in if, elif, else statements
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue1559549] ImportError needs attributes for module and file name

2011-03-06 Thread Andreas Stührk

Andreas Stührk  added the comment:

There are some issues with the patch:

- The check for size of `args` in `ImportError_init()` is wrong: You can't 
create an `ImportError` with 3 arguments now ("TypeError: ImportError expected 
2 arguments, got 3")
- `ImportError_clear()` doesn't clear ``self->msg``.
- `ImportError_str()` doesn't increase the reference count for ``self->msg`` 
before returning it.
- The code that raises the exception (Python/import.c) doesn't check for error 
return values: All the calls can return NULL which will cause a segfault due to 
the uncoditional Py_DECREFs.
- Using `PyUnicode_DecodeASCII()` for the module name is wrong (IMHO), it 
should rather be something like `PyUnicode_DecodeUTF8()` as module names can 
contain non-ASCII characters in Python 3 and are AFAIK (at least right now) 
always encoded using utf-8.

--
nosy: +Trundle, haypo

___
Python tracker 

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



[issue11421] Subversion keywords missing on 2.5 checkout

2011-03-06 Thread Skip Montanaro

Skip Montanaro  added the comment:

The workaround turned out to be simple.  I just expanded the $HeadURL$
subversion keyword as svn would have done it and committed the change
locally.

--

___
Python tracker 

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



[issue11414] Add import fix for email.Message

2011-03-06 Thread Scott Kitterman

Scott Kitterman  added the comment:

Agreed, but email.Message was never marked deprecated so there's likely old 
code out there that's never been updated (which is how I ran into this).  This 
would be, I think, a very low risk transformation to apply.

--

___
Python tracker 

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



[issue3982] support .format for bytes

2011-03-06 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

For future reference, struct.pack, not mentioned here, is a binary bytes 
formatting function. It can mix ascii bytes with binary octets. It works the 
same in Python 2 and 3.

Str.bytes does two things: convert objects to strings according to the contents 
of field specifiers; interpolate the resulting strings into a template string 
according to the locations of the field specifiers. If desired bytes represent 
encoded text, then encoding computed text is the obvious Py3 solution.

For some mixed ascii-binary uses, struct.pack is not as elegant as a 
bytes.format might be. But I think such a method should use struct format codes 
within field specifiers to convert objects into binary bytes rather than text.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue11395] print(s) fails on Windows with long strings

2011-03-06 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

Attached a version of the last patch without `.isatty` caching.

--
Added file: http://bugs.python.org/file21025/winconsole_large_py33_direct.patch

___
Python tracker 

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



[issue11421] Subversion keywords missing on 2.5 checkout

2011-03-06 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Can you explain how I'm supposed to build Python 2.5 from a Mercurial
> checkout?

No, I can't. Just don't. Use subversion instead if you want to build 
Python 2.5 (or use one of the released versions).

> What is magic about Sept 2011?

Security releases will cease at that point, and the need to keep
subversion and mercurial synchronized will disappear.

--

___
Python tracker 

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



[issue11395] print(s) fails on Windows with long strings

2011-03-06 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

FWIW, here's the Microsoft's source for isatty (in VC\crt\src\isatty.c):

/***
*int _isatty(handle) - check if handle is a device
*
*Purpose:
*   Checks if the given handle is associated with a character device
*   (terminal, console, printer, serial port)
*
*Entry:
*   int handle - handle of file to be tested
*
*Exit:
*   returns non-0 if handle refers to character device,
*   returns 0 otherwise
*
*Exceptions:
*
***/

int __cdecl _isatty (
int fh
)
{
#if defined (_DEBUG) && !defined (_SYSCRT)
/* make sure we ask debugger only once and cache the answer */
static int knownHandle = -1;
#endif  /* defined (_DEBUG) && !defined (_SYSCRT) */

/* see if file handle is valid, otherwise return FALSE */
_CHECK_FH_RETURN(fh, EBADF, 0);
_VALIDATE_RETURN((fh >= 0 && (unsigned)fh < (unsigned)_nhandle), EBADF, 
0);

#if defined (_DEBUG) && !defined (_SYSCRT)
if (knownHandle == -1) {
knownHandle = DebuggerKnownHandle();
}

if (knownHandle) {
return TRUE;
}
#endif  /* defined (_DEBUG) && !defined (_SYSCRT) */

/* check file handle database to see if device bit set */
return (int)(_osfile(fh) & FDEV);
}

--

___
Python tracker 

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



[issue11410] Use GCC visibility attrs in PyAPI_*

2011-03-06 Thread Thomas Wouters

Changes by Thomas Wouters :


Removed file: http://bugs.python.org/file21014/gcc-visibility.diff

___
Python tracker 

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



[issue11410] Use GCC visibility attrs in PyAPI_*

2011-03-06 Thread Thomas Wouters

Thomas Wouters  added the comment:

Windows/Cygwin parts of the patch reverted and new patch uploaded. My point 
about the _Py*_SizeT functions is that they're only declared when you define 
PY_SSIZE_T_CLEAN, and I don't know if we want to change that (I don't think it 
makes sense to.)

--
Added file: http://bugs.python.org/file21024/gcc-visibility.diff

___
Python tracker 

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



[issue11421] Subversion keywords missing on 2.5 checkout

2011-03-06 Thread Skip Montanaro

Skip Montanaro  added the comment:

Can you explain how I'm supposed to build Python 2.5 from a Mercurial
checkout?  What is magic about Sept 2011?

--

___
Python tracker 

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



[issue11421] Subversion keywords missing on 2.5 checkout

2011-03-06 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

-1. Changing the Mercurial tree will make it more difficult to maintain the 
subversion tree, which will be the tree from which future 2.5 releases will be 
made.

So if anything is done with this issue, please defer that after September 2011.

--
nosy: +loewis

___
Python tracker 

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



[issue11410] Use GCC visibility attrs in PyAPI_*

2011-03-06 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Exporting the SizeT functions on all systems is fine. It's not true that they 
aren't declared: they are declared in modsupport.h if PY_SSIZE_T_CLEAN is 
defined. Else they are not declared.

The patch looks fine to. I agree that mere cleanup shouldn't get committed 
along with substantial changes.

--

___
Python tracker 

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



[issue11421] Subversion keywords missing on 2.5 checkout

2011-03-06 Thread Skip Montanaro

New submission from Skip Montanaro :

Trying to build Python 2.5 from a fresh Mercurial checkout I get the
following error trying to build modules using setup.py build:

% nice make   
case $MAKEFLAGS in \
*-s*)  CC='gcc' LDSHARED='gcc -L/opt/local/lib -bundle -undefined 
dynamic_lookup' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' 
./python.exe -E ./setup.py -q build;; \
*)  CC='gcc' LDSHARED='gcc -L/opt/local/lib -bundle -undefined 
dynamic_lookup' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' 
./python.exe -E ./setup.py build;; \
esac
Fatal Python error: subversion keywords missing
/bin/sh: line 1: 48054 Abort trap  CC='gcc' LDSHARED='gcc 
-L/opt/local/lib -bundle -undefined dynamic_lookup' OPT='-DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes' ./python.exe -E ./setup.py build
make: *** [sharedmods] Error 134

Even if no release is made I think this should be fixed in Mercurial
if possible.

--
messages: 130207
nosy: skip.montanaro
priority: normal
severity: normal
status: open
title: Subversion keywords missing on 2.5 checkout
versions: Python 2.5

___
Python tracker 

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



[issue11420] Make testsuite pass with -B/DONTWRITEBYTECODE set.

2011-03-06 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +barry, ncoghlan
stage:  -> patch review

___
Python tracker 

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



[issue11419] Python-ast.[ch] out-of-date w.r.t. sources in fresh 2.5 checkout

2011-03-06 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
status: open -> pending

___
Python tracker 

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



[issue7833] Bdist_wininst installers fail to load extensions built with Issue4120 patch

2011-03-06 Thread John Cary

John Cary  added the comment:

Just to follow up.  My case is an application that is almost
all statically linked, but it loads in the python library, and
at runtime it needs to load the tables module, and as distributed
by Python, I get the load-time error on Windows.

Using Christoph Gohlke's exe's works great for me, but I cannot
redistribute due to the linking in of szip for tables and
MKL for numpy.  So I build my own version of tables without
szip and numpy without MKL, but that failed until I applied 
Christoph's patch on Python.  (I also have to patch tables'
setup.py not to include szip.dll and zlib1.dll in dll_files.)

So the result is that with Christoph's patch, all is working
for me.  I hope it (or something similar) makes it into 2.7.

John Cary

--
nosy: +John.Cary

___
Python tracker 

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



[issue11419] Python-ast.[ch] out-of-date w.r.t. sources in fresh 2.5 checkout

2011-03-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I think SVN had the same issue. You just have to be lucky, or touch the files 
yourself.

--
nosy: +pitrou
resolution:  -> wont fix

___
Python tracker 

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



[issue11420] Make testsuite pass with -B/DONTWRITEBYTECODE set.

2011-03-06 Thread Thomas Wouters

Changes by Thomas Wouters :


Added file: http://bugs.python.org/file21023/py32-dontwritebytecode.diff

___
Python tracker 

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



[issue11418] Method's global scope is module containing function definition, not class.

2011-03-06 Thread Santoso Wijaya

Changes by Santoso Wijaya :


--
nosy: +santa4nt

___
Python tracker 

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



[issue11419] Python-ast.[ch] out-of-date w.r.t. sources in fresh 2.5 checkout

2011-03-06 Thread Skip Montanaro

Changes by Skip Montanaro :


--
versions: +Python 2.5

___
Python tracker 

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



[issue11420] Make testsuite pass with -B/DONTWRITEBYTECODE set.

2011-03-06 Thread Thomas Wouters

New submission from Thomas Wouters :

This patch tweaks a few tests that currently rely on .pyc files being written, 
causing them to fail (or crash) when running 'make test TESTPYTHONOPTS=-B'. All 
these are purely test failures, not failures in the tested code (unlike issue 
#11417, which is a failure in bdist_rpm instead of the test.)

(This patch is for 3.1; the patch for 3.2/default is slightly different. I also 
have the same patch for Python 2.6/2.7, but I'm not sure if it's worth 
applying.)

--
components: Tests
files: py31-dontwritebytecode.diff
keywords: patch
messages: 130204
nosy: twouters
priority: normal
severity: normal
status: open
title: Make testsuite pass with -B/DONTWRITEBYTECODE set.
versions: Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file21022/py31-dontwritebytecode.diff

___
Python tracker 

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



[issue11419] Python-ast.[ch] out-of-date w.r.t. sources in fresh 2.5 checkout

2011-03-06 Thread Skip Montanaro

New submission from Skip Montanaro :

I'm working my way through the steps necessary to check out and build
all versions of Python since 2.4 using Mercurial checkouts.  I encountered
my first problem with 2.5.  It seems the Mercurial checkout creates the
Python-ast.[ch] files before the files they depend on.  This causes an
initial checkout to try and run Python.  I don't know if Mercurial can
be tweaked to guarantee checkout order or not.  Would be nice if it could.
The workaround is simple, just touch the two files.

--
messages: 130203
nosy: skip.montanaro
priority: normal
severity: normal
status: open
title: Python-ast.[ch] out-of-date w.r.t. sources in fresh 2.5 checkout

___
Python tracker 

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



[issue11395] print(s) fails on Windows with long strings

2011-03-06 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

On Windows, isatty() is a cheap call: a simple lookup in the _ioinfo structure. 
 And dup2() can still change the destination of a file descriptor, so the new 
attribute can be out of sync...
I suggest to call isatty() on every write.

--

___
Python tracker 

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



[issue11416] netrc module does not handle multiple entries for a single host

2011-03-06 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue11418] Method's global scope is module containing function definition, not class.

2011-03-06 Thread INADA Naoki

Changes by INADA Naoki :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue11418] Method's global scope is module containing function definition, not class.

2011-03-06 Thread INADA Naoki

New submission from INADA Naoki :

http://docs.python.org/py3k/tutorial/classes.html#random-remarks
> Methods may reference global names in the same way as ordinary
> functions. The global scope associated with a method is the module
> containing the class definition. (The class itself is never used
> as a global scope.)

Method's function can be defined outside the module containing class
definition. And then the method's global scope is module containing
method's function definition.

--
messages: 130201
nosy: naoki
priority: normal
severity: normal
status: open
title: Method's global scope is module containing function definition, not 
class.

___
Python tracker 

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



[issue11414] Add import fix for email.Message

2011-03-06 Thread R. David Murray

R. David Murray  added the comment:

Note that email.message works (and is the preferred spelling) since Python2.5.

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

___
Python tracker 

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



[issue11412] Section numbers in the Library Reference have a trailing period

2011-03-06 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> This looks fine to me -- isn't it a mere stylistic issue?

It must be.  I just checked several of the books on my shelf.  Most don't have 
the trailing period, but Knuth does.  I raised the issue because I thought it 
was an unintended.

--

___
Python tracker 

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



[issue11417] distutils' bdist_rpm fails when running with PYTHONDONTWRITEBYTECODE

2011-03-06 Thread Thomas Wouters

New submission from Thomas Wouters :

According to distutils' test_bdist_rpm, bdist_rpm fails when running Python 
with -B/PYTHONDONTWRITEBYTECODE. (bdist_rpm or its test doesn't pass -B along 
but also doesn't use -E, so the test-failure shows up when setting the 
PYTHONDONTWRITEBYTECODE environment variable.) It looks like (somewhere in 
distutils) something relies on .pyc files being written, instead of explicitly 
using (say) py_compile.compile().

--
assignee: tarek
components: Distutils
messages: 130198
nosy: eric.araujo, tarek, twouters
priority: normal
severity: normal
status: open
title: distutils' bdist_rpm fails when running with PYTHONDONTWRITEBYTECODE

___
Python tracker 

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



[issue11395] print(s) fails on Windows with long strings

2011-03-06 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

Attached a modified patch that should work against 3.2+ heads:

- Added `isatty` bit field in isatty that's evaluated during its
  construction. This should eliminate the need to call `isatty()` on 
  every write.
- Cap buffer length to 32767 (4 * 1024 - 1) when writing to a tty.
- Test this by supplying `CREATE_NEW_CONSOLE` to `subprocess.call`, so 
  we do not flood regrtest's console output.

These changes are conditionally compiled on Windows only.

Should a similar patch be made for 2.7+ (maybe earlier)?

--
Added file: http://bugs.python.org/file21021/winconsole_large_py33.patch

___
Python tracker 

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



[issue5091] Segfault in PyObject_Malloc(), address out of bounds

2011-03-06 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
status: open -> closed

___
Python tracker 

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



[issue5091] Segfault in PyObject_Malloc(), address out of bounds

2011-03-06 Thread SilentGhost

Changes by SilentGhost :


--
resolution:  -> invalid
stage: test needed -> committed/rejected

___
Python tracker 

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



[issue11410] Use GCC visibility attrs in PyAPI_*

2011-03-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The cygwin changes are no-ops, just refactoring the needlessly nested
> if statement for clarity. I can revert them.

Perhaps you can commit them separately? I don't think they need review.

As for the getargs.c change, perhaps Martin has an opinion. I bet he's more 
knowledgeable than me on the matter.

--
nosy: +loewis

___
Python tracker 

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



[issue5091] Segfault in PyObject_Malloc(), address out of bounds

2011-03-06 Thread Ryan Kelly

Ryan Kelly  added the comment:

Thanks for the help, I have tracked this down to a bug in PyCrypto.  It was 
increfing an object once but decrefing it twice.

Sorry for the noise.

--

___
Python tracker 

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



[issue11410] Use GCC visibility attrs in PyAPI_*

2011-03-06 Thread Thomas Wouters

Thomas Wouters  added the comment:

The cygwin changes are no-ops, just refactoring the needlessly nested if 
statement for clarity. I can revert them.

The getargs.c change *is* necessary, although it doesn't have to be that exact 
change. The problem is that the functions in that block are not declared in any 
file in Include/, although I don't know why not (it's true that these function 
shouldn't be called directly, but they are symbols that should be exported. The 
ifdef the patch removes makes the export happen only for Windows, but I see no 
reason to do that conditionally.) To be clear, the #define of (for example) 
PyArg_Parse to _PyArg_Parse_SizeT in Include/modsupport.h doesn't apply, 
because Python/getargs.c does not (and must not) define PY_SSIZE_T_CLEAN (or we 
wouldn't be able to define both PyArg_Parse and _PyArg_Parse_SizeT.)

We could just list these functions in Include/modsupport.h, along with the 
'public' (non-PY_SSIZE_T_CLEAN) ones -- but that only makes sense if  we want 
code to call the ssize_t functions directly, which I don't think we want.

--

___
Python tracker 

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



[issue11416] netrc module does not handle multiple entries for a single host

2011-03-06 Thread saffroy

New submission from saffroy :

I have a netrc file with two entries for the same host. The netrc module only 
returns the last entry.

$ cat > .netrc
machine host.com
login foo
password foo

machine host.com
login bar
password bar

$ python -c 'import netrc; print netrc.netrc()'
machine host.com
login 'bar'
password 'bar'

My Linux ftp clients (ftp, lftp) always use the first entry for a given host. 
Also lftp can use the password from the proper entry if I supply the host and 
login.

With the netrc module in Python 2.6.6 (as tested on Debian Squeeze), I can only 
retrieve the last entry.

--
components: Library (Lib)
messages: 130193
nosy: saffroy
priority: normal
severity: normal
status: open
title: netrc module does not handle multiple entries for a single host
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue8594] Add a "source_address" option to ftplib

2011-03-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Giampaolo, can you make your commit on the Mercurial repo instead?

See http://mail.python.org/pipermail/python-dev/2011-March/108738.html

--
status: closed -> pending

___
Python tracker 

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



[issue8594] Add a "source_address" option to ftplib

2011-03-06 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Thanks. Committed in r88761.

--
status: pending -> closed

___
Python tracker 

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



[issue1559549] ImportError needs attributes for module and file name

2011-03-06 Thread Filip Gruszczyński

Filip Gruszczyński  added the comment:

This is a draft of a patch. I have only used this new ImportError api in once 
place, so it would work with following code:

>>> try:
...  import nosuchmodule  
... except ImportError as e:
...  print(e.module)
... 
nosuchmodule

I have literally no experience with Python core, so I would be very grateful 
for comments and advice, so I could make this patch meet all requirements.

--
keywords: +patch
Added file: http://bugs.python.org/file21020/1559549_1.patch

___
Python tracker 

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



[issue11395] print(s) fails on Windows with long strings

2011-03-06 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

Thanks for the comment. It's my first patch. :-)

> - the patch doesn't apply on Python 3.3

That latest patch file I generated against the tip of 3.1 branch. Should I 
create two separate patches for 3.1 and 3.2+ (which will apply on 3.3, as 
well)? Actually, this crash will reproduce on (from my testing) 2.7 with "-u" 
option on, as well...

>  - I don't want to commit the tests because they write 66000 * 2 characters 
> to the test output, which floods the test output. I don't know how to create 
> a fake stdout which is a TTY but not the real stdout, especially on Windows. 
> I think that manual tests only once should be enough. Or does anyone know how 
> to create a fake TTY output?

I have a few ideas to work around this and still have a unit test...

--
versions: +Python 2.7, Python 3.1

___
Python tracker 

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



[issue8594] Add a "source_address" option to ftplib

2011-03-06 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
status: closed -> pending

___
Python tracker 

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



[issue8594] Add a "source_address" option to ftplib

2011-03-06 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

test_source_address_passive_connection() raises a ResourceWarning. Fix attached.

--
nosy: +nvawda
Added file: http://bugs.python.org/file21019/test_ftplib-leak.diff

___
Python tracker 

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



[issue11395] print(s) fails on Windows with long strings

2011-03-06 Thread STINNER Victor

STINNER Victor  added the comment:

Other remarks about test_wconsole_binlarge.patch:
 - the patch doesn't apply on Python 3.3
 - I would prefer 32767 instead of 32000 for the maximum length

Suggestion for the comment in fileio.c:

* Issue #11395: not enough space error (errno 12) on writing
  into stdout in a Windows console if the length is greater than
  66000 bytes. */

--

___
Python tracker 

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



[issue11395] print(s) fails on Windows with long strings

2011-03-06 Thread STINNER Victor

STINNER Victor  added the comment:

Remarks about test_wconsole_binlarge.patch:
 - I don't know if isatty() is cheap or not. Is it a system call? If it might 
be slow, it should be only be called once in the constructor. On Windows, I 
don't think that isatty(fd) evoles.
 - I don't want to commit the tests because they write 66000 * 2 characters to 
the test output, which floods the test output. I don't know how to create a 
fake stdout which is a TTY but not the real stdout, especially on Windows. I 
think that manual tests only once should be enough. Or does anyone know how to 
create a fake TTY output?

--

___
Python tracker 

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



[issue11411] Fix typo in Makefile

2011-03-06 Thread Thomas Wouters

Thomas Wouters  added the comment:

Checked into 2.7, 3.1, 3.2 and default (d121681ed1cc, 12f0da000dc4, 
686df11f0a14, bb2a9ea5c7d0.)

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



[issue11298] unittest discovery needs better explanation

2011-03-06 Thread blokeley

blokeley  added the comment:

Is this wording correct?

"""
In order to be compatible with test discovery, all of the test modules must be 
importable from the top level directory of the project (in other words, they 
must be part of the project :ref:`package ` or directly 
importable :ref:`modules `, and their names must be valid 
:ref:`identifiers `).
"""

If this wording is acceptable, I can provide patches.

--

___
Python tracker 

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



[issue11338] No list of Python hg repositories

2011-03-06 Thread blokeley

blokeley  added the comment:

Closed because the issue is solved by:

1. The devguide http://docs.python.org/devguide/ has a "Browse online" link 
that points to the correct repositories at http://hg.python.org/

2. Any attempt to access http://code.python.org/ redirects the user to the 
correct repositories above.

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



[issue11415] ZipFile don't overwrite compresed files at create

2011-03-06 Thread Jesús Leganés Combarro

New submission from Jesús Leganés Combarro :

I've created a new, compresed ZipFile in memory (using StringIO) and added 
several files to it with ZipFile.write(), later i've added a new file with the 
same name of one of the previous ones just to overwrite it with some dinamic 
data using ZipFile.writestr(), and finally i've closed the StringIO ZipFile and 
writen to the hard disk.

Secondly, i've opened it with FileRoller and found that the overwritten file is 
twice inside the ZipFile, the first and the second one, with different sizes 
and timestamp. Luckily, extracting one of them just get only the more recent 
one, but the fact is that the old one is already there and it's listed instead 
being overwritten with the last, new one, and i don't know if it's a bug (i 
think so) or just a feature.

--
messages: 130182
nosy: piranna
priority: normal
severity: normal
status: open
title: ZipFile don't overwrite compresed files at create
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue2771] test issue

2011-03-06 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
status: open -> closed

___
Python tracker 

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



[issue5800] make wsgiref.headers.Headers accept empty constructor

2011-03-06 Thread Phillip J. Eby

Phillip J. Eby  added the comment:

Looks good to me.

--

___
Python tracker 

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



[issue2771] test issue

2011-03-06 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
status: closed -> open

___
Python tracker 

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



[issue2771] test issue

2011-03-06 Thread Martin v . Löwis

Changes by Martin v. Löwis :


Added file: http://bugs.python.org/file21018/a.diff

___
Python tracker 

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



[issue11389] unittest: no way to control verbosity of doctests from cmd

2011-03-06 Thread Michael Foord

Michael Foord  added the comment:

Anatoly, does the verbosity parameter work for you? If not then any feature 
request / change needs to be for the DocFileSuite as the information is coming 
from there rather than unittest itself.

--
assignee: docs@python -> 
versions: +Python 3.3

___
Python tracker 

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



[issue11414] Add import fix for email.Message

2011-03-06 Thread Scott Kitterman

New submission from Scott Kitterman :

email.Message was dropped in python3.

from email.Message import Message

now fails.  Changing email.Message to email.message seems to be all that's 
needed.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 130179
nosy: kitterma
priority: normal
severity: normal
status: open
title: Add import fix for email.Message

___
Python tracker 

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



[issue11389] unittest: no way to control verbosity of doctests from cmd

2011-03-06 Thread anatoly techtonik

anatoly techtonik  added the comment:

I need to execute doctests along with unit tests from test suite contained in 
tests.py file and control verbosity parameter in case something goes wrong.

--

___
Python tracker 

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



[issue11385] TextTestRunner methods are not documented

2011-03-06 Thread anatoly techtonik

anatoly techtonik  added the comment:

Something to think about for future examples.

--

___
Python tracker 

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



[issue11394] No Tools/demo, etc, on Windows

2011-03-06 Thread anatoly techtonik

anatoly techtonik  added the comment:

Explicit request for inclusion? What kind of bureaucracy are you up to?

Do you have a full list of missing or not included directories for various 
distributions? I'm sure many are curious to review them.

--

___
Python tracker 

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



[issue4350] Remove dead code from Tkinter.py

2011-03-06 Thread Guilherme Polo

Guilherme Polo  added the comment:

If we consider the meaning of "dead code" as that used in compilers, then I 
meant "out of date" code.

If you want to add support for tk::ButtonEnter then I believe you should open a 
new issue and raise your points there. Anyway, have you read 
http://www.mail-archive.com/python-list@python.org/msg210494.html ? Does it 
relate to your use case ?

--

___
Python tracker 

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



[issue11290] ttk.Combobox['values'] String Conversion to Tcl

2011-03-06 Thread Guilherme Polo

Guilherme Polo  added the comment:

Does the attached patch work for you ?

--
keywords: +patch
Added file: http://bugs.python.org/file21017/patch11290.diff

___
Python tracker 

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



[issue11387] Tkinter, callback functions

2011-03-06 Thread Guilherme Polo

Guilherme Polo  added the comment:

I have a different problem here on Mac, but I can manage to reproduce
your issue if I apply the following patch:

Index: Lib/tkinter/__init__.py
===
--- Lib/tkinter/__init__.py (revision 88757)
+++ Lib/tkinter/__init__.py (working copy)
@@ -920,9 +920,9 @@
 self.tk.call('bindtags', self._w, tagList)
 def _bind(self, what, sequence, func, add, needcleanup=1):
 """Internal function."""
-if isinstance(func, str):
-self.tk.call(what + (sequence, func))
-elif func:
+#if isinstance(func, str):
+#self.tk.call(what + (sequence, func))
+if func:
 funcid = self._register(func, self._substitute,
 needcleanup)
 cmd = ('%sif {"[%s %s]" == "break"} break\n'

This should help someone else to produce a patch for this problem you
reported. It is "interesting" that this same patch fixes the problem I
have here (I get a SIGSEGV if I click the cancel button side the
askdirectory dialog).

--

___
Python tracker 

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



[issue10924] Adding salt and Modular Crypt Format to crypt library.

2011-03-06 Thread SilentGhost

Changes by SilentGhost :


--
Removed message: http://bugs.python.org/msg130171

___
Python tracker 

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



[issue10924] Adding salt and Modular Crypt Format to crypt library.

2011-03-06 Thread SilentGhost

SilentGhost  added the comment:

Above-mentioned fix was committed in 0586c699d467 and 62994662676a

--

___
Python tracker 

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



[issue10924] Adding salt and Modular Crypt Format to crypt library.

2011-03-06 Thread SilentGhost

SilentGhost  added the comment:

Above-mentioned fix was commited in rev 62994662676a

--

___
Python tracker 

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



[issue11387] Tkinter, callback functions

2011-03-06 Thread Nikolay Fomichev

Nikolay Fomichev  added the comment:

Here it is... 


import sys
if sys.version_info[0] == 3:
import tkinter as tk
from tkinter import messagebox
from tkinter import filedialog
else:
import Tkinter as tk
import tkMessageBox as messagebox
import tkFileDialog as filedialog

class App():  
def __init__(self):
self.root = tk.Tk()

self.btnMsg = tk.Button(self.root, text='Click me')
self.btnMsg.pack()
self.btnMsg.bind('', self.clickMsg)

self.btnFd = tk.Button(self.root, text='Click me too')
self.btnFd.pack()
self.btnFd.bind('', self.clickFd)

self.btnCommand = tk.Button(self.root, text='And now click me')
self.btnCommand.pack()
self.btnCommand.config(command=self.clickCommand)

self.root.mainloop()

def clickMsg(self, event):
messagebox.showerror(title='Error!', message='The button is sunken!')
   
def clickFd(self, event):
filedialog.askdirectory(title='Choose a directory')

def clickCommand(self):
messagebox.showinfo(title='Success!', message='The button is raised.')

App()

--

___
Python tracker 

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



[issue5800] make wsgiref.headers.Headers accept empty constructor

2011-03-06 Thread SilentGhost

Changes by SilentGhost :


Removed file: http://bugs.python.org/file19804/wsgiref.rst.diff

___
Python tracker 

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



[issue5800] make wsgiref.headers.Headers accept empty constructor

2011-03-06 Thread SilentGhost

Changes by SilentGhost :


Removed file: http://bugs.python.org/file19797/headers.py.diff

___
Python tracker 

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



[issue5800] make wsgiref.headers.Headers accept empty constructor

2011-03-06 Thread SilentGhost

Changes by SilentGhost :


Removed file: http://bugs.python.org/file19681/test_wsgiref.py.diff

___
Python tracker 

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



[issue5800] make wsgiref.headers.Headers accept empty constructor

2011-03-06 Thread SilentGhost

SilentGhost  added the comment:

Here's the single-file patch against the revision.

--
Added file: http://bugs.python.org/file21016/issue5800.diff

___
Python tracker 

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



[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2011-03-06 Thread Daniel Urban

Daniel Urban  added the comment:

I think the patch isn't entirely correct.  It uses PyIter_Check for detecting 
the case when an *iterable* raises TypeError, but that function actually checks 
for an *iterator*.  The check on the tp_iter member mentioned by Amaury Forgeot 
d'Arc probably would be better, but even that wouldn't detect every iterable: 
"Its presence normally signals that the instances of this type are iterable 
(although sequences may be iterable without this function)." 
(http://docs.python.org/dev/py3k/c-api/typeobj.html#PyTypeObject.tp_iter)  
(Apparently any object with a __getitem__ is iterable.  By the way, 
collections.abc.Iterable also doesn't detect this case.)

--
versions: +Python 3.3

___
Python tracker 

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



[issue11406] There is no os.listdir() equivalent returning generator instead of list

2011-03-06 Thread Vetoshkin Nikita

Vetoshkin Nikita  added the comment:

Generator listdir() could be useful if I have a directory with several millions 
of files and I what to process just a hundred.

--
nosy: +nvetoshkin

___
Python tracker 

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



[issue11411] Fix typo in Makefile

2011-03-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Looks fine, please commit.

--
assignee:  -> twouters
nosy: +pitrou
stage:  -> commit review
versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue11413] Idle doesn't start

2011-03-06 Thread Chris

New submission from Chris :

Hi, I just installed Python 3.1.1 via link in the book Python Programming for 
the absolute beginner third edition. But Idle won't start. When I try to open 
Idle the Windows "hourglass" just flash briefly but nothing happens after that. 
No error messages.

My operating system is XP Professional Version 2002 Service Pack 3.

I have uninstalled and reinstalled several times but nothing changes. I select 
"Install for All Users" during the installation.

I have also tried installing instead the 3.2 version from the python.org 
website but the same issue arises - idle doesn't launch. 

Does anyone know what the problem is? Really want to get going with the program!

--
components: IDLE
messages: 130165
nosy: Chris
priority: normal
severity: normal
status: open
title: Idle doesn't start
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue11185] test_wait4 error on AIX

2011-03-06 Thread Charles-Francois Natali

Charles-Francois Natali  added the comment:

If test_wait3 and test_fork1 pass, then yes, it's probably an issue with AIX's 
wait4.
See http://fixunix.com/aix/84872-sigchld-recursion.html:

"""
Replace the wait4() call with a waitpid() call...
like this:
for(n=0;waitpid(-1, &status, WNOHANG) > 0; n++) ;

Or, compile the existing code with the BSD library:
cc -o demo demo.c -D_BSD -lbsd

Both will work...

The current problem is that child process is not "seen" by the wait4()
call,
so that when "signal" is rearmed, it immediately goes (recursively)
into the
child_handler() function.
"""

So it seems that under AIX, posix_wait4 should be compiled with -D_BSD -lbsd.
Could you try this ?

If this doesn't do the trick, then avoiding passing WNOHANG could be the second 
option.

--
nosy: +neologix

___
Python tracker 

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



[issue11410] Use GCC visibility attrs in PyAPI_*

2011-03-06 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> patch review
type:  -> feature request
versions: +Python 3.3

___
Python tracker 

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



[issue11410] Use GCC visibility attrs in PyAPI_*

2011-03-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Why the cygwin changes? Are they related? Also, is the change in 
Python/getargs.c necessary?

--
nosy: +pitrou

___
Python tracker 

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



[issue11239] regexp-howto - add missing } to metachars

2011-03-06 Thread Georg Brandl

Georg Brandl  added the comment:

Since ] was in the list, I've added } as well.  (It's never a bad idea to quote 
] and } unconditionally.)

--

___
Python tracker 

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



[issue11239] regexp-howto - add missing } to metachars

2011-03-06 Thread Ezio Melotti

Ezio Melotti  added the comment:

Actually '}' is not a metachar, the metachars should be only "|()[{.+*?^$\".

>>> re.match('^a+(}+)b+$', '}bbb')
<_sre.SRE_Match object at 0xb77aa860>
>>> re.match('^a+(}+)b+$', '}bbb').group(1)
'}'

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue11294] Locale - update & uniform ERA_*_FMT doc

2011-03-06 Thread Georg Brandl

Georg Brandl  added the comment:

Fixed in 6f861f98a3c5.

--
nosy: +georg.brandl
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



[issue11292] Curses - add A_REVERSE to attributes table

2011-03-06 Thread Georg Brandl

Georg Brandl  added the comment:

Fixed in d9292abe80da.

--
nosy: +georg.brandl
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



[issue11395] print(s) fails on Windows with long strings

2011-03-06 Thread STINNER Victor

STINNER Victor  added the comment:

I did some tests: os.write(1, b'X'*length) does always fail with length >= 
63842. It does sometimes fail with length > 35000. The maximum looks completly 
random: as written in Microsoft documentation, "The maximum size of the buffer 
will depend on heap usage"...

32000 looks arbitrary. I would prefer 2^15-1 (32767) because it looks less 
magical :-)

--

___
Python tracker 

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



  1   2   >