[issue10676] Confusing note in Numeric Types

2010-12-11 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Thanks, fixed in r87169.

--
nosy: +georg.brandl
resolution:  - fixed
status: open - closed

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



[issue10677] make altinstall includes ABI codes in versioned executable name

2010-12-11 Thread Nick Coghlan

New submission from Nick Coghlan ncogh...@gmail.com:

make altinstall is currently installing python3.2m rather than python3.2.

Since PEP 3149 makes no mention of changing the executable name, this should be 
fixed to correctly install the executable as python3.2.

I suspect this will also affect a make install, but will be obscured in that 
case since the python3 symlink will still do the right thing. (I haven't tried 
it, since I don't want to clobber the Canonical provided 3.1 installation)

--
assignee: barry
messages: 123782
nosy: barry, georg.brandl, ncoghlan
priority: release blocker
severity: normal
status: open
title: make altinstall includes ABI codes in versioned executable name
versions: Python 3.2

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



[issue10677] make altinstall includes ABI codes in versioned executable name

2010-12-11 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
components: +Build
stage:  - needs patch
type:  - behavior

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



[issue10678] email.utils.mktime_tz Giving wrong result , by ignoring Timezone that comes from value of parsedate .

2010-12-11 Thread Phyo Arkar Lwin

New submission from Phyo Arkar Lwin phyo.arkarl...@gmail.com:

DESCRIPTION:

I am trying to parse Time Zone information out of email messages and i found 
out that mktime_tz is totally ignoring TimeZone information from parsedate_tz.


VERSION: 2.6.5
CODE and RESULTS:


from time import mktime
from email.utils import parsedate,parsedate_tz,formatdate,mktime_tz

parsedate_tz('Sat, 10 Apr 2004 03:50:19 +400')
 (2004, 4, 10, 3, 50, 19, 0, 1, -1, 14400)


mktime_tz(parsedate_tz('Sat, 10 Apr 2004 03:50:19 +400'))
1081554619.0
mktime(parsedate('Sat, 10 Apr 2004 03:50:19'))
1081545619.0

Same

formatdate(mktime_tz(parsedate_tz('Sat, 10 Apr 2004 03:50:19 +400')))
'Fri, 09 Apr 2004 23:50:19 -' # WRONG TOTALLY

Expected Result:
'Sat, 10 Apr 2004 03:50:19 +400'

--
components: None
messages: 123783
nosy: Phyo.Arkar.Lwin
priority: normal
severity: normal
status: open
title: email.utils.mktime_tz Giving wrong result , by ignoring Timezone  that 
comes from value of  parsedate .
versions: Python 2.6

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



[issue10678] email.utils.mktime_tz Giving wrong result , by ignoring Timezone that comes from value of parsedate_tz .

2010-12-11 Thread Phyo Arkar Lwin

Changes by Phyo Arkar Lwin phyo.arkarl...@gmail.com:


--
title: email.utils.mktime_tz Giving wrong result , by ignoring Timezone  that 
comes from value of  parsedate . - email.utils.mktime_tz Giving wrong result , 
by ignoring Timezone  that comes from value of  parsedate_tz .

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



[issue10679] make altinstall will clobber OS provided scripts

2010-12-11 Thread Nick Coghlan

New submission from Nick Coghlan ncogh...@gmail.com:

make altinstall installs 2to3, pydoc3 and idle3 without version 
specific names.

This was at least a deliberate decision in the case of 2to3, but there doesn't 
appear to be any reason not to use a properly qualified version suffix on the 
pydoc and idle executables.

--
messages: 123784
nosy: benjamin.peterson, georg.brandl, ncoghlan
priority: release blocker
severity: normal
stage: needs patch
status: open
title: make altinstall will clobber OS provided scripts
type: behavior

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



[issue10679] make altinstall may clobber OS provided scripts

2010-12-11 Thread Nick Coghlan

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

Softened the wording, since OS packages will often omit installing any 
executable files other than the main python binary.

--
title: make altinstall will clobber OS provided scripts - make altinstall 
may clobber OS provided scripts

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



[issue10678] email.utils.mktime_tz Giving wrong result , by ignoring Timezone that comes from value of parsedate_tz .

2010-12-11 Thread Phyo Arkar Lwin

Changes by Phyo Arkar Lwin phyo.arkarl...@gmail.com:


--
type:  - behavior

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



[issue10677] make altinstall includes ABI codes in versioned executable name

2010-12-11 Thread Nick Coghlan

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

The other thing that makes this clearly an error is, of course, the fact that 
all the shebang lines expect the executable to be called python3.2

--

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



[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-11 Thread Skip Montanaro

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

From the comment in the test_csv.py:

+# XXX: I don't know what the correct behavior should be for these.
+# Currently the first one raises an error that the delimiter can't
+# be determined while the second one returns '\r'.  The second
+# is obviously.
+('a,b,c,d\ne',  ''),
+('a,b,c,d\r\ne', ''),

Obviously what?  My guess would be wrong.  In the absence of any other
information \r\n has to be treated as a line separator.  It shouldn't be
considered as two separate characters, even in such a devoid-of-clues test
case.

Is the empty string a valid delimiter?  I've never tried it and it's been a
long time since I looked at any of the code.  I do use single-column CSV
files from time-to-time though.  I don't think a ',' would be a completely
unreasonable fallback scenario either.

Skip

--

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread Milko Krachounov

Milko Krachounov pyt...@milko.3mhz.net added the comment:

I attached unit tests that test that cloexec is properly set. I can't test my 
tests too well with the unpatched version because runtests.sh is too 
complicated to use, and doesn't print any useful output by default.

--
Added file: 
http://bugs.python.org/file20007/subprocess-cloexec-atomic-py3k-tests1.patch

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Removed file: 
http://bugs.python.org/file20007/subprocess-cloexec-atomic-py3k-tests1.patch

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Added file: 
http://bugs.python.org/file20008/subprocess-cloexec-atomic-py3k-tests1.patch

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Removed file: 
http://bugs.python.org/file20008/subprocess-cloexec-atomic-py3k-tests1.patch

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Added file: 
http://bugs.python.org/file20009/subprocess-cloexec-atomic-py3k-tests1.patch

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



[issue969718] BASECFLAGS are not passed to module build line

2010-12-11 Thread Jakub Wilk

Changes by Jakub Wilk jw...@jwilk.net:


--
nosy: +jwilk

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



[issue10642] site.py crashes on python startup due to defective .pth file

2010-12-11 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:

I suggest to:
- Print path to the .pth file, which causes exception. Current traceback 
doesn't help in finding the cause of problem:

# echo import nonexistent  /usr/lib64/python3.2/site-packages/some_file.pth
# python3.2 -c pass
Traceback (most recent call last):
  File /usr/lib64/python3.2/site.py, line 520, in module
main()
  File /usr/lib64/python3.2/site.py, line 509, in main
known_paths = addsitepackages(known_paths)
  File /usr/lib64/python3.2/site.py, line 301, in addsitepackages
addsitedir(sitedir, known_paths)
  File /usr/lib64/python3.2/site.py, line 177, in addsitedir
addpackage(sitedir, name, known_paths)
  File /usr/lib64/python3.2/site.py, line 148, in addpackage
exec(line)
  File string, line 1, in module
ImportError: No module named nonexistent

- Maybe change error into warning.

--

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



[issue6559] [PATCH]add pass_fds paramter to subprocess.Popen()

2010-12-11 Thread Milko Krachounov

Milko Krachounov pyt...@milko.3mhz.net added the comment:

The patch doesn't seem to work.

I added this before closerange in _close_all_but_a_sorted_few_fds:

print(Closing, start_fd, up to, fd, exclusive)

And used the attached script to run as a subprocess to check for open fds 
(taken from my tests patch for issue 7213).

Here's the result:
Python 3.2b1 (py3k:87158M, Dec 11 2010, 02:55:28) 
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
 import sys
 import os
 import subprocess
 subprocess.Popen([sys.executable, 'fd_status.py'], close_fds=False).wait()
0,1,2
0
 os.pipe()
(3, 4)
 os.pipe()
(5, 6)
 subprocess.Popen([sys.executable, 'fd_status.py'], close_fds=False).wait()
0,1,2,3,4,5,6
0
 subprocess.Popen([sys.executable, 'fd_status.py'], close_fds=True).wait()
0,1,2
0
 subprocess.Popen([sys.executable, 'fd_status.py'], close_fds=True, 
 pass_fds=(6,)).wait()
0,1,2,6
0
 subprocess.Popen([sys.executable, 'fd_status.py'], close_fds=True, 
 pass_fds=(3,)).wait()
0,1,2
0
 subprocess._posixsubprocess = None
 subprocess.Popen([sys.executable, 'fd_status.py'], close_fds=True, 
 pass_fds=(6,)).wait()
Closing 3 up to 6 exclusive
Closing 7 up to 8 exclusive
0,1,2,6
0
 subprocess.Popen([sys.executable, 'fd_status.py'], close_fds=True, 
 pass_fds=(3,)).wait()
Closing 3 up to 8 exclusive
0,1,2
0

I also attach a possible test for pass_fds, and an example fix for Python-only 
implementation. The test requires either my tests patch for issue 7213, or the 
attached fd_status.py to be put in subprocessdata subdir of Lib/test. The fixed 
Python implementation passes my test and works fine in the console, I haven't 
tried the C one. (I don't have a patch for the fix, since it would conflict 
with the patches for issue 7213.)

--
nosy: +milko.krachounov
Added file: http://bugs.python.org/file20010/fd_status.py

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



[issue6559] [PATCH]add pass_fds paramter to subprocess.Popen()

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Added file: http://bugs.python.org/file20011/test_pass_fds.py

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



[issue6559] [PATCH]add pass_fds paramter to subprocess.Popen()

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Added file: 
http://bugs.python.org/file20012/subprocess-pass_fd_fix_example.patch

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



[issue10515] csv sniffer does not recognize quotes at the end of line

2010-12-11 Thread R. David Murray

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

Yeah, obviously wrong.  I forgot to finish editing the comment.

I think a fallback of ',' makes more sense than ''.  What would a delimiter of 
nothing mean?  I don't think the unquoted case can be changed for backward 
compatibility reasons, so those tests I added should presumably be changed to 
confirm the existing behavior (with an appropriate comment).

--

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread Milko Krachounov

Milko Krachounov pyt...@milko.3mhz.net added the comment:

I add a patch that tests close_fds (there's no test for close_fds), that 
requires the tests1 patch. By the way, should there be a test for the atomicity 
of the operations?

--
Added file: 
http://bugs.python.org/file20013/subprocess-cloexec-atomic-py3k-tests2-close_fds.patch

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



[issue10642] site.py crashes on python startup due to defective .pth file

2010-12-11 Thread R. David Murray

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

I like the suggestion of turning it into a warning, myself, but you are right 
that at the least the error message should be improved.

--
resolution: invalid - 
stage: committed/rejected - needs patch
status: closed - open

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



[issue10677] make altinstall includes ABI codes in versioned executable name

2010-12-11 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Nice, definitely a blocker.

(BTW, if you configured without any specific --prefix, you shouldn't clobber 
anything installed by the distribution...)

--

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



[issue10679] make altinstall may clobber OS provided scripts

2010-12-11 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Yes, this already irked me with previous versions.

--

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



[issue10678] email.utils.mktime_tz Giving wrong result , by ignoring Timezone that comes from value of parsedate_tz .

2010-12-11 Thread R. David Murray

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

mktime_tz is documented as turning the input into a *UTC* timestamp.  That's 
what your example shows it doing.

There is an open issue elsewhere in this tracker for providing a way to 
round-trip RFC2822 timestamps.

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue10680] argparse: titles and add_mutually_exclusive_group don't mix (even with workaround)

2010-12-11 Thread Mads Michelsen

New submission from Mads Michelsen madch...@gmail.com:

This is a follow-up to Issue 58 from the Google Project Hosting bug tracker 
(http://code.google.com/p/argparse/issues/detail?id=58). I couldn't find any 
equivalent/re-posting of it here, so I took the liberty of creating a new one - 
despite the bug being marked 'WontFix' on Google. The reason for this is that I 
cannot make the suggested workaround... well, work. 

The root problem: the argparse parser add_mutually_exclusive_group method does 
not accept title or description arguments. 

The workaround: steven.bethard suggests on google to create a 'straight' dummy 
group (i.e. one made using the title-accepting add_argument_group method) and 
then attach the mutually exclusive group to the dummy group - which is attached 
to the parser itself. 

The problem: while the group does appear as a group with title on the help 
output, the group does not appear to actually _be_ mutually exclusive (I get no 
objections to running several arguments from the same group together) nor does 
it display as mutually exclsuive on the help output. 

Please see attached file for code + resulting output.

(I hope I'm doing this right - this is my first bug report, so bear with and 
instruct me if I'm getting it wrong)

--
components: Library (Lib)
files: argsconfig.txt
messages: 123797
nosy: Mads.Michelsen
priority: normal
severity: normal
status: open
title: argparse: titles and add_mutually_exclusive_group don't mix (even with 
workaround)
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file20014/argsconfig.txt

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



[issue10642] site.py crashes on python startup due to defective .pth file

2010-12-11 Thread Éric Araujo

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

Aren’t there studies that show that people don’t read warnings?  I’m +0 on a 
warning and +1 on an error.

--

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



[issue10677] make altinstall includes ABI codes in versioned executable name

2010-12-11 Thread Éric Araujo

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


--
nosy: +eric.araujo

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



[issue10679] make altinstall may clobber OS provided scripts

2010-12-11 Thread Éric Araujo

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


--
nosy: +eric.araujo

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



[issue10680] argparse: titles and add_mutually_exclusive_group don't mix (even with workaround)

2010-12-11 Thread Martin v . Löwis

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

Can you please formulate that is a test case? Use this structure:

1. do this
2. this happens
3. this should happen instead

--
nosy: +loewis

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



[issue10631] ZipFile and current directory change

2010-12-11 Thread Éric Araujo

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


--
nosy: +eric.araujo

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



[issue10680] argparse: titles and add_mutually_exclusive_group don't mix (even with workaround)

2010-12-11 Thread Mads Michelsen

Mads Michelsen madch...@gmail.com added the comment:

Okay, I'll try:

Save the following code as argparse_test.py:

[CODE]
#! /usr/bin/env python2

import argparse

def args_config(about):
parser = argparse.ArgumentParser(description=about)
dummy_group = parser.add_argument_group(title='mutually exclusive')
test_group = dummy_group.add_mutually_exclusive_group()
test_group.add_argument('-a', action='store_true', default=False, \
help='This is the r option')
test_group.add_argument('-b', action='store_true', default=False, \
help='This is the b option')
test_group.add_argument('-c', action='store_true', default=False, \
help='And this is the c option')
args_ns = parser.parse_args()
return args_ns

about = 'This is a test case'
args_ns = args_config(about)
print args_ns
[/CODE]

The use the -h argument to see help output:

[OUTPUT]
[~] python/argparse_test.py -h
usage: argparse_test.py [-h] [-a] [-b] [-c]

This is a test case

optional arguments:
  -h, --help  show this help message and exit

mutually exclusive:
  -a  This is the r option
  -b  This is the b option
  -c  And this is the c option
[/OUTPUT]

The run it with all the options together to test exclusivity:

[OUTPUT]
[~] python/argparse_test.py -abc
Namespace(a=True, b=True, c=True)
[/OUTPUT]

What happens: As you can see, there are no objections to using all three 
options at the same time. Neither does the help output indicate that there 
should be.

What should happen:
If I have understood the instructions in the Issue report on Google correctly, 
the assumption is that this workaround (i.e. using a dummy group) should 
produce the desired result (i.e. that running the command argparse_test.py 
-abc should appear as and be prbohibited)

--

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



[issue10642] Improve the error message of addpackage() (site.py) for defective .pth file

2010-12-11 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
title: site.py crashes on python startup due to defective .pth file - Improve 
the error message of addpackage() (site.py) for defective .pth file

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

subprocess-cloexec-atomic-py3k-tests2-close_fds.patch adds a test called to 
Win32ProcessTestCase which is specific to Windows. And this class has already a 
test with the same name. You should move your test to ProcessTestCase (and so 
it will test the C implementation, the Python implementation and also without 
poll).

--

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 subprocess-cloexec-atomic-py3k-tests2-close_fds.patch adds a test
 called [test_close_fds] to Win32ProcessTestCase ...

Oops, forget my last comment, I didn't applied the patches in the right order. 
There are too much patches :-p Can you try to create one unique patch? It will 
be easier to test it and to review it.

--

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



[issue7695] missing termios constants

2010-12-11 Thread Rodolpho Eckhardt

Rodolpho Eckhardt r...@rhe.vg added the comment:

Because these constants might not exist on all platforms, the patch uses 
ifdef's around them.

--
keywords: +patch
nosy: +Rodolpho.Eckhardt
Added file: http://bugs.python.org/file20015/patch_termios_consts_issue7695.diff

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

subprocess-cloexec-atomic-py3k.patch:

+case $ac_sys_system in
+  GNU*|Linux*)
+  AC_CHECK_FUNC(pipe2, AC_DEFINE(HAVE_PIPE2, 1, [Define if the OS supports 
pipe2()]), )
+esac
 
I think that you can remove the test on the OS name. AC_CHECK_FUNC() doesn't 
hurt if the function doesn't exist. Other OS may have pipe2().

--

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



[issue10502] Add unittestguirunner to Tools/

2010-12-11 Thread Mark Roddy

Mark Roddy markro...@gmail.com added the comment:

Attaching patch that adds the unittestgui to Tools/scripts.  Also has updates 
to the unittest documentation which includes a note that this tool is for 
beginners and a CI system should be used in general.

--
keywords: +patch
nosy: +MarkRoddy
Added file: http://bugs.python.org/file20016/unittestgui.patch

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

test_pipe_cloexec_unix_tools() is specific to UNIX/BSD because it requires cat 
and grep programs. You should try to reuse the Python interpreter to have a 
portable test (eg. working on Windows), as you did with fd_status.py.


+data = b'\n'
+subdata = b'aaa'
+assert subdata in data, Test broken

Use maybe subdata = data[:3] to avoid an assertion.

I don't understand why do you talk about atomicity. Do you test add 
non-atomic operations? Was subprocess atomic?

If I understood correctly, you are fixing a specific issue which can be called 
something like subprocess: close pipes on exec(), set FD_CLOEXEC flag to all 
pipes, and no more changing the default value of close_fds. Can you update the 
title please?

--

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



[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Jurko Gospodnetić

Jurko Gospodnetić jurko.gospodne...@gmail.com added the comment:

Also this class, because it defines __del__ too simply, will display a 
user-unfriendly error message when cleaning up a TemporaryDirectory object 
whose constructor raised an exception when attempting to create its temporary 
folder.

  For example try to create a TemporaryDirectory with prefix= on 
Windows. That should fail as folders there can not contain '' characters and 
later on in the program you should get an error message something like this one:

Exception AttributeError: 'TemporaryDirectory' object has no attribute 
'_closed' in bound method TemporaryDirectory.cleanup of 
tempfile.TemporaryDirectory object at 0x00CE1E10 ignored

  Hope this helps.

[Sorry, did not know whether to add this as a separate issue as it seemed kind 
of related to this one.]

--
nosy: +Jurko.Gospodnetić

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



[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Jurko Gospodnetić

Jurko Gospodnetić jurko.gospodne...@gmail.com added the comment:

Clicked send too soon on the previous comment. :-(

  The simplest way I see you can fix the __del__ issue is to patch 
TemporaryDirectory.__init__() as follows:

def __init__(self, suffix=, prefix=template, dir=None):
self._closed = True
self.name = mkdtemp(suffix, prefix, dir)
self._closed = False

  This is based on the tempfile.py from the 3.2 beta 1 release on Windows.

--

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



[issue10681] PySlice_GetIndices() signature changed

2010-12-11 Thread Phil Thompson

New submission from Phil Thompson p...@riverbankcomputing.com:

In Python v3.2b1 the type of the first argument of PySlice_GetIndices() and 
PySlice_GetIndicesEx() has changed from PySliceObject* to PyObject*.

The documentation does not reflect this change.

Which is correct, the source code or the documentation?

--
assignee: d...@python
components: Documentation, Interpreter Core
messages: 123809
nosy: Phil.Thompson, d...@python
priority: normal
severity: normal
status: open
title: PySlice_GetIndices() signature changed
type: behavior
versions: Python 3.2

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



[issue10677] make altinstall includes ABI codes in versioned executable name

2010-12-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue10681] PySlice_GetIndices() signature changed

2010-12-11 Thread Martin v . Löwis

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

The source is correct. Fixed in r87171.

--
nosy: +loewis
resolution:  - fixed
status: open - closed

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



[issue10679] make altinstall may clobber OS provided scripts

2010-12-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue10663] configure shouldn't set a default OPT

2010-12-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue969718] BASECFLAGS are not passed to module build line

2010-12-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue7213] Popen.subprocess change close_fds default to True

2010-12-11 Thread Jakub Wilk

Changes by Jakub Wilk jw...@jwilk.net:


--
nosy: +jwilk

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



[issue10681] PySlice_GetIndices() signature changed

2010-12-11 Thread Phil Thompson

Phil Thompson p...@riverbankcomputing.com added the comment:

You might want to add a Changed in Python v3.2 because as it is an 
incompatible change.

--

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



[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Applied the fix from msg123808 in r87172.

--
nosy: +georg.brandl

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



[issue10681] PySlice_GetIndices() signature changed

2010-12-11 Thread Martin v . Löwis

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

It's not an incompatible change, but I added the versionchanged anyway in 
r87173.

--

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



[issue10642] Improve the error message of addpackage() (site.py) for defective .pth file

2010-12-11 Thread R. David Murray

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

My guess is people don't read warnings when they are a common occurrence.  A 
working Python should not emit any warnings, and a properly working Python 
program (post 2.6/3.1 (or whenever it was we decided to suppress deprecation 
warnings by default)) should not either.  But certainly messages that don't 
cause program termination *can* be ignored, and thus are more often than 
program-terminating errors :)

On the other hand, this *is* an error.  If we agree that python startup and 
site.py should not fail in the face of misconfigured libraries (and we aren't 
necessarily agreed on that :) then another option would be to use the logging 
facility to generate an error that would, by default, be logged to stderr but 
still allow Python to start.  That's not that much different from emitting a 
warning, functionally, but by having the message make it clear that it is an 
error it might make it more likely the user would take action.

As for whether or not we should want Python to be able to start up in the face 
of 3rd party library misconfiguration, I think there are arguments on both 
sides.  The most compelling argument I can think of for having errors in third 
partly libraries not cause startup failure is that a user borking their system 
python by installing a malfunctioning library would then cause all 
python-dependent system functions to fail to run until they'd fixed the 
install.  With a system such as gentoo where the package manager that the user 
might want to use to do the uninstall uses Python, this could be a problem.

--

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



[issue10677] make altinstall includes ABI codes in versioned executable name

2010-12-11 Thread Barry A. Warsaw

Barry A. Warsaw ba...@python.org added the comment:

r87174 moves the creation of the hard link between python-3.2m and python-3.2 
from the bininstall target to the altbininstall target.

--
resolution:  - fixed
status: open - closed

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



[issue8911] regrtest.main should have a test skipping argument

2010-12-11 Thread Jerry Seutter

Jerry Seutter jseut...@gmail.com added the comment:

Hi Tarsis,

I looked at your patch.  It looks like it only does step 1 and doesn't move 
away from parse_command_line directly modifying sys.argv.  Was this the patch 
file that you intended to upload?

--

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



[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs

2010-12-11 Thread Milko Krachounov

Milko Krachounov pyt...@milko.3mhz.net added the comment:

OK, I have created new updated patches. I haven't combined them in one patch 
because some of the changes can be applied independently, the three patches can 
be cat'ed together if anyone sees separate patches a problem. ;)

I. Changes:
* Now pipe2 would be used on all systems where available.
* I don't depend on external grep and cat, but use utils shipped with the tests.

II. The patches:
1. subprocess-00-subprocess_test_utils.patch
This contains the fd_status.py and input_reader.py utilities that are needed by 
the tests. A separate file because they can be used for creating unit tests for 
issue 6559. In case these patches aren't accepted, it could be useful there.

2. subprocess-01-atomic_cloexec_pipe2.patch
This file contains the changes that make the subprocess pipes created with the 
FD_CLOEXEC flag (atomically through pipe2) where possible. Can be used 
independently of the rest
of the patches.

3. subprocess-02-cloexec_tests.patch
This file contains the tests that verify that CLOEXEC is set on the pipes 
created by subprocess and this allows complex pipes between apps to work 
correctly. Requires subprocess-00-subprocess_test_utils.patch. It can be used 
for another implementation of CLOEXEC in case this implementation isn't 
accepted. With slight modification it can be used to test that pipes work fine 
with close_fds=True and no CLOEXEC.

III. Atomicity and issue 2320:

 I don't understand why do you talk about atomicity. Do you test add 
 non-atomic 
 operations? Was subprocess atomic?

 If I understood correctly, you are fixing a specific issue which can be 
 called 
 something like subprocess: close pipes on exec(), set FD_CLOEXEC flag to all 
 pipes, 
 and no more changing the default value of close_fds. Can you update the title 
 please?

The CLOEXEC flag needs to be set atomically (or at least in a way that another 
subprocess won't start in the middle of it) so that issue 2320 is also 
resolved. This is why I suggested the use of pipe2. On systems where pipe2 
isn't available, the patches rely on the coincidence that the GIL during both 
process execution and the pipe creation. I was wondering if a tests that verify 
for things like issue 2320 are wanted in general (there's no way to reliably 
test such, but there could be a test that does it with a certain probability).

In short, yes, the suggested patches attempt to solve this issue without a 
change to the default, but also to resolve issue 2320 (changing the default 
would also resolve it).

III. More issues:

1. What other possible situations exist causing the same issue that can be 
solved with close_fds=True and are caused by resources coming from other 
modules? Are any of those common? Maybe something involving os.openpty() and 
subprocess? Does anyone use those together? Are such issues worth worrying 
about (in other words, is changing the default still necessary if the 
subprocess pipes have the FD_CLOEXEC flag?)
2. What possible side-effects could the FD_CLOEXEC flag have? Any common 
use-case that is broken by the fact that the pipes are now with FD_CLOEXEC?
3. Can any changes be done to Python 2.7's subprocess? Can the issue be fixed 
there too, or it will have to remain as it is now?

--
title: Popen.subprocess change close_fds default to True - subprocess leaks 
open file descriptors between Popen instances causing hangs
Added file: 
http://bugs.python.org/file20017/subprocess-00-subprocess_test_utils.patch

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



[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Added file: 
http://bugs.python.org/file20018/subprocess-01-atomic_cloexec_pipe2.patch

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



[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Added file: http://bugs.python.org/file20019/subprocess-02-cloexec_tests.patch

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



[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Removed file: http://bugs.python.org/file20019/subprocess-02-cloexec_tests.patch

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



[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Added file: http://bugs.python.org/file20020/subprocess-02-cloexec_tests.patch

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



[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Removed file: 
http://bugs.python.org/file20005/subprocess-cloexec-atomic-py3k.patch

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



[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Removed file: 
http://bugs.python.org/file20009/subprocess-cloexec-atomic-py3k-tests1.patch

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



[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs

2010-12-11 Thread Milko Krachounov

Changes by Milko Krachounov pyt...@milko.3mhz.net:


Removed file: 
http://bugs.python.org/file20013/subprocess-cloexec-atomic-py3k-tests2-close_fds.patch

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



[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs

2010-12-11 Thread Gregory P. Smith

Gregory P. Smith g...@krypto.org added the comment:

Paul  Giovanni: yes I hadn't given the windows side of things any thought when 
I made the change for beta1.

Milko: The DISREGARD_FDS approach is basically what I was intending to do.

Also, there really wasn't any objection to going ahead and changing the 
close_fds default for real in 3.2 assuming the windows issue is addressed.  
changing it to your disregard suggestion (true on posix, false on windows) 
seems to fit peoples needs and keeps the basic usage simple and gets rid of any 
suggestion that everyone needs to specify true or false for all use cases.

--

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



[issue2690] Precompute range length and enhance range subscript support

2010-12-11 Thread SilentGhost

SilentGhost michael.mischurow+...@gmail.com added the comment:

here is the patch for the py3k docs.

--
Added file: http://bugs.python.org/file20021/stdtypes.rst.diff

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



[issue10681] PySlice_GetIndices() signature changed

2010-12-11 Thread Phil Thompson

Phil Thompson p...@riverbankcomputing.com added the comment:

It's source level incompatible - my extension modules compiled fine with v3.2a 
but failed with v3.2b1.

--

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




[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Nick Coghlan

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

I have a slightly better fix for that coming soon. There's a subtle race 
condition in the proposed approach that can lead to the temporary dir not being 
deleted if an asynchronous exception, such as KeyboardInterrupt, arrives after 
mkdtemp completes successfully, but before _closed is set back to False.

Instead, the new init code will look like:

self._closed = False
self.name = None # Handle mkdtemp throwing an exception
self.name = mkdtemp(suffix, prefix, dir)

And the cleanup condition will be gated on self.name being set as well as on 
_closed being False. I believe there is still a window where mkdtemp 
successfully creates the directory, but self.name never gets set, but we want 
to make that window as small as possible.

I also realised this should be emitting a ResourceWarning from __del__, as well 
catching the errors and shut down and turning them into something more 
meaningful on sys.stderr.

The attached patch won't quite apply cleanly, since it predates r87172

--
keywords: +patch
Added file: http://bugs.python.org/file20022/issue10888_tempdir_cleanup.diff

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



[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Nick Coghlan

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

Although it may be better to just raise a new, more meaningul, exception and 
let the runtime take care of ignoring it (since it happens in __del__)

--

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



[issue10682] With '*args' or even bare '*' in def/call argument list, trailing comma causes SyntaxError

2010-12-11 Thread Jan Kaliszewski

New submission from Jan Kaliszewski z...@chopin.edu.pl:

Let examples speak:

def x(a, z): pass  # this is ok
def x(a, z,): pass # this is ok
def x(a, *, z): pass   # this is ok in Py3k
def x(a, *, z,): pass  # but this causes SyntaxError (!)

def x(a, *args): pass  # this is ok
def x(a, *args,): pass # but this causes SyntaxError
def x(a, **kwargs): pass   # this is ok
def x(a, **kwargs,): pass  # but this causes SyntaxError
def x(a, *args, z): pass   # this is ok in Py3k
def x(a, *args, z,): pass  # but this causes SyntaxError (!)

And similarly -- calls:

def x(*args, **kwargs): pass
x(1, *(2,3,4))# this is ok
x(1, *(2,3,4),)   # but this causes SyntaxError
x(1, **{5: 6})# this is ok
x(1, **{5: 6},)   # but this causes SyntaxError
x(1, 2, 3, 4, z=5)# this is ok
x(1, *(2,3,4), z=5)   # this is ok in Py2.6+ and Py3k
x(1, *(2,3,4), z=5,)  # but this causes SyntaxError (!)

Similar problem was discussed years ago as a docs bug -- see: issue798652, but 
-- as inconsistent with intuition and a general Python rule that trailing 
commas are ok in argument lists and sequence literals (except empty ones) -- it 
seems to be rather a language syntax definition issue.

Now, after introducing new syntax possibilities in Py2.6 and especially Py3k 
(see the examples above), the issue is even much more painful.

Also, please consider that Py3k's function annotations encourage to format 
argument list in one-argument-per-line-manner:

def my_func(
spam:Very tasty and nutritious piece of food,
ham:For experts only,
*more_spam:Not less tasty and not less nutritious!,
spammish:Nobody expects this!='Inquisition',
):
...

--
components: Interpreter Core
messages: 123823
nosy: zuo
priority: normal
severity: normal
status: open
title: With '*args' or even bare '*' in def/call argument list, trailing comma 
causes SyntaxError
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue10682] With '*args' or even bare '*' in def/call argument list, trailing comma causes SyntaxError

2010-12-11 Thread Jan Kaliszewski

Jan Kaliszewski z...@chopin.edu.pl added the comment:

s/**{5: 6}/**{'5': 6}/g (but it's a detail)

--

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



[issue10682] With '*args' or even bare '*' in def/call argument list, trailing comma causes SyntaxError

2010-12-11 Thread Jan Kaliszewski

Jan Kaliszewski z...@chopin.edu.pl added the comment:

Oops, I see the problem was partly addressed @ issue9232.

But:

* the proposed patch doesn't fix calls (but defs only),

* shouldn't be the issue considered as a bug -- and fixed also in 2.7 and 3.1?

--

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



[issue10683] PreLinkEvent error under VC2010

2010-12-11 Thread honglei jiang

New submission from honglei jiang jhong...@gmail.com:

1PreLinkEvent:
1  Description: Generate build information...
1  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 
80x86
1  Copyright (C) Microsoft Corporation.  All rights reserved.
1  
1  cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL -MD 
..\Modules\getbuildinfo.c 
-FoE:\Python-3.2b1\PCbuild\Win32-temp-Release\pythoncore\getbuildinfo.o 
-I..\Include -I..\PC
1  getbuildinfo.c
1..\Modules\getbuildinfo.c(1): fatal error C1083: Cannot open include file: 
'Python.h': No such file or directory
1C:\Program 
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(108,5): error 
MSB3073: The command E:\Python-3.2b1\PCbuild\make_buildinfo.exe Release 
E:\Python-3.2b1\PCbuild\Win32-temp-Release\pythoncore\
1C:\Program 
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(108,5): error 
MSB3073: :VCEnd exited with code -1.
1
1Build FAILED.

the following will be ok:
cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL -MD 
..\Modules\getbuildinfo.c -I..\Include -I..\PC 
-FoE:\Python-3.2b1\PCbuild\Win32-temp-Release\pythoncore\getbuildinfo.o 

included dir should ahead of -F options.

--
components: Build
messages: 123826
nosy: honglei.jiang
priority: normal
severity: normal
status: open
title: PreLinkEvent error under VC2010
type: compile error
versions: Python 3.3

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



[issue10683] PreLinkEvent error under VC2010

2010-12-11 Thread honglei jiang

Changes by honglei jiang jhong...@gmail.com:


--
versions: +Python 3.2 -Python 3.3

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



[issue10681] PySlice_GetIndices() signature changed

2010-12-11 Thread Martin v . Löwis

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

 It's source level incompatible - my extension modules compiled fine with 
 v3.2a but failed with v3.2b1.

That's because you are using C++, right? In C, there shouldn't be any
problems.

--

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



[issue10682] With '*args' or even bare '*' in def/call argument list, trailing comma causes SyntaxError

2010-12-11 Thread Martin v . Löwis

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

It's clearly not a bug: the documented grammar matches the implemented grammar. 
Asking for more abstract consistency is a feature request. This also clearly 
falls under the PEP 3003 moratorium.

--
nosy: +loewis
type: behavior - feature request
versions:  -Python 2.7, Python 3.1, Python 3.2

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



[issue9232] Allow trailing comma in any function argument list.

2010-12-11 Thread Martin v . Löwis

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

Retargetting, as this falls under the moratorium, and also because 3.2b1 has 
been released.

--
nosy: +loewis
versions: +Python 3.3 -Python 3.2

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