[issue6873] posix_lchown: possible overflow of uid, gid

2009-09-11 Thread Martin v . Löwis

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

I think the new patch is still incorrect. You now pass long variables into 
the i argument parser. Also, I would expect that compilers prefer to see 
an explicit cast from long to uid_t, in case it's a truncating cast.

Can you try your patch on a system where all this is an actual problem?

--

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



[issue6873] posix_lchown: possible overflow of uid, gid

2009-09-11 Thread STINNER Victor

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

@loewis: I don't think that the explicit cast is required. posix_setuid() has no
explicit cast. But I would also prefer an explicit cast (just for the 
readability).

--

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



[issue6881] incorrect signature in doc for PyByteArray_Resize

2009-09-11 Thread egreen

New submission from egreen egr...@operamail.com:

in Doc/c-api/bytearray.rst:

PyObject* PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)

should be:

int PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)

as per Include/bytearrayobject.h

--
assignee: georg.brandl
components: Documentation
messages: 92506
nosy: egreen, georg.brandl
severity: normal
status: open
title: incorrect signature in doc for PyByteArray_Resize
versions: Python 2.7, Python 3.1

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



[issue6882] uuid creates zombies

2009-09-11 Thread Dirk Haage

New submission from Dirk Haage ha...@net.in.tum.de:

a simple import uuid will always result in a zombie sh process:

$ python3
Python 3.1.1 (r311:74480, Aug 19 2009, 16:23:08) 
[GCC 4.4.1] on linux2
Type help, copyright, credits or license for more information.
 import uuid
 

13528 pts/5Ss 0:01  \_ bash
18349 pts/5S+ 0:00  |   \_ python3
18352 pts/5Z+ 0:00  |   \_ [sh] defunct

confirmed on ubuntu and gentoo with various python3.0 - 3.1.1 builds

--
messages: 92507
nosy: dhg
severity: normal
status: open
title: uuid creates zombies
versions: Python 3.0, Python 3.1

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



[issue6617] During compiling python 3.1 getting error Undefined symbol libintl_bind_textdomain_codeset

2009-09-11 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

I'm not a Unix expert at all, but did you try to export the variable?
export LDFLAGS=-lintl
then configure and make.

--

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



[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

2009-09-11 Thread Jason R. Coombs

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

Just when I was starting to feel comfortable using Hg, this happens. It
appears that between my inexperience with Hg and the non-intuitive
TortoiseHg rebase merge tool, many of the changes I made to
posixmodule.c were lost and as amaury.forgeotdarc remarked, other
commits were reverted.

This means that except for the patches in this ticket, I've lost the
revision history for this work. No biggie.

I've rebuilt the patch from scratch (still against the old code base).
I'm including it here for posterity as draft 8. I'll be attempting once
again to rebase it against the parent's tip. Stay tuned.

--
Added file: http://bugs.python.org/file14877/windows symlink draft 8.patch

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



[issue6883] OptionParser.allow_interspersed_args is undocumented

2009-09-11 Thread Skip Montanaro

New submission from Skip Montanaro s...@pobox.com:

The OptionParser.allow_interspersed_args attribute is undocumented in
the Sphinx documentation.  (It is mentioned in the OptionParser
docstring.)  By its name it appears to actually part of the official
API, so should at least be mentioned in the rst file.

--
messages: 92510
nosy: skip.montanaro
severity: normal
status: open
title: OptionParser.allow_interspersed_args is undocumented

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



[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2009-09-11 Thread Chris Withers

New submission from Chris Withers ch...@simplistix.co.uk:

With a simple setup.py:

from distutils.core import setup
setup(name='packagename')

And a MANIFEST.in containing:

include buildout.cfg 

The result of a debug run of python setup.py sdist on Windows is:

Distribution.parse_config_files():
options (after parsing config files):
no commands known yet
options (after parsing command line):
option dict for 'sdist' command:
  {}
running sdist
Distribution.get_command_obj(): creating 'sdist' command object
warning: sdist: missing required meta-data: version, url
warning: sdist: missing meta-data: either (author and author_email) or 
(maintainer and maintainer_email) mus
t be supplied
checking if setup.py newer than MANIFEST
warning: sdist: standard file not found: should have one of README, 
README.txt
reading manifest template 'MANIFEST.in'
include buildout.cfg
include_pattern: applying regex r'^buildout\.cfg$'
 adding buildout.cfg
Distribution.get_command_obj(): creating 'build' command object
exclude_pattern: applying regex r'^build\.*'
 removing buildout.cfg

...

The regex built is incorrect, although it is apparently correctly built 
on other platforms...

--
assignee: tarek
messages: 92511
nosy: cjw296, tarek
priority: normal
severity: normal
stage: test needed
status: open
title: Impossible to include file in sdist that starts with 'build' on Win32
type: behavior
versions: Python 2.6, Python 2.7

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



[issue6873] posix_lchown: possible overflow of uid, gid

2009-09-11 Thread Boya Sun

Boya Sun boya@case.edu added the comment:

Martin,

I am sorry that I do not have a system where this code actually
triggered a problem, since this bug is discovered by a *static* analysis
tool that is recently developed by our research group, which finds code
segments that are similar to a previously fixed bugs as potential bugs.
 You are saying that if I pass a long to the i argument parser it will
cause a problem. But if I passed a int, it will be same as before and
overflow will not be detected at all.  

---
Victor,

Do you also agree that it will cause a problem if I pass a long to the i
argument parser? If so, I think maybe the overflow problem cannot be
solved by the patch I submitted.

Boya

--

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



[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

2009-09-11 Thread Jason R. Coombs

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

After only a few hours of fighting with Hg and gnashing of teeth, I've
merged the patch with the head of the SVN py3k branch.  I'm attaching
this as draft 9. This patch was created with Subversion and should be
suitable for easy merging.

I've compiled and tested the patched code and the three tests in
test_win_symlink.py all pass.

Please let me know if there's anything more I can do to help move this
forward.

--
Added file: http://bugs.python.org/file14878/windows symlink draft 9.patch

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



[issue6882] uuid creates zombies

2009-09-11 Thread Marcin Bachry

Marcin Bachry hegel...@gmail.com added the comment:

Actually it's a bug in ctypes.util.find_library() which is called from
uuid.py. The function doesn't close() popen object leaving forked
process in zombie state. I attach the fix.

--
keywords: +patch
nosy: +marcin.bachry
Added file: http://bugs.python.org/file14879/find_library_popen.diff

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



[issue6885] pdb documentation shows running as script using python not python3

2009-09-11 Thread Mitchell Model

New submission from Mitchell Model m...@acm.org:

The library documentation page for pdb shows running pdb as a script
using the command
python -m pdb
Shouldn't that be
python3 -m pdb
?

--
assignee: georg.brandl
components: Documentation
messages: 92515
nosy: MLModel, georg.brandl
severity: normal
status: open
title: pdb documentation shows running as script using python not python3
versions: Python 3.0, Python 3.1, Python 3.2

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



[issue6839] zipfile can't extract file

2009-09-11 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

In the case at issue, the file name is the same (contrary to the error
message). The two representations of the *path* are different, but
equivalent. There is no ambiguity: the file should be put in directory
'test' and named 'test2.txt'. So I think zipfile should do what 7zip
does and do just that.

An actual filename difference might be argued differently.

--
nosy: +tjreedy

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



[issue6886] cgi.py runs python, not python3

2009-09-11 Thread Mitchell Model

New submission from Mitchell Model m...@acm.org:

The file cgi.py in the lib directory is an executable beginning with the
line:

#! /usr/local/bin/python

Shouldn't that be python3?

--
components: Library (Lib)
messages: 92517
nosy: MLModel
severity: normal
status: open
title: cgi.py runs python, not python3
versions: Python 3.0, Python 3.1, Python 3.2

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



[issue6887] executables in lib use /usr/bin/env python, not python3

2009-09-11 Thread Mitchell Model

New submission from Mitchell Model m...@acm.org:

Some of the executables in lib begin with the line:

#! /usr/bin/env python

Shouldn't that be python3?

--
components: Library (Lib)
messages: 92518
nosy: MLModel
severity: normal
status: open
title: executables in lib use /usr/bin/env python, not python3
versions: Python 3.0, Python 3.1, Python 3.2

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



[issue6887] executables in lib use /usr/bin/env python, not python3

2009-09-11 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

Honestly those lines should probably be stripped out and simply expect 
people to use runpy to execute the modules.

--
nosy: +brett.cannon

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



[issue6887] executables in lib use /usr/bin/env python, not python3

2009-09-11 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
priority:  - low
type:  - behavior

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



[issue6854] UnicodeDecodeError when retrieving binary data from cgi.FieldStorage()

2009-09-11 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

0. When you have a problem, and you are not sure it is an error in the
interpreter or stdlib, try posting to python-list first. If you do not
soon get a definitive determination here, do that. This is not a
question-answering or user-code debugging list.

1. When posting code so others can read it, please leave off trailing
semi-colons. Python is not C. The unnecessary ';'s are distracting noise.

2. When posting problematic code, please strip it down to the minimum
necessary to show the problem. From what I understand, the minimum here is
import cgi; d = cgi.FieldStorage(). The rest is distracting noise. 

3. When you get a error traceback, copy and paste *the whole traceback*
(especially when requested).

4. Post the exact interpreter version used.  Is this with 3.1.1, with
all the latest bug fixes? Even better, try with the lastest version and
say so.

5. When the problem involved interacting with the external system (such
as os.environ), specify the os. It often makes a difference.

In this case, your problem seems to be that the relevant field of
os.environ has a non-ascii char. My impression is that this is not
intented to be allowed, at least for posix systems, but I am not sure.
It is possible that something in the module has not been updated
properly, but I do not know enough of the specs to say whether the
problem is your data or the library code.

You should determine the 'offending' string and print out its
representation (with repr(s)) and include that with any further post
here or on python-list. In general, include offending data (also
minimized) along with offending code.

--
nosy: +tjreedy

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



[issue6874] sequence method .count() and .index() shoud be in immutable sequence method list.

2009-09-11 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

This is covered in point 4 of open issue #4966

--
nosy: +tjreedy
resolution:  - duplicate
status: open - closed

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



[issue6888] pdb alias command with no arguments is broken

2009-09-11 Thread Mitchell Model

New submission from Mitchell Model m...@acm.org:

Typing just 
alias
in pdb doesn't work. Because dict.keys() now returns a dict_keys object
instead of a list the line
keys.sort()
in Pdb.do_alias breaks because dict_keys doesn't have a sort method.

--
components: Library (Lib)
messages: 92522
nosy: MLModel
severity: normal
status: open
title: pdb alias command with no arguments is broken
versions: Python 3.0, Python 3.1, Python 3.2

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



[issue6889] «Python’s default encoding is the ‘ascii’ encoding.»

2009-09-11 Thread flox

New submission from flox la...@yahoo.fr:

In the Python «Unicode HOWTO», we still read the statement:

«For example, Python's default encoding is the 'ascii'
encoding.»

Here:
http://svn.python.org/view/python/branches/py3k/Doc/howto/unicode.rst?revision=72294view=markup

--
assignee: georg.brandl
components: Documentation
messages: 92523
nosy: flox, georg.brandl
severity: normal
status: open
title: «Python’s default encoding is the ‘ascii’ encoding.»
versions: Python 3.0, Python 3.1, Python 3.2

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



[issue6889] «Python’s default encoding is the ‘ascii’ encoding.»

2009-09-11 Thread Benjamin Peterson

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

Fixed in r74740.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

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



[issue6890] IOError has no __unicode__ method - and loses information

2009-09-11 Thread Michael Foord

New submission from Michael Foord mich...@voidspace.org.uk:

 try:
...  open('flooble')
... except Exception as e:
...  pass
... 
[39343 refs]
 str(e)
[Errno 2] No such file or directory: 'flooble'
[39345 refs]
 unicode(e)
u(2, 'No such file or directory')

The Unicode representation of an IOError has no information about the
file or directory name. This is a regression from 2.5. Would be nice to
backport a fix to 2.6 if we can.

This bit docutils - and can happen as a side-effect of interpolating
into a Unicode string with %s. The filename information is lost from the
error report.

--
components: IO
keywords: 26backport
messages: 92525
nosy: michael.foord
severity: normal
status: open
title: IOError has no __unicode__ method - and loses information
versions: Python 2.6, Python 2.7

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



[issue6839] zipfile can't extract file

2009-09-11 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc amaur...@gmail.com:


--
stage:  - needs patch

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



[issue6882] uuid creates zombies

2009-09-11 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc amaur...@gmail.com:


--
assignee:  - theller
components: +ctypes
nosy: +theller

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



[issue6891] small typo in «unicode.rst»: « the Uniode APIs should be used» and broken URL

2009-09-11 Thread flox

New submission from flox la...@yahoo.fr:

Found 2 typos:
 - Uniode instead of Unicode
 - Acknowledgements instead of Acknowledgments

And the following reference is broken (Jason Orendorff website):
http://www.jorendorff.com/articles/unicode/

The last version is dated 2007 on the wayback machine:
http://web.archive.org/web/*/www.jorendorff.com/articles/unicode/index.html

Relevant file is:
Doc/howto/unicode.rst

--
assignee: georg.brandl
components: Documentation
messages: 92526
nosy: flox, georg.brandl
severity: normal
status: open
title: small typo in «unicode.rst»: «the Uniode APIs should be used» and broken 
URL
versions: Python 3.0, Python 3.1, Python 3.2

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



[issue6888] pdb alias command with no arguments is broken

2009-09-11 Thread Benjamin Peterson

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

Fixed in r74741.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

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



[issue6890] IOError has no __unicode__ method - and loses information

2009-09-11 Thread Benjamin Peterson

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

If your curious, this is the bug report that broke it:
http://bugs.python.org/issue2517

--
nosy: +benjamin.peterson

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



[issue6882] uuid creates zombies

2009-09-11 Thread Dirk Haage

Dirk Haage ha...@net.in.tum.de added the comment:

this patch solves it for me.

--

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



[issue6892] optparser example in optparse documentation is broken

2009-09-11 Thread Mitchell Model

New submission from Mitchell Model m...@acm.org:

The help example in the middle of the optparse library documentation is
broken. The code reads:

parser = OptionParser()
parser.add_option(-h, --help, action=help),
parser.add_option(-v, action=store_true, dest=verbose,
  help=Be moderately verbose)
parser.add_option(--file, dest=filename,
  help=Input file to read data from),

The result of executing this code is:

optparse.OptionConflictError: option -h/--help: conflicting option
string(s): -h, --help

I see that the documentation says that normally help is added
automatically so you don't need to do it, but doing so shouldn't break
especially since the example shows doing it.

Also, the trailing commas on two of the lines are weird and should be
removed.

--
assignee: georg.brandl
components: Documentation
messages: 92530
nosy: MLModel, georg.brandl
severity: normal
status: open
title: optparser example in optparse documentation is broken
versions: Python 3.0, Python 3.1, Python 3.2

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



[issue6892] optparser example in optparse documentation is broken

2009-09-11 Thread Mitchell Model

Mitchell Model m...@acm.org added the comment:

There are other places on the same page with weird trailing commas that
should be removed. I think they all follow right parentheses.

--

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



[issue6891] small typo in «unicode.rst»: « the Uniode APIs should be used» and broken URL

2009-09-11 Thread Ezio Melotti

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

These typos are present in py3k but not in the trunk. I searched for the
commit on the trunk to see if other things had been fixed and not merged
on py3k but I couldn't find it.

--
nosy: +ezio.melotti
priority:  - low

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



[issue6875] add os.close() suggestion to mkstemp documentation

2009-09-11 Thread R. David Murray

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

I don't think it would be beneficial to just talk about closing the file
descriptor, or to talk about os open file limits.  Closing open files
when they are no longer needed is just good programming practice and IMO
a discussion of it doesn't belong in the library docs unless it is at a
more generic level (like os.open or open).

I don't think the code shown in your blog post is using the library the
way it is designed.  If the programmer wants an open file object, they
should use TemporaryFile or NamedTemporaryFile.  If there really is a
reason to get an os file handle and turn it into a file object, then
os.openfd should be used.  Perhaps the appropriate change to the
documentation would be to mention os.openfd, and to mention that
os.close is the correct function to use to close the file handle when it
is no longer needed (unless, of course, openfd has been called).

As for your markup, your ``os.close`` should instead be
:func:`os.close`, which results in the automatic creation of a link to
the os.close documentation.

--
nosy: +r.david.murray
priority:  - normal
versions: +Python 2.6, Python 2.7, Python 3.1

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



[issue6893] defaultdict example in py3 doc should mention the new Counter class

2009-09-11 Thread Ezio Melotti

New submission from Ezio Melotti ezio.melo...@gmail.com:

The 3rd example of defaultdict [1] shows how to use it to count the
letters of a string, but the new Counter class is a better tool for
doing that.

Possible solutions:
1) Setting the default_factory to int makes the defaultdict useful for
counting (like a bag or multiset in other languages): - Setting the
default_factory to int makes the defaultdict useful for basic counting
(see also the Counter class for more features):;
2) remove the example.

[1]:
http://docs.python.org/dev/py3k/library/collections.html#defaultdict-examples

--
assignee: georg.brandl
components: Documentation
messages: 92534
nosy: ezio.melotti, georg.brandl, rhettinger
priority: low
severity: normal
status: open
title: defaultdict example in py3 doc should mention the new Counter class
versions: Python 3.1, Python 3.2

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



[issue6247] should we include argparse

2009-09-11 Thread Nick Coghlan

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

Only +0 purely because I haven't used argparse myself yet.

Otherwise I would probably be +1, since I have several scripts that have
fairly kludgy hacked together optparse based approaches to handling
positional arguments, subparsers and building new parsers that accept
the superset of options defined in existing parsers. The feature
comparison between argparse and optparse makes it sound like argparse
does a much better job of supporting these use cases.

The reasons I don't use argparse for them are that: a) I didn't know it
existed until recently; and b) the scripts are in an environment where
getting approval to use new third party modules is something of a pain.

--
nosy: +ncoghlan

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



[issue6891] small typo in «unicode.rst»: « the Uniode APIs should be used» and broken URL

2009-09-11 Thread R. David Murray

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

The sentence containing the Uniode typo didn't exist when the howtos
were imported on trunk.  That sentence was added to the py3k docs by
r67338.  Fixed in r74749.

The Acknowledgements spelling exists on trunk.  But apparently both
spellings are acceptable, so I'm not bothering to fix that one.

I defer to Georg about the link.

--
nosy: +r.david.murray

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