[issue8353] Negative exponentiation behaving oddly in python shell

2010-04-09 Thread Martin v . Löwis

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

This is expected behavior. The power operator binds with higher precedence than 
the unary minus:

http://docs.python.org/reference/expressions.html#unary-arithmetic-and-bitwise-operations

Therefore, your term is interpreted as

-(4 ** 2)

As for it only affects the prompt: I can't reproduce that. If I put

print(-4**2)

in a script and run that, it still prints -16 for me.

--
nosy: +loewis
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue8350] os.mkdir doc comment is incorrect

2010-04-09 Thread Shashwat Anand

Shashwat Anand anand.shash...@gmail.com added the comment:

Tested on trunk. 

11:46:02 l0nwlf-MBP:python-svn $ ./python.exe 
Python 2.7a4+ (trunk:79888M, Apr  9 2010, 11:41:22) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type help, copyright, credits or license for more information.
 import posix
 posix.mkdir('1')
 posix.mkdir('2', 000)
 posix.mkdir('3', mode=000)
Traceback (most recent call last):
  File input, line 1, in module
TypeError: mkdir() takes no keyword arguments
 import os
 os.mkdir('4', 777)
 os.mkdir('5', mode=777)
Traceback (most recent call last):
  File input, line 1, in module
TypeError: mkdir() takes no keyword arguments
 

The two options to fix this are:
1. Patch python-svn/Modules/posixmodule.c to take the keyword arguments.
2. Modify the PyDoc in posixmodule.c as Todd suggested.

I had attached a patch which solves the issue using solution '2'. 

Also I observed that os.makedirs() have no such issue even though it uses 
os.mkdir() because it uses 'mkdir(name, mode)' to call mkdir.

--
keywords: +patch
nosy: +l0nwlf
versions: +Python 2.7
Added file: http://bugs.python.org/file16836/posixmodule.patch

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



[issue8353] Negative exponentiation behaving oddly in python shell

2010-04-09 Thread Chris Ward

Chris Ward cward...@gmail.com added the comment:

Thanks for clearing that up and pointing me in the right direction. I should 
have tested print first. The assumption was based on the evaluation of (-4) ** 
2 within an expression, which does return correctly. I hadn't made the 
distinction that the parentheses made it evaluate differently by containing the 
unary.

--

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



[issue7443] test.support.unlink issue on Windows platform

2010-04-09 Thread Tim Golden

Tim Golden m...@timgolden.me.uk added the comment:

This is basically a rerun of this discussion a couple of years ago:

  http://mail.python.org/pipermail/python-dev/2008-April/078333.html

The problem certainly still happens against trunk -- I have a semi-aggressive 
test-harness which can cause it to reproduce pretty much on-demand. I proposed 
an approach here:

  http://mail.python.org/pipermail/python-dev/2008-April/078339.html

but when I started digging into test_support it all got a bit hairy because -- 
naturally -- test.support.unlink is used in a *lot* of places. In short, 
there's still a problem to be fixed. I believe that a rename-unlink dance would 
solve it, but only at the cost of affecting a lot of tests.

--
nosy: +tim.golden

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



[issue4007] make clean fails to delete .a and .so.X.Y files

2010-04-09 Thread Shashwat Anand

Shashwat Anand anand.shash...@gmail.com added the comment:

skip.montanaro forgot to attached the patch obviously, however the issue is 
trivial but there i.e. the presence of libpython.a file.

--
nosy: +l0nwlf

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



[issue8352] imp.find_module of a .py ending dir causes glibc double free crash

2010-04-09 Thread Shashwat Anand

Shashwat Anand anand.shash...@gmail.com added the comment:

quotemkdir bla.py; python -c 'import imp; imp.find_module(bla, [.])'

This causes bpython to crash after the first input char if such a
directory exist./quote

I am sure you do not mean 'bpython intepretor' here.

--
nosy: +l0nwlf

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



[issue8354] siginterrupt with flag=False is reset when signal received

2010-04-09 Thread Andrew Bennetts

New submission from Andrew Bennetts s...@users.sourceforge.net:

The effect of signal.siginterrupt(somesig, False) is reset the first time a 
that signal is received.  This is not the documented behaviour, and I do not 
think this is a desireable behaviour.  It renders siginterrupt effectively 
useless at providing the robustness against EINTR it is intended to provide.

Attached is a fairly simple program to show this using SIGWINCH: run it in a 
resizeable terminal, and resize it twice.  Notice that on the second terminal 
resize (i.e. the second SIGWINCH signal) the program crashes with an EINTR from 
the os.read.

A partial workaround for the problem is to call signal.siginterrupt(somesig, 
False) again inside your signal handler, but it's very fragile.  It depends on 
Python getting a chance to run the Python function registered by the 
signal.signal call, but this is not guaranteed.  If there's frequent IO, that 
workaround might suffice.  For the sig-test.py example attached to this bug, it 
doesn't (try it).

The cause seems to be that signal_handler in signalmodule.c unconditionally 
does PyOS_setsig(sig_num, signal_handler) [except for SIGCHLD], which 
unconditionally invokes siginterrupt(sig, 1).  A possible fix would be to add a 
'int siginterrupt_flag;' to the Handlers array, and arrange for that value to 
be passed instead of the hard-coded 1.  Another might be to not call 
PyOS_setsig from signal_handler at all -- I'm not sure why it is trying to 
reinstall itself, but perhaps there's some issue there I'm not aware of.

--
components: Library (Lib)
files: sig-test.py
messages: 102688
nosy: spiv
severity: normal
status: open
title: siginterrupt with flag=False is reset when signal received
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file16837/sig-test.py

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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-09 Thread Darryl Miles

Darryl Miles darryl.mi...@darrylmiles.org added the comment:

In order to build Python with a specific version of OpenSSL followed the CYGWIN 
instructions and edited Modules/Setup to make it read (note - I added 
-L$(SSL) into the linker options too, since by default on CentOS 5.4 i386 
OpenSSL build in static library mode ala ../openssl-1.0.0/libssl.a) :

SSL=../openssl-1.0.0
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -L$(SSL) -lssl -lcrypto


It is not clear to me what Python's goals are:
 * To be backward compatible, in which case I don't know your historical use of 
SSL_shutdown().
 * To be a thin-layer (1:1) over OpenSSL, so that power users can harness the 
full potential of OpenSSL if they are willing to understand the finer points.
 * To provide a full-featured Python API.
 * To provide a Python API that is easy to use within the Python paradigm.

These goals may not be convergent.

--
nosy: +dlmiles
Added file: http://bugs.python.org/file16838/python_ssl.c.txt

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



[issue7978] SocketServer doesn't handle syscall interruption

2010-04-09 Thread Andrew Bennetts

Andrew Bennetts s...@users.sourceforge.net added the comment:

Note that a trivial untilConcludes isn't correct for select if a timeout was 
passed.  If a select(..., 60) was interrupted after 59 seconds, you probably 
want to restart it with a timeout of 1 second, not 60.

The SocketServer_eintr.diff patch has this flaw.

--
nosy: +spiv

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



[issue8352] imp.find_module of a .py ending dir causes glibc double free crash

2010-04-09 Thread Senthil Kumaran

Senthil Kumaran orsent...@gmail.com added the comment:

No, that is not bpython interpreter. The a crash report on python interpreter 
observed with imp module when a directory ends with .py.

--
nosy: +orsenthil

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



[issue3985] removed string module from distutils [patch]

2010-04-09 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Distutils is now frozen. Moving it to Distutils2

--
components: +Distutils2 -Distutils

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



[issue5411] add xz compression support to distutils

2010-04-09 Thread Tarek Ziadé

Changes by Tarek Ziadé ziade.ta...@gmail.com:


--
components: +Distutils2 -Distutils

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



[issue870479] Scripts need platform-dependent handling

2010-04-09 Thread Tarek Ziadé

Changes by Tarek Ziadé ziade.ta...@gmail.com:


--
components: +Distutils2 -Distutils

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



[issue976869] Stripping script extensions with distutils

2010-04-09 Thread Tarek Ziadé

Changes by Tarek Ziadé ziade.ta...@gmail.com:


--
components: +Distutils2 -Distutils

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



[issue8352] imp.find_module of a .py ending dir causes glibc double free crash

2010-04-09 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

It looks like a duplicate of #7732.

--
nosy: +flox
resolution:  - duplicate
status: open - closed
superseder:  - imp.find_module crashes Python if there exists a directory 
named __init__.py

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2010-04-09 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

see also http://bugs.python.org/issue8352#msg102662

--
nosy: +doko, l0nwlf, ncoghlan, orsenthil

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



[issue6715] xz compressor support

2010-04-09 Thread Nicolas Dumazet

Changes by Nicolas Dumazet nicd...@gmail.com:


--
nosy: +nicdumz

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2010-04-09 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

I can reproduce this locally. I believe it is relevant that a simple import 
crash (with crash.py as the directory) doesn't cause a problem - there must be 
something higher in the import machinery which avoids the issue.

--
assignee:  - ncoghlan

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



[issue7443] test.support.unlink issue on Windows platform

2010-04-09 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

It is unlikely that it will go further then discussion unless this bug can be 
reliably reproduced to be debugged. If not testcase when at least Process 
Monitor log would be helpful.

--

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



[issue4908] Implement PEP 376

2010-04-09 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Work done in pkgutil, in the Distutils2 project, see PEP 376 for API names.

--
components: +Distutils2 -Distutils
title: adding a get_metadata in distutils - Implement PEP 376

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



[issue7443] test.support.unlink issue on Windows platform

2010-04-09 Thread Tim Golden

Tim Golden m...@timgolden.me.uk added the comment:

In one window run the attached script (assumes you have pywin32 installed) with 
a parameter of the directory the TESTFN file will end up in. Then run, eg, 
test_zipfile in another window. For me:

c:\temp watch_dir.py C:\work_in_progress\make-snapshots\trunk\python\Lib

C:\work_in_progress\make-snapshots\trunk\python\Lib ..\pcbuild\python.exe -m 
test.test_zipfile

Obviously, you'd have to change the path to be wherever you're running the test 
suite from.

The watch_dir script sits there looking for file activity, then takes and 
releases a delete-share handle on the file. It's enough to disrupt certain 
tests (such as test_zipfile) pretty much every time. Other tests are affected 
less, or only the first few times. Not sure why, but it's certainly enough to 
reproduce the general effect of TortoiseSVN or indexer or virus checker.

--
Added file: http://bugs.python.org/file16839/watch_dir.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7443
___import os, sys

import winerror
import win32file
import win32con

if __name__ == '__main__':
  path_to_watch = sys.argv[1]
  hDir = win32file.CreateFile (
path_to_watch,
1, # FILE_LIST_DIRECTORY
win32con.FILE_SHARE_READ | win32con.FILE_SHARE_WRITE,
None,
win32con.OPEN_EXISTING,
win32con.FILE_FLAG_BACKUP_SEMANTICS,
None
  )
  print = Watching, path_to_watch

  watching = set ()
  handles = []
  try:
while 1:
  results = win32file.ReadDirectoryChangesW (
hDir, 1024, True,
win32con.FILE_NOTIFY_CHANGE_FILE_NAME,
None, None
  )
  for action, filename in results:
filename = os.path.join (path_to_watch, filename)
if action == 1 and filename not in watching:
  try:
handle = win32file.CreateFile (
  filename,
  0, win32file.FILE_SHARE_DELETE,
  None, win32file.OPEN_EXISTING, 0, 0
)
handles.append (handle)
  except win32file.error, (errno, module, message):
if errno == winerror.ERROR_SHARING_VIOLATION:
  print .. Can't hold, repr (filename)
else:
  print .. Problem with %r: %s % (filename, message)
  else:
watching.add (filename)
print .. Holding, repr (filename)
handle.Close ()
handles.remove (handle)
watching.discard (filename)
print .. Released, repr (filename)

  finally:
for handle in handles:
  handle.Close ()

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2010-04-09 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Ah, OK - the problem is confined solely to the wrapper for the Python imp 
module function. The normal import machinery doesn't go through the wrapper and 
hence doesn't have the problem.

The PyFile_FromFile logic is a little convoluted, but Florent's patch looks 
correct. Currently, if the dircheck call in fill_file_fields fails, the 
function returns NULL, but leaves the file object populated (included its f_fp 
field). The Py_DECREF call then implicitly closes the file, resulting in a 
double close when call_find_module does the same thing manually.

One other thing that is a little dubious in this code is the lack of error 
checking on the conversion of mode to a string object in fill_file_fields. 
That's fine for file_init (where mode came from a Python string object in the 
first place), but not valid for PyFile_FromFile (where mode is passed in as a 
char * instance).

--
assignee: ncoghlan - flox

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



[issue7584] datetime.rfcformat() for Date and Time on the Internet

2010-04-09 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

Atom spec - 
http://www.atomenabled.org/developers/syndication/atom-format-spec.php#date.constructs

--

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread anatoly techtonik

New submission from anatoly techtonik techto...@gmail.com:

Script/diff.py default context diff format is outdated. It makes sense to 
produce unified diff by default.

--
components: Demos and Tools
messages: 102701
nosy: techtonik
severity: normal
status: open
title: diff.py produce unified format by default
versions: Python 2.6, Python 2.7

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2010-04-09 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

An interesting part of this story is *why* it doesn't crash in Py3k (despite 
explicitly closing the file descriptor in the same way as 2.x closes the C file 
pointer).

The reason is that PyFile_FromFd (the closest Py3k equivalent to 
PyFile_FromFile) will sometimes leave the file descriptor open, even if closefd 
is True. Specifically, this will happen if the raw file IO object fails to be 
created. Any subsequent failure while opening the file (e.g. while creating the 
line buffering or text wrapper) will trigger the same double close bug as 
occurs in 2.x.

io_open needs to be fixed so this behaviour is consistent: if creation of the 
raw file IO object fails and closefd is True, io_open should close the file 
descriptor so that the behaviour on error is consistent.

--

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



[issue6087] distutils.sysconfig.get_python_lib gives surprising result when used with a Python build

2010-04-09 Thread Ray.Allen

Ray.Allen ysj@gmail.com added the comment:

Yes, I agree with you, this may be a bug? 

Seemingly, the sysconfig.get_python_lib() should act just like the 
get_python_inc() function, return [prefix]/lib/python[version] in case of 
python_build flag is False, and [prefix]/Lib in case of python_build flag 
is True.

--
nosy: +ysj.ray
versions: +Python 3.2 -Python 2.6, Python 2.7

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



[issue6087] distutils.sysconfig.get_python_lib gives surprising result when used with a Python build

2010-04-09 Thread Ray.Allen

Changes by Ray.Allen ysj@gmail.com:


--
versions: +Python 2.7 -Python 3.2

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



[issue6087] distutils.sysconfig.get_python_lib gives surprising result when used with a Python build

2010-04-09 Thread Ray.Allen

Changes by Ray.Allen ysj@gmail.com:


--
versions: +Python 2.6, Python 3.2

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2010-04-09 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
nosy: +pitrou

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


--
keywords: +patch
Added file: 
http://bugs.python.org/file16840/8355.diff-py-unified-by-default.diff

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



[issue7978] SocketServer doesn't handle syscall interruption

2010-04-09 Thread Yaniv Aknin

Yaniv Aknin yaniv.ak...@gmail.com added the comment:

pitrou, re. test code: I actually started with the test code, so that part is 
done.

I opted to use a forked SocketServer rather than threads. I'm not an expert on 
the low-level details of a multi-threaded process receiving threads, but it 
seems to me like there's a chicken and egg issue here: suppose we have threadA 
(blocking on select()) and threadB (managing the test and doing something like 
os.kill(os.getpid(), SIGFOO). I think by definition the thread running when the 
signal is received is threadB (since it sent the signal), and I'm not sure 
threadA will be interrupted properly that way (threads are sneaky, now aren't 
they). So I cleaned up test_socketserver.py a bit, split it to a base test case 
and concrete test cases, and added a separate test case which uses os.fork() 
rather than threads and tests that way.

The attached patch is against recent py3k and includes both neologix's patch 
(adapted to py3k) and the added test code. If this looks good, I'll easily 
backport it to 2.x/trunk.

spiv, re. handling timeout in select: You're very right, and I'm not sure how 
we should handle it if we want to take the untilConcludes code that is 
currently shared between subprocess.py and socketserver.py and move it outside. 
For subprocess' and socketserver's specific cases, the naive implementation 
which doesn't handle timeouts is OK, because they don't use the timeout 
parameter anyway.

Moving it outside warrants more discussion. Remember this isn't just about 
select() - it's a general user-space-restarter for any of the myriad of slow 
system calls that might be interrupted. There is some tension between elegance 
and even feasibility of correct implementation vs. the wrapper hiding 
functionality of some of these system calls. You could argue that if the user 
of the wrapper is unhappy about the lost functionality, they can make their own 
wrapper. 

Unless we can reach a resolution quickly, my gut feeling is that the current 
patch should be applied as-is and this issue be closed. A new issue along the 
lines of Extract duplicate interruption-restart code to a relevant module and 
review stdlib for unprotected select() calls should be opened instead. Your 
thoughts?

--
Added file: http://bugs.python.org/file16841/socketserver_eintr_py3k.diff

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



[issue6650] sre_parse contains a confusing generic error message

2010-04-09 Thread Torne Wuff

Torne Wuff torne-pythonb...@wolfpuppy.org.uk added the comment:

I suspect a better message could be invented, but I'm not sure what :)

--

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



[issue8356] SyntaxError: integer assignment with leading zeros (only 8 and 9)

2010-04-09 Thread Martin Zimmermann

New submission from Martin Zimmermann i...@posativ.org:

try this:
x = (05, 06, 07)
y = (08, 09, 019)

you will get SyntaxError: invalid token.
(also in python 2.5.2)

--
components: Interpreter Core
messages: 102706
nosy: posativ
severity: normal
status: open
title: SyntaxError: integer assignment with leading zeros (only 8 and 9)
versions: Python 2.6

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



[issue8356] SyntaxError: integer assignment with leading zeros (only 8 and 9)

2010-04-09 Thread Ezio Melotti

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

The leading 0 is used to indicate octal numbers, and 8 and 9 are not valid 
octal digits.

--
nosy: +ezio.melotti
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue7559] TestLoader.loadTestsFromName swallows import errors

2010-04-09 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Thanks for your suggestions on the test code.  I will do that.

It seems like the hard-coded approach would be more brittle.  For example, if 
someone wants to replace __import__ with their own, e.g.

old__import__ = __builtins__.__import__

def __my_logging_import(*args, **kwargs):
print Importing %s... % args[0]  # module name
return old__import__(*args, **kwargs)

__builtins__.__import__ = __my_logging_import

Then the stack traces would be different:

  File /Users/chris_g4/dev/Python/trunk/Lib/unittest/loader.py, line 92, in 
loadTestsFromName
module = __import__('.'.join(parts_copy))
  File unittests.py, line 8, in __my_logging_import
return old__import__(*args, **kwargs)
ImportError: No module named sdasfasfasdf

This causes the unit tests not to pass.

--

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



[issue8356] SyntaxError: integer assignment with leading zeros (only 8 and 9)

2010-04-09 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Duly documented here: 
http://docs.python.org/reference/lexical_analysis.html#numeric-literals

Regards

--
nosy: +merwok

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



[issue7865] io close() swallowing exceptions

2010-04-09 Thread Pascal Chambon

Pascal Chambon chambon.pas...@gmail.com added the comment:

Well, it would break code which currently ignores that it fails, so it's more a 
benefit than a loss for programmers imo.

I doubt the impact will be important though, because the io module is still 
quite recent, and furthermore errors on the last flush are quite unlikely to 
happen if previous ones succeeded (except disk full, I don't see any reason 
for this to happen).

--

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



[issue4007] make clean fails to delete .a and .so.X.Y files

2010-04-09 Thread Skip Montanaro

Skip Montanaro s...@pobox.com added the comment:

Martin If it did eat the patch, we would have lost it by now: there is
Martin nothing in the history that shows that a file was attached at
Martin some point. More likely, Skip forgot to attach it when
Martin submitting this report.

Yeah, I must have just forgotten to attach it.  At one point I'm pretty sure
I had something in my sandbox, but have nothing now.  Removing .a files is
pretty straightforward.  Removing .so.X.Y files is a little more cumbersome
because globbing isn't perfect.  This (only lightly tested) patch should be
good enough though:

Index: Makefile.pre.in
===
--- Makefile.pre.in (revision 79207)
+++ Makefile.pre.in (working copy)
@@ -1156,8 +1156,9 @@
find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'

 clean: pycremoval
-   find . -name '*.o' -exec rm -f {} ';'
+   find . -name '*.[oa]' -exec rm -f {} ';'
find . -name '*.s[ol]' -exec rm -f {} ';'
+   find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
find build -name 'fficonfig.h' -exec rm -f {} ';' || true
find build -name 'fficonfig.py' -exec rm -f {} ';' || true
-rm -f Lib/lib2to3/*Grammar*.pickle

even though the second addition would also match files like

Margaret.so.9a.1g4

Skip

--

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



[issue3581] failures in test_uuid

2010-04-09 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

5. uuid.getnode() can fall back to creating a random 48 bit number and
   so can  _windll_getnode() (by using UuidCreateSequential). Therefore,
   in unlucky cases 0x can be generated and the assert in
   check_node() will fail.


check_node() is beginning to look quite pointless...

--
Added file: http://bugs.python.org/file16842/test_uuid2.patch

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



[issue8350] os.mkdir doc comment is incorrect

2010-04-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The docstring looks right to me. mode=0777 doesn't mean it takes a keyword 
argument, only that this argument has a default value.

You might want to fix posixmodule to accept keyword arguments, but it should 
probably be done for all functions then. An mkdir-specific patch would have 
little point IMO (after all it takes only two args, there's hardly any risk of 
confusion).

--
nosy: +loewis, pitrou

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



[issue8350] os.mkdir doc comment is incorrect

2010-04-09 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Hello

This is a recurrent problem with Python functions implemented in C. Since 
introspection is not possible, developers have to use the first line of the 
docstring to write the signature, including default arguments. With your patch, 
people can’t rely on IDE tooltips that display introspected signature + first 
line of docstring anymore.

The ideal right fix would be for C functions to support introspection, e.g. 
with PEP 362.

Regards

--
nosy: +merwok

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



[issue7865] io close() swallowing exceptions

2010-04-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

You're right that silencing IO errors is bad.  Patch welcome.

--
nosy: +amaury.forgeotdarc, pitrou
priority: low - normal

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



[issue8354] siginterrupt with flag=False is reset when signal received

2010-04-09 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +exarkun

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



[issue8350] os.mkdir doc comment is incorrect

2010-04-09 Thread Shashwat Anand

Shashwat Anand anand.shash...@gmail.com added the comment:

The ideal right fix would be for C functions to support introspection - Agreed, 
but then it will be needed to do so in quite a number of C codes.

--

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



[issue8350] os.mkdir doc comment is incorrect

2010-04-09 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

A more attainable fix would be a way to mark up positional-only arguments that 
have a default value.

--

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



[issue3581] failures in test_uuid

2010-04-09 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

I do not understand the semantics of uuid.getnode(). Per the docs
it's supposed to return a hardware address. This would reasonably
make it a UUID version 1.

But then the random fallback should be a 47 bit number as per
http://www.ietf.org/rfc/rfc4122.txt section 4.5.

The docs for UuidCreateSequential don't say if the random fallback
is a random version 1 UUID.

--

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



[issue7559] TestLoader.loadTestsFromName swallows import errors

2010-04-09 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

 I think you can simplify them a bit. For example, you can use assertRaises.

Actually, assertRaises doesn't seem to permit checking error text.  That may be 
one reason why try-except-else is being used instead throughout.

--

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



[issue7443] test.support.unlink issue on Windows platform

2010-04-09 Thread R. David Murray

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

If the problem with the fix is that lots of tests use test_support.unlink, then 
I don't see why the rename dance can't be implemented in test_support.unlink.  
(Possibly conditioned on whether or not the tests are running on a windows 
platform.)  Dealing with unlink problems is why that method exists in the first 
place.

There are probably places in the test suite that *don't* use 
test_support.unlink, though, so fixing test_support.unlink will not necessarily 
fix all of the problems. We'll have to fix those other tests (probably by using 
the new test_support.unlink) as we find them.

An actual patch will need a test that doesn't rely on win32file (ctypes would 
be OK).  It may be necessary to rename to a unique filename, too. (To be clear, 
I think a unit test that reproduces the problem by doing an open with 
FILE_SHARE_DELETE is fine, we don't need a test that reproduces the race 
condition itself.  The windows experts will correct me if I'm wrong :)

I'm changing the stage to patch needed because it seems to me that using a 
technique like rename that doesn't introduce additional delays into the test 
suite is to be preferred.

--
nosy: +r.david.murray
stage: patch review - needs patch

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



[issue6715] xz compressor support

2010-04-09 Thread Nikolaus Rath

Changes by Nikolaus Rath nikol...@rath.org:


--
nosy: +Nikratio

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



[issue3581] failures in test_uuid

2010-04-09 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +nnorwitz, tim_one

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



[issue2824] zipfile to handle duplicate files in archive

2010-04-09 Thread Yaniv Aknin

Yaniv Aknin yaniv.ak...@gmail.com added the comment:

Attached is the addition of the 'low_level' parameter to ZipFile. Included are 
the parameter, a global switch controlling whether the parameter will raise an 
Exception or trigger a DeprecationWarning (the latter, for now), updated tests 
and updated documents. I didn't run test_zipfile64, I can't say for sure it 
works but I have no reason to believe it doesn't.
Changes are against py3k; let me know what you think, I'll backport to trunk.

--
keywords: +patch
Added file: http://bugs.python.org/file16843/low_level_zipfile.diff

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



[issue1294032] Distutils writes keywords comma-separated

2010-04-09 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Hello

Comma-separated values are a Good Thing™, because you can have one notion 
expressed with more than one “word”, e.g. “text processing”.

Could we edit a PEP to reflect this or is it too late? Should someone start a 
discussion on a mailing list?

Regards

--
nosy: +merwok

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



[issue1294032] Distutils writes keywords comma-separated

2010-04-09 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Forgot to add I suggest that someone with admin rights move this bug to 
Distutils2.

--

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



[issue8357] distutils does not allow installation with --root and --prefix, and give's incorrect error message

2010-04-09 Thread Tim Kersten

New submission from Tim Kersten tim.kers...@lincor.com:

$ python setup.py install --root=/tmp/ --prefix=/usr
running install
error: must supply either home or prefix/exec-prefix -- not both

I believe that this should work. --root and --prefix are, from what I can tell, 
two unrelated options.

--
assignee: tarek
components: Distutils
messages: 102724
nosy: tarek, timkersten
severity: normal
status: open
title: distutils does not allow installation with --root and --prefix, and 
give's incorrect error message
type: behavior
versions: Python 2.5, Python 2.6

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



[issue8354] siginterrupt with flag=False is reset when signal received

2010-04-09 Thread Charles-Francois Natali

Charles-Francois Natali neolo...@free.fr added the comment:

 The effect of signal.siginterrupt(somesig, False) is reset the first time a 
 that signal is received.  This is not the documented behaviour, and I do not 
 think this is a desireable behaviour.  It renders siginterrupt effectively 
 useless at providing the robustness against EINTR it is intended to provide.

Actually, siginterrupt shouldn't be used.
The proper way is to use sigaction with SA_RESTART flag (and still, don't rely 
on SA_RESTART too much, certain syscalls are non restartable and this isn't 
realy portable).

 Another might be to not call PyOS_setsig from signal_handler at all -- I'm 
 not sure why it is trying to reinstall itself, but perhaps there's some issue 
 there I'm not aware of.

Because signal.signal might be implemented with sigaction() or signal() and the 
latter resets the default signal handler when the handler is called. This means 
that if your system doesn't support sigaction and and you don't reinstall it, 
then the handler will only get called the first time.
However, reinstalling the signal handler contains a race, because if a second 
signal comes before you reinstall it, it's handled by the default handler. 
That's why sigaction is much better (and calling PyOS_setsig unecessary when 
sigaction is available).

The problem you describe can happen with both sigaction and signal :

sigaction:
- you set your handler with signal.signal()
- sigaction() is called, and by default syscalls are not restarted (SA_RESTART 
is false)
- you call siginterrupt() with False, which juste reinstalls the handler with 
SA_RESTART to true
- the first signal arrives: signal_handler() schedules the call of your 
handler, and calls PyOS_setsig() 
- PyOS_setsig() reinstalls your handler (again, it's neither a good idea nor 
necessary with sigaction) _without_ SA_RESTART
- the second signal comes in
- you get a EINTR, game over

signal:
- you set your handler with signal.signal()
- signal() is called, and syscalls are not restarted by default
- you call siginterrupt() with False, which juste reinstalls the handler with 
SA_RESTART to true
- the first signal arrives: signal_handler() schedules the call of your 
handler, and calls PyOS_setsig() 
- PyOS_setsig() reinstalles your handler _without_ SA_RESTART (I think the flag 
is lost even before calling siginterrupt)
- the second signal comes in
- you get a EINTR, game over

So the simple fix when sigaction is available is simply to not call 
PyOS_setsig() from signal_handler.
When sigaction is not available, well, you have to recall that you want 
restartable syscalls, and call siginterrupt again with that value. But I think 
if the OS doesn't support sigaction, there's little chance it'll support 
siginterrupt.
(1) I just found out that Windows doesn't have sigaction, but I don't know 
Window much, so if someone could confirm that it doesn't support siginterrupt, 
then the fix would simply be to not reinstall handler when sigaction is 
available.

--
nosy: +neologix

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



[issue8357] distutils does not allow installation with --root and --prefix, and give's incorrect error message

2010-04-09 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Those are mutually exclusive:

  --prefix : installation prefix
  --root: install everything relative to this alternate root directory

root will install things into a completely alternate root and will use the 
existing installation scheme and make all paths relative to root.

Whereas prefix allows you to define an alternate value for the installation 
sys.prefix. And supposes that this prefix is in your PYTHONPATH. 

IOW, having the two options makes it impossible for distutils to choose where 
to put some files.

--
resolution:  - invalid
versions:  -Python 2.5

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



[issue3581] failures in test_uuid

2010-04-09 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

I reread http://www.ietf.org/rfc/rfc4122.txt and I'm pretty sure that
if getnode() is supposed to return a hardware address, one of the
following should be used:

  1) If ifconfig etc. returns successfully, we are fine.

  2) If uuid_generate_time() or UuidCreateSequential() are used
 to extract the node ID, we have to make sure that the returned
 UUID is in fact RFC_4122 and version 1.

  3) The fallback node ID should be 47 bits according to section 4.5.


I've got a new patch (getnode.patch) that takes care of these issues.

--
keywords:  -patch
resolution: accepted - 
Added file: http://bugs.python.org/file16844/getnode.patch

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



[issue8357] distutils does not allow installation with --root and --prefix, and give's incorrect error message

2010-04-09 Thread Tim Kersten

Tim Kersten tim.kers...@lincor.com added the comment:

I fail to see how these are, or at least should be mutually exclusive. Upon 
reading your reply I would think that if one was to specify both a --prefix and 
--root that the prefix would be relative to the --root.

i.e. --prefix changes the curront installation scheme as per usual

i.e. --root specifies an alternative root, but obeys the installation scheme 
in every other sense. i.e.
(On linux) / = /path/to/alternative/root/


Any chance you could explain this further please? I'm having difficulties 
understanding why I'm wrong.

--
versions: +Python 2.5, Python 3.1

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

This would be easier to review if the patch were generated with 'svn diff'.

That said, it looks okay in concept to me, although I couldn't apply it and 
test without manually mucking with the patch.

2.6 is in bugfix mode, so it can't be changed there. I added 3.2, since it 
should probably agree with 2.7.

What I can't answer is if this should actually be done. I don't know if 
anyone's relying on the current behavior. I do agree that unified diffs are 
more desirable.

--
nosy: +eric.smith
priority:  - low
stage:  - patch review
type:  - behavior
versions: +Python 3.2 -Python 2.6

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



[issue8357] distutils does not allow installation with --root and --prefix, and give's incorrect error message

2010-04-09 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

== prefix == 

With prefix, you need to make sure the target site-packages is in your 
PYTHONPATH:

  PYTHONPATH=/tmp/foo/lib/python2.6/site-packages/ python setup.py install 
--prefix=/tmp/foo

And here, prefix is used as the base location, and the command uses the schemes 
defined
for each platform.

So stuff will be installed in /tmp/foo  (bin/ , lib/python2.6, etc)

 
== root ==

With root, you just need to provide a path:

  python setup.py install --root=/tmp/foo

In this case, sys.prefix will be used relatively to root (location = 
root+sys.prefix), so for example,
under Mac OS X, I have '/Library/Frameworks/Python.framework/Versions/2.6' for 
sys.prefix.

So stuff will be installed under 
/tmp/foo/Library/Frameworks/Python.framework/Versions/2.6/

Since both options are used to define the base location, they are mutualy 
exclusive.
That's how it works today.

What are you trying to achieve exactly ?

Btw: Please don't add Python 2.5 in the versions. Python 2.5 is not a target 
anymore.

--
versions:  -Python 2.5

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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-09 Thread Darryl Miles

Darryl Miles darryl.mi...@darrylmiles.org added the comment:

I've updated my attachment to the bug, if you read the old one please re-read 
the updated version (since some points in there were not accurate).

With regards to the OpenSSL error return -1/ERROR_SYSCALL with errno==0 being 
observed, I shall respond into the OpenSSL mailing list with a fuller response. 
 The man page SSL_get_error(3) does explain what getting a zero error means in 
relation to end-of-file at the BIO/TCP socket level.  In light of the 
presumption by me that the problem was because one end did a syscall close(fd) 
this makes perfect sense in the context of your observation and OpenSSL appears 
to be working as documented.  There is also code to print out the error in 
Python at Modules/_ssl.c method PySSL_SetError() so I'm not sure of the source 
of the funny looking error printing in relation to the ftpcli test case, 
consider it to be an error message formatting glitch.


Now the issue I see here is that there are clearly 3 use cases Python should 
provide:

 * one-shot raw mode (don't enter the loop at all, as per newssl5.patch/my 
attachment, this is more or less what you already have in CVS, but I would 
remove the 2nd call to SSL_shutdown(), raw mode means exactly that; the caller 
is in charge of calling it again, thin layer for Python power users) [case-1]

 * perform IO sleep/wait as necessary until we observe SSL_shutdown()==0 (or 
better!  so this will return if 0 or 1 is returned) [case-2]

 * perform IO sleep/wait as necessary until we observe SSL_shutdown()==1 
[case-3]

I presume you already have a way of handling the configuration of I/O timeouts 
as per Python's IO processing model (that is provided by some other API 
mechanism).



The question is what is the best way to provide them (what is inline with the 
Python paradigm?) :

 * one method, keep existing named method, add new optional argument that can 
indicate all 3 modes of operation.  Debate which of the 3 modes of operation is 
the default when the argument is not specified, case-1 seems to most backwardly 
compatible.  [I am presuming python supports optional arguments]

 * new method, keep existing as-is (to cover case 1), implement case-2 and 
case-3 in the method which also take an argument for the user to specify which 
use case they want.


From this a patch should be straight-forward.  Then we can look to see if the 
FTP client or server is doing anything wrong in light of having the building 
blocks in place to achieve any goal on top of OpenSSL.

--
Added file: http://bugs.python.org/file16845/python_ssl_v2.c.txt

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



[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-09 Thread Darryl Miles

Changes by Darryl Miles darryl.mi...@darrylmiles.org:


Removed file: http://bugs.python.org/file16838/python_ssl.c.txt

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



[issue8357] distutils does not allow installation with --root and --prefix, and give's incorrect error message

2010-04-09 Thread Tim Kersten

Tim Kersten tim.kers...@lincor.com added the comment:

Ok, this is embarrassing. :-/

$ python setup.py install --root=/tmp/ --prefix=/usr
running install
error: must supply either home or prefix/exec-prefix -- not both

The above is not caused by specifying both --root and --prefix as I had 
assumed. It was my forgetting that I had specified the --home option in a 
setup.cfg file. I'm so sorry for wasting your time.

Having removed the setup.cfg file and have tested it again and now it behaves 
exactly as I had anticipated. i.e. --prefix is relative to --root, so it is 
actually possible to specify both.

In particular what this allows one to achieve is easiest shown by example:

A) $ python setup.py install --prefix=/tmp/test1
B) $ python setup.py install --prefix=/usr/special --root=/tmp/test2

in A) it installs as such:

/etc/mypythonapp.settings
/tmp/test1/mypythonapp/...

in B) it installs as such:
/tmp/test2/etc/mypythonapp.settings
/tmp/test2/usr/special/mypythonapp/...


This bug can be closed. Again, my apologies and thank you for taking the time 
to help me sort it out.

--

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



[issue8358] absolute_import future directive ignored by 2to3

2010-04-09 Thread Jason R. Coombs

New submission from Jason R. Coombs jar...@jaraco.com:

I'm using Python 3.1.2 64-bit on Windows.

I've found that even if absolute_import is imported from __future__, 2to3 
will convert imports to be treated as relative.

To demonstrate this behavior, I created a small package abs_imp_test 
(attached).

abs_imp_test.__init__ is 0 bytes.
abs_imp_test.string is a one-line file.
  foo = 'bar'
abs_imp_test.main contains 4 lines:
  from __future__ import absolute_import
  import string
  assert not hasattr(string, 'foo'), 'fail'
  print(success)

Put abs_imp_test package somewhere in the python path (just having it relative 
to current directory works).

Note that the code is designed to be future-proof (using the future directive), 
so will run under Python 2.6 and Python 3.1 without errors.

 python26\python -c from abs_imp_test import main
success
 python31\python -c from abs_imp_test import main
success

However, if I run 2to3 on main, it converts import string to from . import 
string which changes the fundamental meaning of the import and breaks the test.

 2to3 abs_import_test
...
RefactoringTool: Files that were modified:
RefactoringTool: abs_imp_test\main.py

 python -c from abs_imp_test import main
Traceback (most recent call last):
  File string, line 1, in module
  File abs_imp_test\main.py, line 4, in module
assert not hasattr(string, 'foo'), fail
AssertionError: fail

Is it possible that if the absolute_import future directive is present that the 
imports not be modified for relativity?

--
components: 2to3 (2.x to 3.0 conversion tool)
files: abs_imp_test.zip
messages: 102733
nosy: jaraco
severity: normal
status: open
title: absolute_import future directive ignored by 2to3
versions: Python 3.1
Added file: http://bugs.python.org/file16846/abs_imp_test.zip

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



[issue8358] absolute_import future directive ignored by 2to3

2010-04-09 Thread Jason R. Coombs

Jason R. Coombs jar...@jaraco.com added the comment:

More importantly, is there a workaround for main.py that will work in Python 2, 
and in Python 3 after 2to3, that doesn't require any module renaming?

--

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



[issue8358] absolute_import future directive ignored by 2to3

2010-04-09 Thread Jason R. Coombs

Jason R. Coombs jar...@jaraco.com added the comment:

I found a workaround by excluding the import fixer that seems to work.

For the example,

 2to3 -x import abs_imp_test

The command still modifies main, but it only removes the __future__ directive 
and doesn't modify the imports.

For my real-world package, which is using distutils, I added the following to 
get a build_py that will run 2to3:

try:
from distutils.command.build_py import build_py_2to3 as build_py
# exclude some fixers that break already compatible code
from lib2to3.refactor import get_fixers_from_package
fixers = get_fixers_from_package('lib2to3.fixes')
for skip_fixer in ['import']:
fixers.remove('lib2to3.fixes.fix_' + skip_fixer)
build_py.fixer_names = fixers
except ImportError:
from distutils.command.build_py import build_py

This works because the entire package is already using absolute imports 
wherever they are relevant, so removing the import fixer is appropriate.

--

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread R. David Murray

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

For what it is worth, the unix 'diff' command does not produce unified format 
by default.  It doesn't produce the format diff.py does by default either, 
though.

Our normal policy is not to change an interface unless there's a strong reason. 
 On the other hand, Tools probably don't need to be held to as high a standard 
as library code.

I guess I'm +0 on this change.

--
nosy: +r.david.murray

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



[issue8357] distutils does not allow installation with --root and --prefix, and give's incorrect error message

2010-04-09 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
status: open - closed

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



[issue8339] urlunparse(urlparse('x://')) now returns 'x:' instead of 'x://'

2010-04-09 Thread Senthil Kumaran

Senthil Kumaran orsent...@gmail.com added the comment:

Hello Michael, 

Looking a bit deeper into this issue, I don't see that 'x://' and 'x:///y' 
qualifies as valid URLS as per RFC 3986. (Well, urlparse has been not strictly 
conforming to it, but that is a different issue)

If you look at the section 3. it states the following for validity.

 hier-part   = // authority path-abempty
  / path-absolute
  / path-rootless
  / path-empty
 
In those cases, I would assume that 'x://y', x:/y','x:/','/' as valid URLS, but 
not the two examples you mentioned.

For the issue7904, we had just gone by the definition of RFC to make that minor 
change and it has resulted in this issue. I looked at the code to see if this 
can be addressed, but I see that your examples did not fit in as valid urls.

Do you have any opinions on this?

We can just the test_urlparse.py a little like below, and you might fix the 
break your code.

 def test_unparse_parse(self):
-for u in ['Python', './Python','x-newscheme://foo.com/stuff']:
+for u in ['Python', 
'./Python','x-newscheme://foo.com/stuff','x://y','x:/y','x:/','/',]:
 self.assertEqual(urlparse.urlunsplit(urlparse.urlsplit(u)), u)
 self.assertEqual(urlparse.urlunparse(urlparse.urlparse(u)), u)

--
assignee:  - orsenthil

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



[issue8357] Add a --show-installation-paths in the install command

2010-04-09 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Ooops you are right, I messed up too in my explanation, I mischecked the code. 
root and home are mutually exclusive, not root and prefix. 

In any case, all those options are making it really hard to understand. 

I'd like to make this story easier in distutils2, So I'll move this issue in 
there.

Maybe we could have a --show-installation-paths option in install that displays 
the installation paths the install command will use, and from where the options 
were read from (and in particular from which .cfg files)

--
components: +Distutils2 -Distutils
resolution: invalid - accepted
status: closed - open
title: distutils does not allow installation with --root and --prefix, and 
give's incorrect error message - Add a --show-installation-paths in the 
install command

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



[issue7007] Tiny inconsistency in the orthography of url encoded in the doc of urllib.parse

2010-04-09 Thread Senthil Kumaran

Senthil Kumaran orsent...@gmail.com added the comment:

What is referred to as URL-encoded or URL encoded is technically 
'percent-encoding'. Consistency would desirable and I think 'URL encoded' is 
okay. It involves a minor change in removing '-' in some places. Once trunk 
opens, I shall make those changes in the docs referenced here.

--
assignee: georg.brandl - orsenthil
nosy: +orsenthil

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



[issue7897] Support parametrized tests in unittest

2010-04-09 Thread Fernando Perez

Fernando Perez fdo.pe...@gmail.com added the comment:

Hey Yarick,

On Thu, Apr 8, 2010 at 18:53, Yaroslav Halchenko rep...@bugs.python.org w=
rote:
 In PyMVPA we have our little decorator as an alternative to Fernando's ge=
nerators, =A0and which is closer, I think, to what Michael was wishing for:
 @sweepargs

 http://github.com/yarikoptic/PyMVPA/blob/master/mvpa/testing/sweepargs.py

 NB it has some minor PyMVPA specificity which could be easily wiped out, =
and since it was at most 4 eyes looking at it and it bears evolutionary c=
hanges, it is far from being the cleanest/best piece of code, BUT:

 * it is very easy to use, just decorate a test method/function and give a=
n argument which to vary within the function call, e.g smth like

 @sweepargs(arg=3Drange(5))
 def test_sweepargs_demo(arg):
 =A0 =A0ok_(arg  5)
 =A0 =A0ok_(arg  3)
 =A0 =A0ok_(arg  2)

 For nose/unittest it would still look like a single test

Thanks for the post; I obviously defer to Michael on the final
decision, but I *really* would like a solution that reports an
'argument sweep' as multiple tests, not as one.  They are truly
multiple tests (since they can pass/fail independently), so I think
they should be treated as such.

On the other hand, your code does have nifty features that could be
used as well, so perhaps the best of both can be used in the end.

Cheers,

f

--

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



[issue7897] Support parametrized tests in unittest

2010-04-09 Thread Yaroslav Halchenko

Yaroslav Halchenko yarikop...@gmail.com added the comment:

Fernando, I agree... somewhat ;-)

At some point (whenever everything works fine and no unittests fail) I wanted 
to merry sweepargs to nose and make it spit out a dot (or animate a spinning 
wheel ;)) for every passed unittest, so instead of 300 dots I got a picturesque 
field of thousands dots and Ss and also saw how many were skipped for some 
parametrizations.  But I became Not sure of such feature since field became 
quite large and hard to grasp visually although it gave me better idea indeed 
of what was the total number of testings were done and skipped.  So may be it 
would be helpful to separate notions of tests and testings and provide user 
ability to control the level of verbosity (1 -- tests, 2 -- testings, 3 -- 
verbose listing of testings (test(parametrization)))

But I blessed sweepargs every time whenever something goes nuts and a test 
starts failing for (nearly) all parametrization at the same point.  And that is 
where I really enjoy the concise summary.
Also I observe that often an ERROR bug reveals itself through multiple tests.  
So, may be it would be worth developing a generic 'summary' output which would 
collect all tracebacks and then groups them by the location of the actual 
failure and tests/testings which hit it?

--

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



[issue8357] Add a --show-installation-paths in the install command

2010-04-09 Thread Tim Kersten

Tim Kersten tim.kers...@lincor.com added the comment:

Such an option would be useful indeed.

An idea, though perhaps it's overkill, would be to show the current values of 
the options causing problems, specifically if they come from a config file or 
environment variable.

i.e. when setup.cfg contains home=/somewhere

$ python setup.py install --prefix=/tmp
running install
error: must supply either home or prefix/exec-prefix -- not both
   setup.cfg: home=/somewhere

--

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



[issue8354] siginterrupt with flag=False is reset when signal received

2010-04-09 Thread Charles-Francois Natali

Charles-Francois Natali neolo...@free.fr added the comment:

Attached are two patches:
- test_signal_siginterrupt.diff is a patch for Lib/test/test_signal.py to check 
for this problem (more than one signal received after calling 
signal.siginterrupt())
before:
$ ./python Lib/test/regrtest.py test_signal
test_signal
1 test OK.

after:
$ ./python Lib/test/regrtest.py test_signal
test_signal
test test_signal failed -- Traceback (most recent call last):
  File /home/cf/python/trunk/Lib/test/test_signal.py, line 299, in 
test_siginterrupt_off
self.assertEquals(i, False)
AssertionError: True != False

1 test failed:
test_signal

- signal_noreinstall.diff is a patch against Modules/signalmodule.c which 
modifies signal_handler() to call PyOS_setsig() only when sigaction is not 
available, since in that case the signal handler doesn't need to be 
reinstalled. This solves this problem, and also saves a call to sigaction every 
time a signal is received (even if its probably doesn't cost much).

with patch and updated test:
$ ./python Lib/test/regrtest.py test_signal
test_signal
1 test OK.

Of course, this also corrects the problem with sig-test.py, the terminal can be 
resized indefinitely.
I also passed test_subprocess and test_socketserver just to be sure, but 
reviews are more than welcome.

--
keywords: +patch
Added file: http://bugs.python.org/file16847/test_signal_siginterrupt.diff

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



[issue7007] Tiny inconsistency in the orthography of url encoded in the doc of urllib.parse

2010-04-09 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Hello.

I’m not a native speaker, but I know that you need hyphens inside adjectives: 
URI-encoded, percent-encoded, built-in 0.2 wink, etc.

I’m willing to produce a patch that changes “URL-encoded” to “percent-encoded”.

Regards

--
nosy: +merwok

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



[issue8354] siginterrupt with flag=False is reset when signal received

2010-04-09 Thread Charles-Francois Natali

Changes by Charles-Francois Natali neolo...@free.fr:


Added file: http://bugs.python.org/file16848/signal_noreinstall.diff

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



[issue8357] Add a --show-installation-paths in the install command

2010-04-09 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +merwok

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



[issue7927] SSL socket is not closed properly

2010-04-09 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
assignee:  - janssen
nosy: +janssen

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



[issue7943] Memory leak due to circular references in ssl.SSLSocket

2010-04-09 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
assignee:  - janssen
nosy: +janssen

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



[issue7425] [PATCH] Improve the robustness of pydoc -k in the face of broken modules

2010-04-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Is it a dup of issue1785?

--
nosy: +pitrou

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



[issue8358] absolute_import future directive ignored by 2to3

2010-04-09 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +benjamin.peterson

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



[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-04-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Wouldn't it be nicer if mode was a property?

Good point. I guess it would indeed...

--

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

Attached is 'svn diff'. Previous one was taken directly from Mercurial Queue, 
which is a pretty awesome thing to use.

--
Added file: 
http://bugs.python.org/file16849/8355.diff-py-unified-by-default.svn.diff

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Some diff-emitting utilities only support unified format, but if diff.py is 
supposed to be a diff(1) replacement, changing default options seems bad.

Eric, I think “patch -p1  file” would have done the trick, without manual 
mucking.

Regards

--
nosy: +merwok

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



[issue8358] absolute_import future directive ignored by 2to3

2010-04-09 Thread Benjamin Peterson

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

Fixed in r79917.

--
resolution:  - fixed
status: open - closed

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



[issue7897] Support parametrized tests in unittest

2010-04-09 Thread Fernando Perez

Fernando Perez fdo.pe...@gmail.com added the comment:

Yarick: Yes, I do actually see the value of the summary view.  When I have a 
parametric test that fails, I tend to just run nose with -x so it stops at the 
first error and with the --pdb options to study it, so I simply ignore all the 
other failures.  To me, test failures are quite often like compiler error 
messages: if there's a lot of them, it's best to look only at the first few, 
fix those and try again, because the rest could be coming from the same cause.

I don't know if Michael has plans/bandwidth to add the summary support as well, 
but I agree it would be very nice to have, just not at the expense of 
individual reporting.

--

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

I tried -p1 and it failed, but no matter. The contents were clear enough, and 
exactly how I would have changed the code.

$ patch -p1  8355.diff-py-unified-by-default.diff 
patching file Tools/scripts/diff.py
Hunk #1 FAILED at 13.
Hunk #2 FAILED at 34.
2 out of 2 hunks FAILED -- saving rejects to file Tools/scripts/diff.py.rej

The new patch worked for me.

I'm -0 on this change, for what it's worth. It's probably all irrelevant, 
anyway. I can't imagine anyone actually generates their diffs with diff.py. As 
a useful demonstration of how difflib works, it does its job as it currently 
stands.

--

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

It is not a diff replacement. Its output, as David noted, is not a diff output 
format and can not be reliably parsed due to issue7585 and issue7582 
combination.

For being a diff replacement it will have to get rid of .py extension and gain 
a dozen of options. Such as --normal, -p, -w, -q, -r etc. Without these options 
diff.py can not be considered diff replacement. This script is more useful on 
its own, providing reasonable defaults for a cross-platform way of making 
patches for Python users.

--

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Your use case and rationale make sense to me. I’d be +0.5 if I had a voice :)

Regards

--

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



[issue7897] Support parametrized tests in unittest

2010-04-09 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

If we provide builtin support for parameterized tests it will have to report 
each test separately otherwise there is no point. You can already add support 
for running tests with multiple parameters yourself - the *only* advantage of 
building support into unittest (as I see it) is for better reporting of 
individual tests.

--

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



[issue8355] diff.py produce unified format by default

2010-04-09 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

I'm with Eric, -0. I don't really think the change is necessary.

--
nosy: +brian.curtin

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



[issue6457] subprocess.Popen.communicate can lose data from output/error streams when broken input pipe occures

2010-04-09 Thread Yaniv Aknin

Yaniv Aknin yaniv.ak...@gmail.com added the comment:

I've updated the sample code to run with Python 3 and tested on Ubuntu 9.10 
with and without setting subprocess._has_poll = False.

As expected, when using poll() the sample runs correctly.
When not using poll() the sample breaks (sometimes no data, sometimes some 
data; oddly, it seems the 'some data' variant appears only when I strace the 
process, probably because it slows things down).

I suggest this be committed against 3.2 as well, but I don't know how these 
things are usually done; should I produce a separate patch which ports the 
latest patch currently posted in this thead against py3k? Or will this be done 
by whomever applies the patch?

--
nosy: +Yaniv.Aknin
versions: +Python 3.2

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



[issue8322] test_ssl failures with OpenSSL 1.0.0

2010-04-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

After some investigation, the error does occur because of the aforementioned 
changelog entry (SSLv2 weak ciphers are now disabled by default). To check it I 
just added the following line to newPySSLObject():

 SSL_CTX_set_cipher_list(self-ctx, ALL);

Of course this isn't desirable: we shouldn't blindly enable weak ciphers. 
Instead we could simply add an argument to configure allowed ciphers, and use 
ALL in our tests. Or we could add a separate method to configure ciphers.

(this begs the question of whether this is suitable post-beta1)

What do you think?

--
nosy: +benjamin.peterson

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



[issue8299] Improve GIL in 2.7

2010-04-09 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

David, yes messing about with processor affinities is certainly not nice.
Especially since the issue is cross-platform.
The pthreads api doesn't offer much.  There is pthreadd_setschedparam(), and 
pthreads_setconcurrency().  Unfortunately I don't have a pthreads machine to 
test that with.
On windows, one possibility would be to switch to fibers, in the case of a 
yielding thread.  I don't know if that would change anything, or if the 
thread-to-fiber and vice versa conversion is lightweight enough to be used 
dynamically.

Antoine: I'm not familiar with ccbench.  I´ll look into it.   As for my FIFO 
fix, py3k is trying to do more, namely get rid of the checkinterval. It is most 
certainly a more complex solution and with it its own set of problems.  The 
only thing that needs fixing is to add fairness to the GIL.

I know that this is coming a bit late for 2.7 and I'm not pushing it as such 
for 2.7.  But after 2.7 comes 2.8 (and so on ad infinitum)  But I'm also 
pointing out the obvious problem and an obvious simple fix which doesn't 
involve inventing a whole new system.  I would have thought that this should at 
least spark some enthusiasm.

It's unfortunate, maybe, that I only realized so late that the pythread GIL was 
implemented using a homebrew condition variable mechanism.  I always thougth 
(being a windows guy) that it were simply using the pthread_mutex() and thus 
the greedy behaviour of the GIL could be ascribed to that.

Anyway, I´ll continue giving this patch some love.  I wouldn't be surprised if 
it, and especially the priority variant, would be appealing to people doing 
e.g. webservers with 2.x technology.

Another thing that the priority patch has done is convince me that I really 
need to implement this scheduling mode in stackless, since it does appear to 
help network latency when using FIFO scheduling of threads / tasklets.

Cheers!

--

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



[issue8299] Improve GIL in 2.7

2010-04-09 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

If it really improves multicore performance and none of our test fail (even in 
memory/resource/time survival tests) then I'd give it a try even after a beta. 
2.x is still the best practical version out there.

--
nosy: +techtonik

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



[issue7425] [PATCH] Improve the robustness of pydoc -k in the face of broken modules

2010-04-09 Thread R. David Murray

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

It doesn't look like it is the same bug to me.  This one is more general.

--
nosy: +r.david.murray

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



[issue7301] Add environment variable $PYTHONWARNINGS

2010-04-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The tests don't look good to me. You should use p.communicate() rather than 
p.stdout.read(). Also, check the error return code and raise an error if it's 
non-zero.

--
nosy: +pitrou

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



[issue7334] ElementTree: file locking in Jython 2.5 (OSError on Windows)

2010-04-09 Thread Philip Jenvey

Philip Jenvey pjen...@underboss.org added the comment:

Patch with tests (which can only really test it on Windows) here

http://bitbucket.org/pjenvey/et-2009-provolone/changeset/8292a06090a3/

--

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



[issue7334] ElementTree: file locking in Jython 2.5 (OSError on Windows)

2010-04-09 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
nosy: +brian.curtin

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



  1   2   >