[issue11436] Clarify struct doc for format 's', when it is mentioned without numeric prefix

2011-07-06 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

A default of 1 in not implicit for output formatting.
%s and {:s} mean however long needed, not %1s or {:1s}

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



[issue11436] Clarify struct doc for format 's', when it is mentioned without numeric prefix

2011-07-06 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

That is for the string formatting character, correct?

In this issue, we are talking about format character for struct and
not just 's' but 'c','h','b','i' all without numeric prefix imply
single value.

--

___
Python tracker 

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



[issue12493] subprocess: Popen.communicate() doesn't handle EINTR in some cases

2011-07-06 Thread STINNER Victor

STINNER Victor  added the comment:

> Out of curiosity, how could SIGALRM be missing on a Unix system?

It is only missing on Windows.

--

___
Python tracker 

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



[issue6721] Locks in python standard library should be sanitized on fork

2011-07-06 Thread Nir Aides

Nir Aides  added the comment:

> Would you like to work on a patch to add an atfork mechanism?

I will start with an attempt to generate a summary "report" on this rabbit hole 
of a problem, the views and suggestions raised by people here and what we may 
expect from atfork approach, its limitations, etc... I will also take a deeper 
look into the code.

Hopefully my brain will not deadlock or fork while I am at it.

more words, I know...

--

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread yoch

New submission from yoch :

Hi,

I'm using sys.argv to retrieve files and process them on the command line.
Wildcards arguments (like : test.py *.txt) works fine under Linux (expanded), 
but not on Windows.
It also affects the fileinput functions.
The solution is to change the compilation options msvc, as mentioned here:
http://msdn.microsoft.com/en-us/library/8bch7bkk.aspx

Regards,
yoch

--
components: Windows
files: test_argv_1.py
messages: 139930
nosy: yoch.melka
priority: normal
severity: normal
status: open
title: python interpreter not handle wildards properly
versions: Python 3.2
Added file: http://bugs.python.org/file22592/test_argv_1.py

___
Python tracker 

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



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-07-06 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

So sorry that i'm stressing this, hopefully it's the final message.
Apples iterative kernel-update strategy resulted in these versions:

14:02 ~/tmp $ /usr/sbin/sysctl kern.version
kern.version: Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; 
root:xnu-1504.15.3~1/RELEASE_I386
14:02 ~/tmp $ gcc -o zt osxversion.c -framework CoreServices
14:03 ~/tmp $ ./zt 
OS X version: 10.6.8
apple_osx_needs_fullsync: -1

I.e. the new patch uses >10.7.0 or >=10.6.8 to avoid that
FULLFSYNC disaster (even slower than the Macrohard memory
allocator during "Wintel" partnership!), and we end up as:

14:03 ~/src/cpython $ ./python.exe -E -Wd -m test -r -w -uall test_mmap
Using random seed 8466468
[1/1] test_mmap
1 test OK.

P.S.: i still have no idea how to do '-framework CoreServices'
regulary.  Like i've said in #11046 i never used GNU Autoconf/M4,
sorry.  You know.  Maybe the version check should be moved
somewhere else and simply be exported, even replacing the stuff
from platform.py?  I don't know.  Bye.
--
Ciao, Steffen
sdaoden(*)(gmail.com)
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments

--
Added file: http://bugs.python.org/file22593/11277.apple-fix-3.diff

___
Python tracker 

___diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -88,7 +88,8 @@
 
To ensure validity of the created memory mapping the file specified
by the descriptor *fileno* is internally automatically synchronized
-   with physical backing store on Mac OS X and OpenVMS.
+   with physical backing store on operating systems where this is
+   necessary, e.g. OpenVMS, and some buggy versions of Mac OS X.
 
This example shows a simple way of using :class:`mmap`::
 
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -25,6 +25,8 @@
 #define UNIX
 # ifdef __APPLE__
 #  include 
+
+#  include 
 # endif
 #endif
 
@@ -65,6 +67,44 @@
 #define my_getpagesize getpagesize
 #endif
 
+# ifdef __APPLE__
+static void
+apple_osx_needs_fullsync(long *use_fullsync)
+{
+/* Issue #11277: mmap(2) bug with >32 bit sparse files.
+ * Apple fixed the bug before announcement of OS X "Lion", but since we
+ * need to handle buggy versions, perform a once-only check to see if the
+ * running kernel requires the expensive sync.  Fixed in 10.6.8, 10.7++.
+ * >0: F_FULLSYNC is required, <0: kernel has mmap(2) bug fixed */
+SInt32 ver;
+*use_fullsync = 1;
+
+if (Gestalt(gestaltSystemVersion, &ver) != noErr)
+goto jleave;
+/* SystemVersion(Major|Minor|BugFix) available at all? */
+if (ver < 0x1040)
+goto jleave;
+if (Gestalt(gestaltSystemVersionMajor, &ver) != noErr)
+goto jleave;
+if (ver > 10)
+goto jgood;
+if (Gestalt(gestaltSystemVersionMinor, &ver) != noErr)
+goto jleave;
+if (ver >= 7)
+goto jgood;
+if (ver < 6)
+goto jleave;
+if (Gestalt(gestaltSystemVersionBugFix, &ver) != noErr)
+goto jleave;
+if (ver < 8)
+goto jleave;
+jgood:
+*use_fullsync = -1;
+jleave:
+return;
+}
+# endif /* __APPLE__ */
+
 #endif /* UNIX */
 
 #include 
@@ -1150,8 +1190,14 @@
 #ifdef __APPLE__
 /* Issue #11277: fsync(2) is not enough on OS X - a special, OS X specific
fcntl(2) is necessary to force DISKSYNC and get around mmap(2) bug */
-if (fd != -1)
-(void)fcntl(fd, F_FULLFSYNC);
+if (fd != -1) {
+/* (GIL protected) */
+static long use_fullsync /*= 0*/;
+if (!use_fullsync)
+apple_osx_needs_fullsync(&use_fullsync);
+if (use_fullsync > 0)
+(void)fcntl(fd, F_FULLFSYNC);
+}
 #endif
 #ifdef HAVE_FSTAT
 #  ifdef __VMS
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-07-06 Thread Steffen Daode Nurpmeso

Changes by Steffen Daode Nurpmeso :


Removed file: http://bugs.python.org/file22281/11277.apple-fix-2.diff

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-07-06 Thread Stefan Krah

Stefan Krah  added the comment:

Antoine is right, this needs to be fixed. I think that for *practical*
purposes, the existing release() method already behaves like a tryrelease()
method:

Traceback (most recent call last):
  File "", line 1, in 
BufferError: Existing exports of data: object cannot be re-sized
>>>

So while m1.release() in fact *does* release a buffer, the desired
effect (freeing up 'b' for subsequent operations) only happens
after also calling m2.release(). This applies to Python and NumPy
objects.

With this amount of complexity, it might be a good idea to separate
refcounting and exports, like so:

typedef struct {
PyObject_HEAD
int released;
Py_ssize_t exports; /* total number of exports */
Py_buffer master;
} PyManagedBufferObject;

typedef struct {
PyObject_HEAD
PyManagedBufferObject *mbuf;
Py_ssize_t shape[Py_MEMORYVIEW_MAXSTATIC];
Py_ssize_t strides[Py_MEMORYVIEW_MAXSTATIC];
Py_ssize_t suboffsets[Py_MEMORYVIEW_MAXSTATIC];
int released; /* for clarity in the code */
Py_ssize_t exports; /* buffer exports */
Py_buffer view;
} PyMemoryViewObject;

Then it is possible for a MemoryView to call mbuf_release() from
memory_release() if self->exports == 0 and --self->mbuf->exports == 0.

So, if I understand Antoine correctly, in following graph m1, m2 and
m4 could mark themselves as 'released' and decrement self->mbuf->exports.
This could happen in any order.

What should happen with m2.release()? Raising would be odd here as well,
since Pauli stated earlier that some people might actually construct
new objects from an exported buffer.

m2 could mark itself as 'release_pending', and henceforth only accept
releasebuffer requests from b1, b2 and x1. Once those are all in, it
releases itself properly and sends the message to mbuf.

'release_pending' could be expressed as (self->released && self->exports > 0).

ManagedBuffer (mbuf)
 |
 ---
 | |
 m1 (private arrays)  m3 (private arrays)
 | |
 m2   m4 (private arrays)
 |
 -
 |   |   |
 |  b1  b2 (regular temporary buffer exports)
 |
 x1 (new object constructed from a buffer export)

Antoine, was this roughly your suggestion?

--

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-07-06 Thread Stefan Krah

Stefan Krah  added the comment:

[The first part of the message again, this time via the web interface.]

Antoine is right, this needs to be fixed. I think that for *practical*
purposes, the existing release() method already behaves like a tryrelease()
method:


>>> b = bytearray(b'123456789')
>>> m1 = memoryview(b)
>>> m2 = memoryview(m1)
>>> m1.release()
>>> b.append(1)
Traceback (most recent call last):
  File "", line 1, in 
BufferError: Existing exports of data: object cannot be re-sized
>>>


So while m1.release() in fact *does* release a buffer, the desired
effect (freeing up 'b' for subsequent operations) only happens
after also calling m2.release(). This applies to Python and NumPy
objects.

--

___
Python tracker 

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



[issue12506] NIS module cant handle multiple NIS map entries for the same GID

2011-07-06 Thread bjorn lofdahl

New submission from bjorn lofdahl :

I think i have found an issue with the module that is only visible on larger 
sites that are using multiple group entries for the same group in the NIS maps. 
This comes from the bug that NIS can only handle 1024 chars per line, so if a 
group has more members that exceeds 1024 chars, a new line is added with the 
same GID and NAME. yp tools handles this fine, it simply reports several 
"lines" for the same group. For ex:

> ypcat group | grep FOO | cut -d ':' -f 1-3
FOO:x:17776
FOO:x:17776
FOO:x:17776
FOO:x:17776
FOO:x:17776

when i do the same using the python NIS module it only gives me the users for 
one of the maps for this group. I guess the "correct" behavior from the module 
should be to concatenate/append all users from all the maps for each specific 
group.

--
messages: 139934
nosy: bjorn.lofdahl
priority: normal
severity: normal
status: open
title: NIS module cant handle multiple NIS map entries for the same GID
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-07-06 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le mercredi 06 juillet 2011 à 12:39 +, Stefan Krah a écrit :
> Antoine, was this roughly your suggestion?

I think so (!), but I also agree with Nick that raising BufferError when
calling release() on a memoryview with exports is a reasonable
alternative.

--

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-07-06 Thread Nick Coghlan

Nick Coghlan  added the comment:

Yeah, the reason my originally proposed semantics were wrong is because copying 
(or slicing) a memoryview object and then explicitly releasing that object 
would always fail through no fault of that code. That would be broken and the 
only way to fix it is to allow the release() call but not actually call the 
ReleaseBuffer API until all the buffer references are gone.

Exports are different - whenever you copy or slice a memoryview, you get a new 
memoryview object with the export count set to zero, so it is reasonable to 
require that anyone that wants to explicitly release the memoryview's buffer 
reference make sure that there aren't any exports hanging around. Keep in mind 
that memoryview copies and slices don't increase the export count, as those 
will refer directly back to the original managed buffer.

+1 on tracking buffer exports explicitly rather than relying solely on playing 
games with refcounts though - while technically redundant in the ManagedBuffer 
case, I agree it will make the code far more self-explanatory.

--

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread Eric V. Smith

Eric V. Smith  added the comment:

But what if you don't want the expansion done? I always invoke python from 
cygwin's bash shell, and sometimes I tell the shell not to expand the 
arguments, such as:

python \*
or
python '*'

I wouldn't want python (or rather the C runtime) to do the expansion in this 
case, and I don't see how it could know not to do it.

--
nosy: +eric.smith

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread yoch

yoch  added the comment:

Escape the wildcard like '*' will work (like on Linux).

I think \* will not work...

--

___
Python tracker 

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



[issue12507] tkSimpleDialog problem

2011-07-06 Thread LMO

New submission from LMO :

tkSimpleDialog displays blank rectangle and hangs with version 2.7.  Works fine 
on version 2.6.  In attached program, click on button labeled "Press this 
Button" which will call tkSimpleDialog.

--
components: Tkinter
files: ACSDtest.py
messages: 139939
nosy: rzn8tr
priority: normal
severity: normal
status: open
title: tkSimpleDialog problem
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file22594/ACSDtest.py

___
Python tracker 

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



[issue12507] tkSimpleDialog problem

2011-07-06 Thread LMO

LMO  added the comment:

Omitted platform info:
MacBook Pro, 2.4 GHz Intel Core 2 Duo, 4 GB RAM, OS X 10.7 build 11A511
also confirmed on OS X 10.6 (Snow Leopard)

--

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread Eric V. Smith

Eric V. Smith  added the comment:

Both of them work under cygwin. My point is that neither would work if the C 
runtime expanded command line arguments.

--

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread yoch

yoch  added the comment:

'setargv.obj' not C runtime, it's only static library to allow expanding 
wildcards arguments received by the program. (MinGW uses approximately the same 
principle for executables compilation)

And, it's not appropriate to tell people who need this feature (arguments 
expanding) to work only with cygwin ...

--

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread Eric V. Smith

Eric V. Smith  added the comment:

I'm not suggesting they use cygwin. I'm saying that if they do use cygwin that 
something they currently do would stop working. There would be no way to pass a 
command line parameter of "*" to python, at least without adding more escaping 
(hard to say, documentation of setargv.obj is sparse).

Of course this would be true from any shell, I'm just familiar with the syntax 
of doing so under bash.

While it might be a separate .obj file, I believe it's still part of the 
logical C runtime that gets invoked before python's main(). Or am I missing 
something? (entirely possible, it's been a while since I've used setargv.obj)

--

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread yoch

yoch  added the comment:

With cmd and program compiled with setargv.obj, 'command *' is expanded, but 
not 'command "*"'. So, it's possible to escape them normally.

[q]
While it might be a separate .obj file, I believe it's still part of the 
logical C runtime that gets invoked before python's main(). Or am I missing 
something? (entirely possible, it's been a while since I've used setargv.obj)
[/q]
I dont't know. But what difference does it make, after all?
( I'm not sure I understand, my english is poor ;) )

--

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread Eric V. Smith

Eric V. Smith  added the comment:

> I dont't know. But what difference does it make, after all?

I just want to make sure it's something that happens automatically and wouldn't 
require a change to python's C code.

To the other point, someone who currently uses:
python '*'
would need to change to:
python '"*"'

I'm just pointing out that it's a change for some users, and might break some 
existing usage of python. I can't say whether or not that's a big problem or 
not.

--

___
Python tracker 

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



[issue12503] "with" statement error message is more confusing in Py2.7

2011-07-06 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

The message is not inaccurate, but indeed misleading. In wonder what to do 
considering the traditional message of AttributeError is simply the missing 
attribute.

--
nosy: +benjamin.peterson
priority: normal -> low

___
Python tracker 

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



[issue12507] tkSimpleDialog problem

2011-07-06 Thread LMO

LMO  added the comment:

I confirmed that the problem does not exist under Win XP using python 2.7.2.

--

___
Python tracker 

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



[issue12507] tkSimpleDialog problem

2011-07-06 Thread LMO

Changes by LMO :


--
assignee:  -> ronaldoussoren
components: +Macintosh -Tkinter
nosy: +ronaldoussoren

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread Sebastian Ramacher

Sebastian Ramacher  added the comment:

That is definitely not python's job. That is the duty of your shell and python 
should never expand that.

And it would lead to platform specific behavior as one can see with the 
following script:

import sys
import subprocess

if __name__ == "__main__":
  if len(sys.argv) == 1:
subprocess.Popen([sys.executable, __file__, "foo", "*"])
  else:
print sys.argv[1:]

With setargv.obj the argument would be expanded on Windows whereas on any other 
platform it just prints [foo, *].

--
nosy: +sebastinas

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread yoch

yoch  added the comment:

Okay. Thanks :)

--

___
Python tracker 

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



[issue6090] zipfile: Bad error message when zipping a with timestamp before 1980

2011-07-06 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Retitled to reflect that the error message should be enhanced.

Attached a patch for 2.7 that raises ValueError for timestamps before 1980, 
documents that 1980 or later is required, and adds some tests.

--
keywords: +needs review, patch
nosy: +petri.lehtinen
stage: test needed -> patch review
title: zipfile DeprecationWarning Python in 2.6, failure in 2.7 -> zipfile: Bad 
error message when zipping a with timestamp before 1980
versions:  -Python 2.6
Added file: 
http://bugs.python.org/file22595/zipfile_timestamps_before_1980.patch

___
Python tracker 

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



[issue6090] zipfile: Bad error message when zipping a file with timestamp before 1980

2011-07-06 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
title: zipfile: Bad error message when zipping a with timestamp before 1980 -> 
zipfile: Bad error message when zipping a file with timestamp before 1980

___
Python tracker 

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



[issue12198] zipfile.py:1047: DeprecationWarning: 'H' format requires 0 <= number <= 65535

2011-07-06 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Setting as duplicate of #6090.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> zipfile: Bad error message when zipping a file with timestamp 
before 1980

___
Python tracker 

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



[issue12505] python interpreter not handle wildards properly

2011-07-06 Thread Brian Curtin

Changes by Brian Curtin :


--
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue12507] tkSimpleDialog problem

2011-07-06 Thread Ned Deily

Ned Deily  added the comment:

The problem is not with Python 2.7 per se. It's a problem when running on OS X 
with a Python linked with the current Aqua Cocoa Tk 8.5, such as the 
ActiveState Tcl/Tk.  Your test case works OK when using the current 32-bit-only 
Python 2.7.2 from python.org which links with the older Aqua Carbon Tk 8.4.  
Unfortunately, this is not the first of these kinds of problems reported.

--
nosy: +ned.deily

___
Python tracker 

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



[issue12178] csv writer doesn't escape escapechar

2011-07-06 Thread Catalin Iacob

Catalin Iacob  added the comment:

I looked at this and tried to provide a patch + tests. Please review.

The bug is that a writer can use writerow on some input data but if a reader 
with the same dialect reads them back they are different from the input ones. 
This happens when the input data contains escapechar. Contrary to msg136881, 
this happens regardless whether doublequote is True or False.

The docs say "On reading, the escapechar removes any special meaning from the 
following character". Therefore, I understand that on writing, escapechar must 
always be escaped by itself. If that doesn't happen, when reading it back, 
escapechar alters the thing that follows it instead of counting as escapechar 
which is precisely what this bug is about.

--
hgrepos: +38
nosy: +catalin.iacob

___
Python tracker 

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



[issue12178] csv writer doesn't escape escapechar

2011-07-06 Thread Catalin Iacob

Changes by Catalin Iacob :


--
keywords: +patch
Added file: http://bugs.python.org/file22596/0eb420ce6567.diff

___
Python tracker 

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



[issue12508] Codecs Anomaly

2011-07-06 Thread Saul Spatz

New submission from Saul Spatz :

The attached script produces the output 

'A\ufffdBC\ufffd'
'A\ufffdBC'

although it seems to me that both lines should be the same.  The first line is 
correct, I think, since the  at the end is a maximal subpart of an 
ill-formed subsequence, according to the definition in the Unicode standard.

--
components: Unicode
files: fffd.py
messages: 139954
nosy: spatz123
priority: normal
severity: normal
status: open
title: Codecs Anomaly
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file22597/fffd.py

___
Python tracker 

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



[issue12014] str.format parses replacement field incorrectly

2011-07-06 Thread Ben Wolfson

Ben Wolfson  added the comment:

This patch differs from the previous one; its goal is to bring the actual 
behavior of the interpreter into line with the documentation (with the 
exception of using only decimal integers, rather than any integers, wherever 
the documentation for str.format currently has "integer": this does, however, 
conform with current behavior).

--
Added file: http://bugs.python.org/file22598/strformat-as-documented.diff

___
Python tracker 

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



[issue12508] Codecs Anomaly

2011-07-06 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue12508] Codecs Anomaly

2011-07-06 Thread STINNER Victor

STINNER Victor  added the comment:

I confirm, there is a bug in codecs.StreamReader.

--
nosy: +haypo

___
Python tracker 

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



[issue12508] Codecs Anomaly

2011-07-06 Thread STINNER Victor

STINNER Victor  added the comment:

You should use the io module, it doesn't have the bug :)

--

___
Python tracker 

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



[issue12014] str.format parses replacement field incorrectly

2011-07-06 Thread Ben Wolfson

Ben Wolfson  added the comment:

And here is a patch for Greg Ewing's proposal: 
http://mail.python.org/pipermail/python-dev/2011-June/111934.html

Again, decimal integers rather than any kind of integers are used.

Both patches alter the exceptions expected in various places in test_unicode's 
test_format:

"{0.}".format() raises a ValueError (because the format string is invalid) 
rather than an IndexError (because there is no argument)

"{0[}".format(), likewise.

"{0]}".format() raises a ValueError (because the format string is invalid) 
rather than a KeyError (because "0]" is taken to be the name of a keyword 
argument---meaning that the test suite was testing the actual behavior of the 
implementation rather than the documented behavior).

"{c]}".format(), likewise.

In this patch, "{0[{1}]}".format('abcdef', 4) raises a ValueError rather than a 
TypeError, because "{1}", being neither a decimalinteger nor an identifier, 
invalidates the replacement field.

Both patches also add tests for constructions like this:

"{[0]}".format([3]) --> '3'
"{.__class__}".format(3) --> ""

This conforms with the documentation (and current behavior), since in it 
arg_name is defined to be optional, but it is not currently covered in 
test_format, that I could tell, anyway.

--
Added file: 
http://bugs.python.org/file22599/strformat-just-identifiers-please.diff

___
Python tracker 

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



[issue12014] str.format parses replacement field incorrectly

2011-07-06 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Please stick with "integer" instead of "decimalinteger".   In an effort to make 
the docs more precise, there is an unintended effect of making them harder to 
understand.

--
nosy: +rhettinger

___
Python tracker 

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



[issue12509] test_gdb fails on debug build when builddir != srcdir

2011-07-06 Thread Dave Malcolm

New submission from Dave Malcolm :

test_gdb.py fails when builddir != srcdir: the regex tries to match lines like 
this:
  #0  builtin_id (self=, v=()) at 
../Python/bltinmodule.c:919

but isn't expecting the "../" before the "Python/bltinmodule.c"

2.7 uses a different regexp, and I don't think it's affected by an analogous 
problem.

--
assignee: dmalcolm
components: None
files: fix-test_gdb-regexp.patch
keywords: patch
messages: 139960
nosy: dmalcolm, haypo
priority: normal
severity: normal
stage: patch review
status: open
title: test_gdb fails on debug build when builddir != srcdir
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file22600/fix-test_gdb-regexp.patch

___
Python tracker 

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



[issue12508] Codecs Anomaly

2011-07-06 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> high

___
Python tracker 

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



[issue12510] IDLE get_the_calltip mishandles raw strings

2011-07-06 Thread Roy Fox

New submission from Roy Fox :

Hi,

When you type (not copy-paste!) into an IDLE shell a string literal followed by 
(
you get a calltip.

When the string contains a bad unicode escaping you get an error (see example 
below), which makes some sense.

But when the string is raw, it isn't treated as such, and you may get the same 
error, though now it doesn't make any sense.

Non-raw example:

>>> '\xyz'(

>>> *** Internal Error: rpc.py:SocketIO.localcall()

 Object: exec 
 Method: > 
 Args: ("'\\xyz'",)

Traceback (most recent call last):
  File "C:\Python32\lib\idlelib\rpc.py", line 188, in localcall
ret = method(*args, **kwargs)
  File "C:\Python32\lib\idlelib\run.py", line 324, in get_the_calltip
return self.calltip.fetch_tip(name)
  File "C:\Python32\lib\idlelib\CallTips.py", line 103, in fetch_tip
entity = self.get_entity(name)
  File "C:\Python32\lib\idlelib\CallTips.py", line 112, in get_entity
return eval(name, namespace)
  File "", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in 
position 0-2: truncated \xXX escape


Raw example:

>>> r'\xyz'(

>>> *** Internal Error: rpc.py:SocketIO.localcall()

 Object: exec 
 Method: > 
 Args: ("'\\xyz'",)

Traceback (most recent call last):
  File "C:\Python32\lib\idlelib\rpc.py", line 188, in localcall
ret = method(*args, **kwargs)
  File "C:\Python32\lib\idlelib\run.py", line 324, in get_the_calltip
return self.calltip.fetch_tip(name)
  File "C:\Python32\lib\idlelib\CallTips.py", line 103, in fetch_tip
entity = self.get_entity(name)
  File "C:\Python32\lib\idlelib\CallTips.py", line 112, in get_entity
return eval(name, namespace)
  File "", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in 
position 0-2: truncated \xXX escape

--
components: IDLE
messages: 139961
nosy: Roy.Fox
priority: normal
severity: normal
status: open
title: IDLE get_the_calltip mishandles raw strings
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



[issue12014] str.format parses replacement field incorrectly

2011-07-06 Thread Ben Wolfson

Ben Wolfson  added the comment:

undo integer -> decimalinteger in docs

--
Added file: http://bugs.python.org/file22601/strformat-as-documented.diff

___
Python tracker 

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



[issue12014] str.format parses replacement field incorrectly

2011-07-06 Thread Ben Wolfson

Changes by Ben Wolfson :


Removed file: http://bugs.python.org/file22598/strformat-as-documented.diff

___
Python tracker 

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



[issue12014] str.format parses replacement field incorrectly

2011-07-06 Thread Ben Wolfson

Ben Wolfson  added the comment:

(same as previous)

--
Added file: 
http://bugs.python.org/file22602/strformat-just-identifiers-please.diff

___
Python tracker 

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



[issue12014] str.format parses replacement field incorrectly

2011-07-06 Thread Ben Wolfson

Changes by Ben Wolfson :


Removed file: 
http://bugs.python.org/file22599/strformat-just-identifiers-please.diff

___
Python tracker 

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



[issue11436] Clarify struct doc for format 's', when it is mentioned without numeric prefix

2011-07-06 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Those others field types have a standard or system-dependent fixed size and a 
number is an optional repeat count. Format 's' is always a single field because 
number prefix for that is special -- a field size.

"For the 's' format character, the count is interpreted as the length of the 
bytes, not a repeat count like for the other format characters; for example, 
'10s' means a single 10-byte string, while '10c' means 10 characters. "

I happen to think is could use a few more words of special explanation. Looking 
again, I think ", which defaults to 1" after the first 'count' above, would be 
sufficient. We nearly always docucument defaults.

--

___
Python tracker 

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