[issue9264] trace.py documentation is incomplete

2010-08-13 Thread Eli Bendersky

Eli Bendersky  added the comment:

Alexander, I agree that the documentation isn't yet in a perfect state and can 
be further improved. Since there's still time for the next milestone of 3.2, 
there's no reason not to improve it.

So I'm open to ideas and am willing to submit improved patches for 3.2

--

___
Python tracker 

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



[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-13 Thread Tim Golden

Tim Golden  added the comment:

Thanks for the feedback. I'll close this for now as "works for me". Feel free 
to reopen if you can come up with anything fresh.

--
resolution:  -> works for me
stage:  -> committed/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



[issue8433] buildbot: test_curses failure, getmouse() returned ERR

2010-08-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fixed in 2.6 in r83970 (3.1 and 2.7 were fixed in revisions r83781, r83782).

--
status: open -> closed

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread Mathieu Bridon

New submission from Mathieu Bridon :

The attached patch allows for shell curly braces with fnmatch.filter().

This makes the following possible:
>>> import fnmatch
>>> import os
>>>
>>> for file in os.listdir('.'):
... if fnmatch.fnmatch(file, '*.{txt,csv}'):
... print file
...
file.csv
file.txt
foo.txt

This is especially convenient with the glob module:
>>> import glob
>>> glob.glob('*.{txt,csv}')
['file.csv', 'file.txt', 'foo.txt']

Hopefully, this makes fnmatch match better the behavior that people expect from 
a shell-style pattern matcher.

Please note: I attached a patch that applies on the Python trunk, but only 
tested it on Python 2.5 on Windows. However, the fnmatch module doesn't seem to 
have changed substantially in between.

--
components: Library (Lib)
files: curly-fnmatch.patch
keywords: patch
messages: 113750
nosy: bochecha
priority: normal
severity: normal
status: open
title: Allow curly braces in fnmatch
type: feature request
Added file: http://bugs.python.org/file18497/curly-fnmatch.patch

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread Mathieu Bridon

Mathieu Bridon  added the comment:

> The attached patch allows for shell curly braces with fnmatch.filter().

Oops, I meant that it allows for curly braces in fnmatch.translate(), which 
makes it available in the whole fnmatch module.

--

___
Python tracker 

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



[issue2944] asyncore doesn't handle connection refused correctly

2010-08-13 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



[issue6609] zipfile: WindowsError [267] The directory name is invalid

2010-08-13 Thread Tim Golden

Tim Golden  added the comment:

Closing as "won't fix": this would be the same if you had any code which tried 
to do os.mkdir ("aux"). By way of comparison, Info-ZIP's UnZip returns 
"checkdir error: aux exists but is not directory" which actually seems less 
useful!

I don't believe it's the responsibility of the zipfile module (or tarfile or 
bz2 or any other) to silently reinterpret the names of files -- how would any 
code in the package expecting "aux/code.c" cope with the name change?

--
assignee:  -> tim.golden
resolution:  -> wont fix
stage:  -> committed/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



[issue3099] On windows, "import nul" always succeed

2010-08-13 Thread Tim Golden

Changes by Tim Golden :


--
assignee:  -> tim.golden
nosy: +tim.golden

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for the patch.

+if j < n and pat[j] == '}':
+j = j+1

I don't get what the purpose of these two lines is. Forbid empty patterns?

+while i < n and pat[j] != '}':
+j = j+1

You probably mean "while j < n" instead of "while i < n".
Regardless, it's simpler to use "j = pat.find('}', j)".

You should also add a test for unmatched braces. Currently:

$ ./python -c "import fnmatch; print(fnmatch.translate('{x'))"
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/antoine/py3k/__svn__/Lib/fnmatch.py", line 129, in translate
while i < n and pat[j] != '}':
IndexError: string index out of range

--
nosy: +pitrou

___
Python tracker 

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



[issue1508864] threading.Timer/timeouts break on change of win32 local time

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The wait loop in Condition.wait() has disappeared under 3.2 (we use builtin 
lock-with-timeout primitives instead).

Overall, I don't think this issue is very important. Changing the system time 
*backwards* can cause all kinds of issues in daemons and other long-running 
programs, which generally assume a monotonous time function. Also, it could be 
disputed what the preferred semantics are (observe "real" time or observe the 
computer clock), and the answer is probably application-specific.

--
nosy: +pitrou

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-13 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Éric Araujo wrote:
> 
> Éric Araujo  added the comment:
> 
> Is it guaranteed that the -b option will be present in every version of file?

Looking at the only use case of _syscmd_file(), it may not even be worth
the trouble of adding the -b option. Fixing the doc-string may be enough:

# Get data from the 'file' system command
if executable:
output = _syscmd_file(executable, '')
else:
output = ''

...

# Split the output into a list of strings omitting the filename
fileout = _architecture_split(output)[1:]

Note how architecture() already chops off the filename, so it
relies on the existing behavior, rather than the one described
in the doc-string of _syscmd_file().

Sorry, Victor, for not spotting this earlier on.

--
title: platform.py: use -b option for file command in   _syscmd_file() -> 
platform.py: use -b option for file command   in  _syscmd_file()

___
Python tracker 

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



[issue670664] HTMLParser.py - more robust SCRIPT tag parsing

2010-08-13 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +Hunanyan

___
Python tracker 

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



[issue9577] html parser bug related with CDATA sections

2010-08-13 Thread R. David Murray

Changes by R. David Murray :


Removed file: http://bugs.python.org/file18495/unnamed

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread R. David Murray

R. David Murray  added the comment:

Thanks for this suggestion and patch.

In general I think more tests would be good,  A test for {} would clarify what 
you are expecting there.

--
nosy: +r.david.murray
stage:  -> patch review
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



[issue9585] Largefile detection in configure fails

2010-08-13 Thread David Austin

New submission from David Austin :

On a Linux Xeon server (x86_64) largefile support is (incorrectly)
not included.

configure determines:
checking size of int... 4
checking size of long... 8
checking size of void *... 8
checking size of short... 2
checking size of float... 4
checking size of double... 8
.
.
.
checking size of off_t... 8

but gets it wrong:

checking whether to enable large file support... no

To me it seems that the logic sizeof_off_t > sizeof_long
is wrong.

(I changed to comparison off_t > int and it built
with largefile support and works fine.)

$ uname -a
Linux cpu3 2.6.31-14-server #48-Ubuntu SMP Fri Oct 16 15:07:34 UTC 2009 x86_64 
GNU/Linux

Ubuntu Lucid

--
components: Build
messages: 113757
nosy: David.Austin
priority: normal
severity: normal
status: open
title: Largefile detection in configure fails
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread Éric Araujo

Éric Araujo  added the comment:

In Bash, * and ? match only characters in existing files, but {a,b} always 
produces two filenames, even if the files don’t exist. Do we want to mimic this 
behavior in fnmatch?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue9586] "warning: comparison between pointer and integer" in multiprocessing build on PPC/Tiger

2010-08-13 Thread Mark Dickinson

New submission from Mark Dickinson :

The PPC Tiger buildbot build output shows (e.g., for 2.7):

/Users/buildbot/buildarea/2.7.parc-tiger-1/build/Modules/_multiprocessing/semaphore.c:421:
 warning: initialization makes pointer from integer without a cast
/Users/buildbot/buildarea/2.7.parc-tiger-1/build/Modules/_multiprocessing/semaphore.c:441:
 warning: comparison between pointer and integer
/Users/buildbot/buildarea/2.7.parc-tiger-1/build/Modules/_multiprocessing/semaphore.c:454:
 warning: comparison between pointer and integer
/Users/buildbot/buildarea/2.7.parc-tiger-1/build/Modules/_multiprocessing/semaphore.c:476:
 warning: comparison between pointer and integer

This looks as though it should be investigated;  these comparisons are almost 
certainly doing the wrong thing.

Including Antoine in the nosy because he was the last person to touch this code 
(I think).

--
assignee: ronaldoussoren
components: Build, Extension Modules, Macintosh
messages: 113759
nosy: jnoller, mark.dickinson, pitrou, ronaldoussoren
priority: normal
severity: normal
status: open
title: "warning: comparison between pointer and integer" in multiprocessing 
build on PPC/Tiger
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue9586] "warning: comparison between pointer and integer" in multiprocessing build on PPC/Tiger

2010-08-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

The same warnings show up on the x86 Tiger buildbot.  Leopard and Snow Leopard 
seem to be fine, though.

--

___
Python tracker 

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



[issue9586] "warning: comparison between pointer and integer" in multiprocessing build on Tiger

2010-08-13 Thread Mark Dickinson

Changes by Mark Dickinson :


--
title: "warning: comparison between pointer and integer" in multiprocessing 
build on PPC/Tiger -> "warning: comparison between pointer and integer" in 
multiprocessing build on Tiger

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

r83971 enables test.support.TESTFN_UNDECODEABLE on non-Windows OSes.

--

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread R. David Murray

R. David Murray  added the comment:

Ah, I had forgotten that detail, Éric.

No, it doesn't seem as if implementing braces as matchers is appropriate.  
fnmatch is only implementing the shell file name globbing. Doing the equivalent 
of brace expansion would have to be done before applying globbing, to be 
consistent with the shell.  Which is too bad.

Unfortunately I think we should probably reject this, though it could be 
discussed on python-ideas to see if the idea can lead to something both 
consistent with the shell and useful.

--
resolution:  -> rejected
stage: patch review -> committed/rejected
status: open -> pending

___
Python tracker 

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



[issue9586] "warning: comparison between pointer and integer" in multiprocessing build on Tiger

2010-08-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

See also:

http://paulbeachsblog.blogspot.com/2007/12/building-firebird-20x-macos-semaphoreh.html

It looks as though SEM_FAILED is defined as -1 on OS X 10.4, and (sem_t *)-1 on 
OS X 10.5+, so it's really a bug in the OS X header file.  Possible workarounds:

(1) write (sem_t *)SEM_FAILED everywhere in the multiprocessing code
(2) define a PY_SEM_FAILED macro and use that
(3) don't worry, be happy;  i.e., just ignore these warnings on OS X 10.4, 
content that they're not a real problem (provided we're not trying to compile 
with a C++ compiler, that is).

--

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

I commited nullimporter_unicode.patch with an unit test as r83972.

--

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-13 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file18434/nullimporter_unicode.patch

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Doing the equivalent of brace expansion would have to be done before
> applying globbing, to be consistent with the shell.

I don't get the "shell consistency" argument. First, there is no single 
definition of "the shell". Second, users of Python generally don't care what a 
shell would do, they simply want to achieve useful tasks (which filename 
matching is arguably part of).

--
status: pending -> open

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread Eric Smith

Eric Smith  added the comment:

I'm not sure it has to be consistent with the shell to be useful, as long as 
the behavior is documented and we possibly add a note explaining the 
differences from the shell. But I agree that a discussion on python-ideas would 
be helpful.

--
nosy: +eric.smith

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread R. David Murray

R. David Murray  added the comment:

My view is that people using fnmatch/glob are expecting to get back the same 
list of files that they would if they ran 'echo ' in the shell.  
The major shells (sh, bash, zsh, csh) seem to be pretty consistent in this 
regard (though sh does less brace expansion than the others...but is almost 
always actually bash these days).

If you just wanted to provide a flexible way for people to match files, then 
instead of fnmatch/glob, we should have a function that walks down a directory 
tree applying a regular expression to the filenames it encounters and returning 
the rooted pathnames of the matches.  That function is easy enough to write 
using standard library facilities.  The special magic of fnmatch/glob is that 
it does a not-so-easy-to-get-right transformation of *shell* globbing rules 
into regular expressions behind the scenes.  That is, in my view its *purpose* 
is to be compatible with the "normal rules" for unix shell globbing.

So currently I'm about -0.5 on this feature.

--

___
Python tracker 

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



[issue9586] "warning: comparison between pointer and integer" in multiprocessing build on Tiger

2010-08-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

BTW, as far as I can tell from the standard (see e.g., section 6.5.9p2 of

www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf

), comparison between a pointer and an integer gives undefined behaviour, 
except in the case where the integer can be interpreted as a null pointer 
constant (which is not the case here).  I'm assuming that the reason that gcc 
only gives a warning here rather than an error is that its general machinery 
can only tell that we're comparing an integer with a pointer, which *could* be 
valid C if that integer is 0.

So I do think this should be fixed, one way or another.

--

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

> Looking at the only use case of _syscmd_file(), it may not even 
> be worth the trouble of adding the -b option. Fixing the doc-string 
> may be enough: (...)

Well, my problem is that _syscmd_file() fails with a non encodable filename on 
Linux because the file program writes the filename to stdout, but os.popen() is 
unable to parse it because the filename is not decodable from the filesystem 
encoding (without surrogateescape).

I would like to add -b option just to avoid this encoding problem.

The bug:
---
$ cp /bin/ls $(echo -ne "ls-\x80")
$ ./python -c "import platform; platform.architecture(executable='ls-\uDC80')"
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/SHARE/SVN/py3k/Lib/platform.py", line 1059, in architecture
output = _syscmd_file(executable, '')
  File "/home/SHARE/SVN/py3k/Lib/platform.py", line 1006, in _syscmd_file
output = f.read().strip()
  File "/home/SHARE/SVN/py3k/Lib/codecs.py", line 300, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 24: invalid 
start byte
---

See also #8611 and #9425.

--

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

@lemburg: Your mail client likes to change the issues' title by adding some 
spaces :-)

--

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-13 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file18469/_PyFile_FromFdUnicode.patch

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

r83973 ignores the name argument of PyFile_FromFd() because it was already 
ignored (it did always produce an error) and it avoids my complex 
_PyFile_FromFdUnicode.patch. Thanks Antoine to having notice that name was 
ignored.

--

___
Python tracker 

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



[issue4762] PyFile_FromFd() doesn't set the file name

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

r83973 ignores the name argument of PyFile_FromFd() because it was already 
ignored (it did always produce an error).

--

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> My view is that people using fnmatch/glob are expecting to get back
> the same list of files that they would if they ran 'echo
> ' in the shell.

But it's not the case since we currently don't process braces anyway.

> The major shells (sh, bash, zsh, csh) seem to be pretty consistent in
> this regard (though sh does less brace expansion than the others...but
> is almost always actually bash these days).

Excluding the 95% (or so) of Windows users, I suppose.

> The special magic of fnmatch/glob is that it does a
> not-so-easy-to-get-right transformation of *shell* globbing rules into
> regular expressions behind the scenes.  That is, in my view its
> *purpose* is to be compatible with the "normal rules" for unix shell
> globbing.

I've never thought that the purpose of glob or fnmatch was to reproduce
shell rules. It's simply a convenient primitive. Wildcard expansion
exists in lots of other software than Unix shells.

--

___
Python tracker 

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



[issue9581] PosixGroupsTester fails as root

2010-08-13 Thread George Yoshida

George Yoshida  added the comment:

test_initgroups fails only if the test is invoked by a root and
the user is assigned to only one group.

If I understand test_initgroups correctly, it
(1)looks for an unused gid,
(2)inits process user's group with that gid,
(3)checks if initgroups worked.

Attached patch simplifies step #1
"max(self.saved_groups) + 1" is used.

test_initgroups passed when root's groups are as follows::
* [0]
* [0, 3, 5]
* [0, 1, 2]

--
Added file: http://bugs.python.org/file18498/test_setgroups.diff

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-13 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> STINNER Victor  added the comment:
> 
>> Looking at the only use case of _syscmd_file(), it may not even 
>> be worth the trouble of adding the -b option. Fixing the doc-string 
>> may be enough: (...)
> 
> Well, my problem is that _syscmd_file() fails with a non encodable filename 
> on Linux because the file program writes the filename to stdout, but 
> os.popen() is unable to parse it because the filename is not decodable from 
> the filesystem encoding (without surrogateescape).
> 
> I would like to add -b option just to avoid this encoding problem.
> 
> The bug:
> ---
> $ cp /bin/ls $(echo -ne "ls-\x80")
> $ ./python -c "import platform; platform.architecture(executable='ls-\uDC80')"
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/home/SHARE/SVN/py3k/Lib/platform.py", line 1059, in architecture
> output = _syscmd_file(executable, '')
>   File "/home/SHARE/SVN/py3k/Lib/platform.py", line 1006, in _syscmd_file
> output = f.read().strip()
>   File "/home/SHARE/SVN/py3k/Lib/codecs.py", line 300, in decode
> (result, consumed) = self._buffer_decode(data, self.errors, final)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 24: 
> invalid start byte
> ---
> 
> See also #8611 and #9425.

Ah, right. Well, then we probably have to use -b after all.

A note on your example: executable is really only meant to be used for
pointing platform to a non-standard location of the Python interpreter
(e.g. in case you used a freeze tool or embedded Python in an application).

However, it is still possible to have that path contain weird
characters, so the example is still valid.

> @lemburg: Your mail client likes to change the issues' title by adding some 
> spaces :-)

The problem is related to the way Mailman splits long subject lines
in the header. The roundup email interface should probably
remove any extra spaces or simply ignore the title altogether.

--
title: platform.py: use -b option for file command  in  _syscmd_file() 
-> platform.py: use -b option for file   command in _syscmd_file()

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

@r.david.murray, @lemburg: So, can I commit my patch?

> However, it is still possible to have that path contain weird
> characters, so the example is still valid.

It's not only a question of "weird" characters. Use case of #8611: install 
Python in a directory with a name not encodable to the filesystem encoding and 
try run Python. Install or use a Python installed in an external media like an 
USB key (encoding problem is not a rare problem with USB keys).

On Windows, it's quite easy to find a character not encodable to the filesystem 
encoding (mbcs). Eg. Ł for codepage 1252. On Linux, any non-ASCII can be used 
if you run Python with C locale (locale encoding: ascii).

#4352 and #8988 (Windows issues, so mbcs encoding) are directly related to 
#8611.

--

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-13 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file18444/pyerr_warnformat-2.patch

___
Python tracker 

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



[issue9581] PosixGroupsTester fails as root

2010-08-13 Thread George Yoshida

Changes by George Yoshida :


Removed file: http://bugs.python.org/file18498/test_setgroups.diff

___
Python tracker 

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



[issue9581] PosixGroupsTester fails as root

2010-08-13 Thread George Yoshida

Changes by George Yoshida :


Added file: http://bugs.python.org/file18499/test_setgroups.diff

___
Python tracker 

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



[issue9586] "warning: comparison between pointer and integer" in multiprocessing build on Tiger

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> (2) define a PY_SEM_FAILED macro and use that

That sounds reasonable.

--

___
Python tracker 

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



[issue9581] PosixGroupsTester fails as root

2010-08-13 Thread George Yoshida

George Yoshida  added the comment:

> FAIL: test_setgroups (test.test_posix.PosixGroupsTester)
> --
> Traceback (most recent call last):
>   File "/home/antoine/py3k/__svn__/Lib/test/test_posix.py", line 428, in 
> test_setgroups
> self.assertListEqual(groups, posix.getgroups())
> AssertionError: First sequence is not a list: range(0, 16)

This one is just a list/range data type issue.

patch for test_initgroups/test_setgroups against py3k attached

--

___
Python tracker 

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



[issue9581] PosixGroupsTester fails as root

2010-08-13 Thread George Yoshida

Changes by George Yoshida :


Added file: http://bugs.python.org/file18500/py3k.diff

___
Python tracker 

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



[issue9586] "warning: comparison between pointer and integer" in multiprocessing build on Tiger

2010-08-13 Thread Jesse Noller

Jesse Noller  added the comment:

I agree with Antoine

--

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-13 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> STINNER Victor  added the comment:
> 
> @r.david.murray, @lemburg: So, can I commit my patch?

Yes, go ahead with 3.2 patch. It should not go into 2.7, though,
since it doesn't solve any problems in 2.7.

If we get complaints about the -b option than we can add a work-around,
but I doubt that we will. It would be good if you could add a test
case for this, since without -b support, the function won't give
an error: it will simply use the defaults.

--
title: platform.py: use -b option for file  command in _syscmd_file() -> 
platform.py: use -b option for filecommand in  _syscmd_file()

___
Python tracker 

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



[issue9587] unittest.assertRaises() return the raised exception

2010-08-13 Thread Denver Coneybeare

New submission from Denver Coneybeare :

It would be great if unittest.assertRaises() returned the raised exception when 
it passes.  This allows the caller to easily perform further checks on the 
exception, such as its attribute values.  Currently assertRaises() returns None 
(when it doesn't return a context manager) so changing the return value should 
not break backwards compatibility.

I see that this was already discussed in issue6275 but I'd like to resurrect 
the discussion since this is a common scenario in my unit tests, and I assume 
others.  Revisions r76238 and r78110 added the ability to get the exception 
from the context manager (good) but sometimes using the context manager 
approach adds unnecessary bloat to already long-winded unit tests.

I've attached a possible patch for the py3k branch 
(unittest.assertRaises.returnex.v1.patch).  Thank you for (re)considering this 
topic :)  Also, thank you Michael Foord for your recent improvements to 
unittest... the new features are very much appreciated!

--
components: Library (Lib)
files: unittest.assertRaises.returnex.v1.patch
keywords: patch
messages: 113781
nosy: denversc, krisvale, michael.foord
priority: normal
severity: normal
status: open
title: unittest.assertRaises() return the raised exception
type: feature request
versions: Python 3.2
Added file: 
http://bugs.python.org/file18501/unittest.assertRaises.returnex.v1.patch

___
Python tracker 

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



[issue9581] PosixGroupsTester fails as root

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

George's patches work for me (thank you!).

--

___
Python tracker 

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



[issue8411] New GIL: improve condition variable emulation on NT

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Closing as fixed, since nothing strange seems to have appeared so far.

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

___
Python tracker 

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



[issue2281] Enhanced cPython profiler with high-resolution timer

2010-08-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee: pitrou -> 
nosy: +belopolsky

___
Python tracker 

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



[issue7862] fileio.c: ValueError vs. IOError with impossible operations

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

All of them should probably raise io.UnsupportedOperation instead (which 
inherits from both IOError and ValueError).

--

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

Note about _Py_wchar2char(): it is possible to convert character by character 
(instead of working on substrings) because the input string doesn't contain 
surrogate pairs. _Py_char2wchar() ensures the the output string doens't contain 
surrogate pairs: if a byte sequence produces a surrogate pairs, the byte 
sequence is encoded using the surrogateescape error handler (U+DC00..U+DCFF 
range). I should add this note in _Py_wchar2char() comment.

--

___
Python tracker 

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



[issue8844] Condition.wait() doesn't raise KeyboardInterrupt

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The portability API is now available (see Include/pytime.h).

--

___
Python tracker 

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



[issue9587] unittest.assertRaises() return the raised exception

2010-08-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> michael.foord

___
Python tracker 

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread R. David Murray

R. David Murray  added the comment:

Well, Windows supports * and ? globs, but not brace expansion, as far as I can 
tell (at least on XP, which is what I currently have access to).

In fact, I don't believe I've run into brace expansion anywhere except in the 
unix shell, whereas as you say * and ? globbing is fairly common, so that might 
be another reason *not* to add it :)

Unfortunately for that argument, Windows XP CMD doesn't appear to support [] 
globbing.

I'm not going to try block this if other people want it.  As you say, there is 
no real standard here to adhere to.

--

___
Python tracker 

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



[issue9585] Largefile detection in configure fails

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The expression "largefile support" is a bit misleading. What it simply does is 
that it uses "long long" instead of "long" in order to store and compute file 
offsets. But, since a long is wide enough on your system to hold a off_t (both 
are 64 bits), it wouldn't make a difference. Your Python is already able to 
address files larger than 4GB, since it uses lseek() in all cases.

(so-called "largefile support" would be enabled if you compiled a 32-bit Python)

By the way, you can run:

$ ./python -m test.regrtest -v test_largefile

to check that the "large file" tests (> 2 GB) pass.

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



[issue9584] Allow curly braces in fnmatch

2010-08-13 Thread Tim Golden

Tim Golden  added the comment:

I don't see any reason to turn this down except, perhaps, for keeping something 
simple. 

Certainly I don't believe that Windows users will be confused by the fact that 
there are wildcards other than "*" and "?". fnmatch already implements [] and 
[!] which are not supported on Windows.

--
nosy: +tim.golden

___
Python tracker 

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



[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban

Daniel Urban  added the comment:

@abstractmethod
@classmethod
def ...
doesn't work because classmethod objects doesn't have a __dict__, so setting 
arbitrary attributes don't work, and abstractmethod tries to set the 
__isabstractmethod__ atribute to True.


The other order:
@classmethod
@abstractmethod
def ...
doesn't work, because the abstractmethod decorator sets the function's 
__isabstractmethod__ attribute to True, but when ABCMeta.__new__ checks the 
object in the namespace of the class, it won't find it, because the classmethod 
object won't have an __isabstractmethod__ attribute.

The situation is the same with staticmethod.

One possible solution would be adding a descriptor to classmethod (and 
staticmethod), with the name "__isabstractmethod__", which on __get__ would 
check its underlying callable for this attribute, and on __set__ would set this 
attribute on that callable. I think this way both order should work.

--

___
Python tracker 

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



[issue9396] Standardise (and publish?) cache handling in standard library

2010-08-13 Thread Nick Coghlan

Nick Coghlan  added the comment:

Have we had any luck getting this to play nicely with the buildbots yet? (I 
lost track of where the last checkin got to). The necessary Modules/Setup 
change to adjust when _collections is built should have propagated through by 
now.

--

___
Python tracker 

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



[issue9548] locale can be imported at startup but relies on too many library modules

2010-08-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue9545] Adding _collections to static build

2010-08-13 Thread Nick Coghlan

Nick Coghlan  added the comment:

Note that the following sequence should work even without changing the buildbot 
behaviour:
- in one checkin, modify Modules/Setup.dist. The buildbots will pick up this 
change on their *subsequent* build (as the build triggered by this checkin, so 
long as it compiles correctly, will trigger the clean step)
- in a latter checkin, make the changes that depend on the new build order

What breaks at the moment is trying to do both of those things in one step, or 
trying to do the first step while compilation is broken.

Since Antoine's last reversion, a few successful build have gone through so it 
should be OK to reapply the original patch again.

Longer term, we probably want to run the clean step both before the configure 
step and after the compile and test steps (even if the compilation fails).

--
nosy: +loewis, ncoghlan

___
Python tracker 

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



[issue9567] Add attribute pointing to wrapped function in functools.update_wrapper

2010-08-13 Thread Nick Coghlan

Changes by Nick Coghlan :


--
resolution:  -> accepted

___
Python tracker 

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



[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-13 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue9560] platform.py: use -b option for file command in _syscmd_file()

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

Commited as r83981.

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



[issue9588] Skip subprocess shell tests on Windows per file association setup

2010-08-13 Thread Brian Curtin

New submission from Brian Curtin :

The fix for #2304 causes issues on Windows if you have file associations setup 
that aren't Python interpters. In my case I have an association setup to open 
.py files in gvim, which causes the shell tests to hang until I quit the 
editor, then it fails because the output from gvim (nothing) doesn't match what 
it would when run through an interpreter.

CommandsWithSpaces.test_shell_* tests should have a skip condition which checks 
file associations before running. The info is stored somewhere in the registry, 
so it should be easy to see that, e.g., gvim.exe isn't a valid Python 
interpreter.

This issue only affects me at the moment, but it could affect other users who 
have tweaked file associations.

--
assignee: brian.curtin
components: Tests, Windows
messages: 113794
nosy: brian.curtin, tim.golden
priority: low
severity: normal
stage: needs patch
status: open
title: Skip subprocess shell tests on Windows per file association setup
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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-13 Thread STINNER Victor

STINNER Victor  added the comment:

r83981 closes #9560: avoid the filename in _syscmd_file() to fix a bug with non 
encodable filenames in platform.architecture().

--

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

About wchar2char:
- PEP 383 says “With this PEP, non-decodable bytes >= 128 will be represented 
as lone surrogate codes U+DC80..U+DCFF. Bytes below 128 will produce 
exceptions”. Your patch accepts bytes below 128.
- I don't understand why you decrement `size` in the second pass. Perhaps you 
want to add `assert size == 0` at the end?

--

___
Python tracker 

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



[issue9588] Skip subprocess shell tests on Windows per file association setup

2010-08-13 Thread Brian Curtin

Brian Curtin  added the comment:

Attached is a patch that fixes this for me, and I *think* it's looking in the 
most correct area for the information.

Tim or any other Windows users, would you mind seeing that the skip does not 
occur on your machines, thus allowing it to properly run those tests?

--
keywords: +patch
Added file: http://bugs.python.org/file18502/issue9588.diff

___
Python tracker 

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



[issue9589] test_heapq: AttributeError: 'int' object has no attribute 'pop'

2010-08-13 Thread Florent Xicluna

New submission from Florent Xicluna :

Various buildbots show a failure on test_heapq.

 * "x86 FreeBSD 3.x" failed on revision r83882 (r83869 was OK)
   
http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%203.x/builds/492
   and next runs were OK, too

 * "PPC (Leopard|Tiger) 3.x" and "x86 Tiger 3.x" fail consistently from r83889 
onwards.

 * all "gentoo 3.x" and "Ubuntu 3.x" fail on r83981
   
http://www.python.org/dev/buildbot/all/builders/x86%20gentoo%203.x/builds/2816
   
http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%203.x/builds/1707

--
components: Library (Lib), Tests
keywords: buildbot
messages: 113798
nosy: flox, haypo
priority: normal
severity: normal
stage: needs patch
status: open
title: test_heapq: AttributeError: 'int' object has no attribute 'pop'
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



[issue9558] build_ext fails on VS8.0

2010-08-13 Thread R. David Murray

R. David Murray  added the comment:

Éric, 'release blocker' policy depends on the release manager :)  Barry, for 
example, likes people to set release blocker on issues they want him to make 
sure he looks at before the release.  The release manager can always knock it 
down.  As can other developers if they judge it isn't really a release blocker 
(unless the RM set it or it was set specifically to get the RMs attention).

When you reset the priority on this one, though, you didn't give it a new 
priority.  I'm setting it to normal, since the bug report (at the moment at 
least) is only about a test failure.  If it represents a bug in the ability to 
build extensions on Windows with VS8, you could raise the priority.

--
nosy: +r.david.murray
priority:  -> normal

___
Python tracker 

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



[issue9589] test_heapq: AttributeError: 'int' object has no attribute 'pop'

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This is a variant of the kind of annoyance pointed out in #9548. Here, it seems 
addbuilddir() in Lib/site.py shouldn't import sysconfig, because it imports the 
re module.

--
nosy: +pitrou

___
Python tracker 

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



[issue9589] test_heapq: AttributeError: 'int' object has no attribute 'pop'

2010-08-13 Thread Florent Xicluna

Florent Xicluna  added the comment:

For some reason, sys.modules['heapq'] contains the Python implementation 
instead of the C implementation.

Tested with r83981 on python 3:

Python 3.2a1+ (py3k:83981M, Aug 13 2010, 19:02:31) 
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import heapq
>>> heapq.heappop(10)
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/florent/dev/python/py3trunk/Lib/heapq.py", line 140, in heappop
lastelt = heap.pop()# raises appropriate IndexError if heap is empty
AttributeError: 'int' object has no attribute 'pop'

>>> import _heapq
>>> _heapq.heappop(10)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: heap argument must be a list


These tests (TestErrorHandling) are supposed to run with the C module only.

--

___
Python tracker 

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



[issue9590] __init__ TypeError reverses expected vs received args

2010-08-13 Thread Anthony Long

New submission from Anthony Long :

import unittest
from selenium import selenium


class SetupSomething(unittest.TestCase):

def setUp(self, URL):

self.selenium = selenium("localhost", , "*firefox", self.URL)


def tearDown(self):
pass


class TestSomething(SetupSomething):
def __init__():
print "bug."

def setUp(self):
self.URL = "http://google.com/";

def tearDown(self):
pass

def test_tester(self):
self.selenium.open('/')
print "no"



unittest.main()


TypeError: '__init__() takes no arguments (2 given)'

--
messages: 113802
nosy: antlong
priority: normal
severity: normal
status: open
title: __init__ TypeError reverses expected vs received args
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



[issue9590] __init__ TypeError reverses expected vs received args

2010-08-13 Thread Florent Xicluna

Florent Xicluna  added the comment:

Definitely it does not look like a bug.

>>> import unittest
>>> help(unittest.TestCase)

...

 |  If it is necessary to override the __init__ method, the base class
 |  __init__ method must always be called. It is important that subclasses
 |  should not change the signature of their __init__ method, since instances
 |  of the classes are instantiated automatically by parts of the framework
 |  in order to be run.

...

--
nosy: +flox
resolution:  -> invalid
stage:  -> committed/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



[issue9333] Expose a way to enable os.symlink on Windows

2010-08-13 Thread Brian Curtin

Brian Curtin  added the comment:

I've tried changing privileges for a user and I'm not seeing that they get 
reflected in real-time while an application is running. Maybe I'm not doing it 
right, but I'm not seeing it. I'm also not able to find anything about that 
being supported or anyone else trying this...actually, there's very little 
privilege related info anywhere outside of "these are the available privileges".

I'll spend a little more time and see if I can channel any sysadmin types to 
see if they know anything about this. It's looking like we'll just have to try 
enabling on module loading and if it works, great, otherwise there's no 
os.symlink for the lifetime of the interpreter.

Attached is a patch that works safely on XP/Server 2003 where there is no 
symlink possibility. It still has that test_tarfile error which I'll get to 
next.

--
components: +Windows
keywords: +needs review
Added file: http://bugs.python.org/file18503/issue9333_v2.diff

___
Python tracker 

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



[issue9590] __init__ TypeError reverses expected vs received args

2010-08-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

What flox said.

There's no reversal here:  you've defined an __init__ method that takes no 
arguments.  The unittest framework tries to instantiate a TestSomething 
instance by calling it with two arguments (one of which is self).  If you look 
at the source for the TestCase class you'll see:

def __init__(self, methodName='runTest'):
...


Note that the message you're seeing applies to *your* __init__ method:  that 
method expects no arguments (because that's the way you defined it), but it's 
getting two (because the unittest test runner calls it that way).

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue9589] test_heapq: AttributeError: 'int' object has no attribute 'pop'

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch which works if the patch in #9548 is also applied.
It won't work alone because opening a file in text mode currently imports 
locale which imports re, etc. ... all before adding the build dir to sys.path.

Of course, since the logic in addbuilddir() is now much simpler, it could also 
be rewritten in C somewhere (where?), and the launched much earlier during the 
startup phase.

--
keywords: +patch
Added file: http://bugs.python.org/file18504/addbuilddir.patch

___
Python tracker 

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



[issue9580] os.confstr() doesn't decode result according to PEP 383

2010-08-13 Thread David Watson

David Watson  added the comment:

The CS_PATH variable is a colon-separated list of directories ("the value for 
the PATH environment variable that finds all standard utilities"), so the file 
system encoding is certainly correct there.

I don't see any reference to an encoding in the POSIX spec for confstr().

--

___
Python tracker 

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



[issue9579] In 3.x, os.confstr() returns garbage if value is longer than 255 bytes

2010-08-13 Thread David Watson

David Watson  added the comment:

I don't see why confstr() values shouldn't change.  sysconf() values can change 
between calls, IIRC.  Implementations can also define their own confstr 
variables - they don't have to stick to the POSIX stuff.

And using a loop means the confstr() call only appears once in the source, 
which is more elegant, right? :)

--

___
Python tracker 

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



[issue9586] "warning: comparison between pointer and integer" in multiprocessing build on Tiger

2010-08-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Actually, since SEM_FAILED isn't public and is only used in one file, it seems 
simplest just to redefine it on Mac.  Here's a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file18505/sem_failed_tiger.patch

___
Python tracker 

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



[issue9587] unittest.assertRaises() return the raised exception

2010-08-13 Thread Michael Foord

Michael Foord  added the comment:

If you want the exception then use assertRaises in a with statement. The 
exception is available as an attribute on the context manager.

--
resolution:  -> rejected
stage:  -> committed/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



[issue9591] kqueu not reporting EOF under certain circumstances

2010-08-13 Thread Volodymyr Kostyrko

New submission from Volodymyr Kostyrko :

This one is BSD related. FreeBSD 8.1.

This works:
# cat test.py | ./test.py
-1 684 32768 0 0
#

This hangs:
# ./test.py < file
-1 684 0 0 0

The difference is that in second case popped kevent lacks any data on EOF.

--
components: Library (Lib)
files: test.py
messages: 113811
nosy: Volodymyr.Kostyrko
priority: normal
severity: normal
status: open
title: kqueu not reporting EOF under certain circumstances
type: behavior
versions: Python 3.1
Added file: http://bugs.python.org/file18506/test.py

___
Python tracker 

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



[issue9591] kqueue not reporting EOF under certain circumstances

2010-08-13 Thread Volodymyr Kostyrko

Changes by Volodymyr Kostyrko :


--
title: kqueu not reporting EOF under certain circumstances -> kqueue not 
reporting EOF under certain circumstances

___
Python tracker 

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



[issue9587] unittest.assertRaises() return the raised exception

2010-08-13 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

That was a bit abrupt, want't it?  Denver is well aware of this and said: 
"but sometimes using the context manager approach adds unnecessary bloat to 
already long-winded unit tests."

I happen to agree with him and don't see why we can't discuss this some.  We 
never did discuss this fully in issue 6275, I just tempered my patch a bit to 
at least get something done.

I don't think this should be rejected out of hand simply because TBDFL said 
that its an "'odd' API for a unittest assert method".  assertRaises already 
return a context manager if called without a callable (an odd api?), and it can 
just as well return an exception if called _with_ a callable.

--

___
Python tracker 

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



[issue9587] unittest.assertRaises() return the raised exception

2010-08-13 Thread Michael Foord

Michael Foord  added the comment:

Sorry, it's a reopened bug requesting a feature that has already been 
considered and rejected previously. Yes I was abrupt, my apologies - I'm trying 
to clear my backlog before I go away.

--

___
Python tracker 

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



[issue5504] ctypes should work with systems where mmap can't be PROT_WRITE and PROT_EXEC

2010-08-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Since r83837, the py3k _ctypes module fails to build on my OS X 10.6 machine:

*** WARNING: renaming "_ctypes" since importing it failed: 
dlopen(build/lib.macosx-10.6-x86_64-3.2-pydebug/_ctypes.so, 2): Symbol not 
found: _ffi_closure_alloc
  Referenced from: 
/Users/dickinsm/python/svn/py3k/build/lib.macosx-10.6-x86_64-3.2-pydebug/_ctypes.so
  Expected in: flat namespace
 in 
/Users/dickinsm/python/svn/py3k/build/lib.macosx-10.6-x86_64-3.2-pydebug/_ctypes.so

This looks like a different issue from the one above, though.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue5504] ctypes should work with systems where mmap can't be PROT_WRITE and PROT_EXEC

2010-08-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Same error on the buildbots, here:

http://www.python.org/dev/buildbot/3.x/builders/PPC%20Leopard%203.x/builds/288/steps/compile/logs/stdio

--

___
Python tracker 

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



[issue9592] Limitations in objects returned by multiprocessing Pool

2010-08-13 Thread Freek Dijkstra

New submission from Freek Dijkstra :

I came across three limitation in the multiprocessing module that were not 
handled correctly.

Attached is a file that reproduces the errors in minimal code. I tested them 
with Python 2.6.5 and 3.1.2.

Expected result:
multiprocessing.Pool's promises a map function where each result is returned 
transparently to the main process (despite that the calculation was done in a 
subprocess)

Actual result:
Not all values returned by a subprocess are returned transparently.
I expected multiprocessing to handle these cases gracefully by yielding an 
Exception in the Main process.

The cases I found are:

1) A multiprocessing worker can not return (return, not raise!) an Exception. 
If this is attempted, the result handler thread in the Pool calls the exception 
with no arguments, 
which might raise an error if multiple arguments are required:
TypeError: ('__init__() takes exactly 2 arguments (1 given)', , ())


2) A multiprocessing worker can not return an hashlib Object.
If this is attempted, pickle returns an error:
PicklingError: Can't pickle : attribute lookup 
_hashlib.HASH failed


3) A multiprocessing worker can not return an Object which overrides 
__getattr__, and accesses a variable from self in __getattr__.
If this is attempted, Python 2.6 crashes with a bus error:
Program terminated by uncaught signal #10 after 1.56 seconds.
Python 3.1 yields the error:
RuntimeError: maximum recursion depth exceeded while calling a Python object

--
components: Library (Lib)
files: multiprocessingbugs.py
messages: 113816
nosy: macfreek
priority: normal
severity: normal
status: open
title: Limitations in objects returned by multiprocessing Pool
type: crash
versions: Python 2.6, Python 3.1
Added file: http://bugs.python.org/file18507/multiprocessingbugs.py

___
Python tracker 

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



[issue9592] Limitations in objects returned by multiprocessing Pool

2010-08-13 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +jnoller

___
Python tracker 

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



[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-13 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

After chatting with __ap__ on irc, i'm going to reject this patch for 2.6.6.

--
nosy: +barry
priority: release blocker -> 
status: open -> closed

___
Python tracker 

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



[issue9593] utf8 codec readlines error after "\x85 "

2010-08-13 Thread Joseph Copenhaver

New submission from Joseph Copenhaver :

The IO readlines() facility incorrectly processes utf8 files for some unknown 
reason. Specifically, the call generates too many entries in the lines array 
result after a character sequence "\x85 blah" which gets cut as ("\x85 
","blah") according the the resultant array. My workaround for this issue is 
not elegant, especially since I need the newline characters:

#BEGIN: WTF
a_str_whole = fs_in.read()
fs_in.close()
a_str_lines = a_str_whole.split("\n")
for idx in range(0,len(a_str_lines)-1):
   a_str_lines[idx]+="\n"
#END: WTF

Attached is an example script that defines the problem clearly.

--
components: IO, Interpreter Core, Regular Expressions, Unicode
files: ErrorProof-utf8-x85.py
messages: 113818
nosy: jcope
priority: normal
severity: normal
status: open
title: utf8 codec readlines error after "\x85 "
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file18508/ErrorProof-utf8-x85.py

___
Python tracker 

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



[issue9589] test_heapq: AttributeError: 'int' object has no attribute 'pop'

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a C version of addbuilddir. It solves the present issue.

--
Added file: http://bugs.python.org/file18509/c-addbuildir.patch

___
Python tracker 

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



[issue9593] utf8 codec readlines error after "\x85 "

2010-08-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components:  -Regular Expressions
nosy: +ezio.melotti

___
Python tracker 

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



[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban

Daniel Urban  added the comment:

Here is a patch, which adds a descriptor to classmethod and staticmethod.
Pseudocode:

__get__(self, inst, owner):
if getattr(inst.callable, '__isabstractmethod__', False):
return True
return False

__set__(self, inst, value):
inst.callable.__isabstractmethod__ = bool(value)

--
keywords: +patch
Added file: http://bugs.python.org/file18510/issue5867.diff

___
Python tracker 

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



[issue9593] utf8 codec readlines error after "\x85 "

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

U+0085 corresponds to a line terminator (*). and codecs.open() observes this 
convention.
Do note that the new io.open() (or the built-in open() in 3.x) only recognizes 
'\r' and '\n' as line separators.

In any case, changing this behaviour would break compatibility, therefore I'm 
rejecting the issue.

(*) http://en.wikipedia.org/wiki/Newline#Unicode

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



[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The patch doesn't check that instantiating these methods work at all.

--
nosy: +benjamin.peterson, pitrou
stage:  -> patch review
versions: +Python 3.2 -Python 3.1

___
Python tracker 

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



[issue9180] Memory Error

2010-08-13 Thread Mark Dickinson

Changes by Mark Dickinson :


--
status: pending -> closed

___
Python tracker 

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



[issue9593] utf8 codec readlines error after "\x85 "

2010-08-13 Thread Joseph Copenhaver

Joseph Copenhaver  added the comment:

I now recognize the issue was in regard to format problems and not python, but 
the area where this code will be used requires the use of the codecs module.
Is there any way to get the efficiency of codecs I/O readlines() chunking 
behavior and specify a list of characters to use? Can the file delimiter be 
changed in python as in perl?

Thanks for the quick response.

--

___
Python tracker 

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



[issue9588] Skip subprocess shell tests on Windows per file association setup

2010-08-13 Thread Tim Golden

Tim Golden  added the comment:

Assuming I understand you correctly, could I propose this rather less involved 
patch which simply specifies the sys.executable as part of the command line. 
The test doesn't propose to test file associations and indeed two of the test 
already fill in the executable

--
Added file: http://bugs.python.org/file18511/9588.exec.patch

___
Python tracker 

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



[issue9588] Skip subprocess shell tests on Windows per file association setup

2010-08-13 Thread Brian Curtin

Brian Curtin  added the comment:

Yeah that's much better :)
I should have asked if you left out sys.executable out intentionally before 
coming up with my patch...I assumed it was intended to be different due to 
shell=1 or something.

Go ahead and apply if you want.

--
assignee: brian.curtin -> tim.golden

___
Python tracker 

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



[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban

Daniel Urban  added the comment:

If I understand correctly, some tests are needed for the instantiation of 
classes with abstract static/classmethods. I added them in issue5867a.diff.

--
Added file: http://bugs.python.org/file18512/issue5867a.diff

___
Python tracker 

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



  1   2   >