[issue15936] Add link from os.urandom to random.SystemRandom

2012-10-15 Thread Bryce Verdier

Bryce Verdier added the comment:

Ramchandra,

doesn't the description of os.urandom already imply that it's a low-level 
interface? Or are you saying that you want this to be explicitly stated?


I would also like to work on this bug

--
nosy: +louiscipher

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



[issue13454] crash when deleting one pair from tee()

2012-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: 
http://bugs.python.org/file27568/itertools_tee_nonrecursive_clear.patch

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



[issue13454] crash when deleting one pair from tee()

2012-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: 
http://bugs.python.org/file27578/itertools_tee_nonrecursive_clear.patch

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



[issue11009] urllib.splituser is not documented

2012-10-15 Thread anatoly techtonik

anatoly techtonik added the comment:

Why not to follow the convention and add underscore _ to the names to remove 
the ambiguity and future reports and confusion about that thees functions are 
not documented?

--
status: closed - pending

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



[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 The attached patch adds support for '\\' escaping to fnmatch, and 
 consequently to glob.

This is a backward incompatible change. For example glob.glob(r'C:\Program 
Files\*') will be broken.

As flacs says a way to escape metacharacters in glob/fnmatch already exists. If 
someone want to match literal name Ajax_[version2].txt it should use pattern 
Ajax_[[]version2].txt. Documentation should explicitly mentions such way.

It will be good also to add new fnmatch.escape() function.

--
assignee:  - docs@python
components: +Documentation
nosy: +docs@python, serhiy.storchaka

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



[issue16211] MacInstalls break PyDev

2012-10-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I'm closing this as invalid as the python sources for the stdlib are installed 
by the python.org installer, and this is probably a problem with PyDev.

It is lame that Apple doesn't install the python sources anymore, but there is 
nothing we can do about that.

Feel free to reopen when there is more information that points to a problem 
with python.

--
resolution:  - invalid
status: open - closed

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



[issue14329] proxy_bypass_macosx_sysconf does not handle singel ip addresses correctly

2012-10-15 Thread Ronald Oussoren

Changes by Ronald Oussoren ronaldousso...@mac.com:


--
status: pending - closed

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



[issue16229] Module *redemo.py* lacking in recent Python distributions

2012-10-15 Thread Francisco Gracia

Francisco Gracia added the comment:

You are right. I am referring to the Windows installer. I forgot to mention
that I am using Windows XP.

Thank you.

2012/10/14 Ned Deily rep...@bugs.python.org


 Ned Deily added the comment:

 The demo scripts in the Tools directory were cleaned up earlier in Python
 3 and moved.  redemo.py is still included in the 3.2 and later source
 distributions in the Tools/demo directory.  The builders of binary
 installers and third-party distributors of Python 3.x may make their own
 decisions about whether to include the Tools directory in their distros.
 For which platform and from what source are you installing Python 3.2?

 --
 nosy: +ned.deily

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue16229
 ___


--
title: File *redemo.py* lacking in recent Python distributions - Module 
*redemo.py* lacking in recent Python distributions

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



[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which add fnmatch.escape() function.

--
Added file: http://bugs.python.org/file27579/fnmatch_escape.patch

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



[issue16220] wsgiref does not call close() on iterable response

2012-10-15 Thread Graham Dumpleton

Graham Dumpleton added the comment:

That's right, the Django bug report I filed was actually for Django 1.3, which 
didn't use wsgiref. I wasn't using Django 1.4 at the time so didn't bother to 
check its new implementation based on wsgiref. Instead I just assumed wsgiref 
would be right. Whoops.

--

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



[issue16200] Setting .posix=True for shlex object causes infinite loop in __next__

2012-10-15 Thread Ezio Melotti

Ezio Melotti added the comment:

Making .posix read-only is technically backward-incompatible, but I'm not sure 
if there are cases where people might have changed its value without incurring 
in the bug.  Leaving .posix read/writable and changing .eof accordingly might 
be a better solution.

As a side note, you can use assertRaises (possibly as a context manager) in the 
tests.

--
stage:  - patch review
versions: +Python 3.2

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



[issue10836] TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread anatoly techtonik

anatoly techtonik added the comment:

Looks like a regression - I can't remember such messages in Python 2.

--
nosy: +techtonik

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



[issue5256] rlcompleter adds builtins when custom dict is used

2012-10-15 Thread Ezio Melotti

Ezio Melotti added the comment:

I would make the argument keyword-only.
Changing the logic to avoid eval() might be OK, but IIUC is not related to this 
issue, and it should be done separately.
The markup in the doc could be better (`...` should be ``...`` or a more 
specific directive that generates a link).  A versionchanged should be added as 
well.

--

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



[issue16106] antigravity tests

2012-10-15 Thread Ezio Melotti

Ezio Melotti added the comment:

The test could be made CPython-specific, but if you think it's not necessary 
I'll just close the issue.  The main reason I wrote this was to experiment a 
bit with unittest.mock :)

--
resolution:  - rejected
stage: patch review - committed/rejected
status: open - closed

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



[issue16222] some terms not found by devguide's search box

2012-10-15 Thread Ezio Melotti

Ezio Melotti added the comment:

See also #15871.

--

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



[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I am not sure if escape() should support bytes. translate() doesn't.

--

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



[issue10836] regression: TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread anatoly techtonik

anatoly techtonik added the comment:

Clearly regressing. In Python 2 it was IOError exception:

 import urllib
 urllib.urlretrieve('missing')
Traceback (most recent call last):
  File stdin, line 1, in module
  File C:\pp\lib\urllib.py, line 93, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
  File C:\pp\lib\urllib.py, line 239, in retrieve
fp = self.open(url, data)
  File C:\pp\lib\urllib.py, line 207, in open
return getattr(self, name)(url)
  File C:\pp\lib\urllib.py, line 462, in open_file
return self.open_local_file(url)
  File C:\pp\lib\urllib.py, line 476, in open_local_file
raise IOError(e.errno, e.strerror, e.filename)
IOError: [Errno 2] The system cannot find the file specified: 'missing'


--
title: TypeError during exception handling in urllib.request.urlretrieve - 
regression: TypeError during exception handling in urllib.request.urlretrieve

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



[issue13538] Improve doc for str(bytesobject)

2012-10-15 Thread Ezio Melotti

Ezio Melotti added the comment:

Instead of documenting what *encoding* and *errors* do, I would just say that 
str(bytesobj, encoding, errors) is equivalent to bytesobj.decode(encoding, 
errors) (assuming it really is).  I don't like encodings/decodings done via the 
str/bytes constructors, and I think the docs should encourage the use of 
bytes.decode/str.encode.

--

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



[issue16238] Automatically remove build directory when build options changed

2012-10-15 Thread anatoly techtonik

New submission from anatoly techtonik:

After build options in setup.py is edited, command `python setup.py install` 
doesn't remove build directory and uses its cached content. This behavior is 
non-obvious and leads to errors.

The proposal is to calculate hash from build configuration, save it in build 
directory, and regenerate build dir when hash doesn't match.

--
assignee: eric.araujo
components: Distutils, Distutils2
messages: 172961
nosy: alexis, eric.araujo, tarek, techtonik
priority: normal
severity: normal
status: open
title: Automatically remove build directory when build options changed
type: behavior
versions: Python 3.2

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



[issue10060] python.exe crashes or hangs on help() modules when bad modules found

2012-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka
status: open - pending

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



[issue10836] regression: TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread Amaury Forgeot d'Arc

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


--
keywords: +easy

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



[issue13929] fnmatch to support escape characters

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Issue8402 has discussion and patch(es).

--
nosy: +serhiy.storchaka
resolution:  - duplicate
status: open - closed
superseder:  - Add a way to escape metacharacters in glob/fnmatch

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



[issue10836] regression: TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread STINNER Victor

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


--
nosy: +haypo

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



[issue16200] Setting .posix=True for shlex object causes infinite loop in __next__

2012-10-15 Thread Roger Serwy

Roger Serwy added the comment:

The shlex_posix_property.patch makes .posix a read/write property that changes 
.eof appropriately.

--
Added file: http://bugs.python.org/file27580/shlex_posix_property.patch

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



[issue15442] Expand the list of default dirs filecmp.dircmp ignores

2012-10-15 Thread Eli Bendersky

Eli Bendersky added the comment:

I tend to agree with Éric here.

moijes12, would you like to send an updated patch without the raw literals, and 
with added tests for the new/changed functionality?

--

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-10-15 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


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

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



[issue16239] PEP8 arithmetic operator examples

2012-10-15 Thread Peter Würtz

New submission from Peter Würtz:

I think the PEP8 examples for arithmetic expressions are a bit misleading. 
(http://www.python.org/dev/peps/pep-0008/#id20)

The text clearly says that it should add spaces around operators of low(est) 
priority, which means that I'm encouraged to visually group an expression of 
high priority. It doesn't say (anymore?) that there should always be spaces 
around all arithmetic operators.

This is however not reflected in the examples. In the examples
x = x*2 - 1 is listed as a negative example, while being perfectly compliant 
with the guide. Shouldn't this be in the Yes or an Optionally example block?

I believe these examples may cause some people to interpret the style guide in 
a very rigid way, eventually leading to PEP8 formatting tools that flatten out 
nicely grouped expressions.

--
assignee: docs@python
components: Documentation
messages: 172965
nosy: docs@python, pwuertz
priority: normal
severity: normal
status: open
title: PEP8 arithmetic operator examples
type: enhancement

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



[issue15811] ElementTree.write() raises TypeError when xml_declaration = True and encoding is a unicode string

2012-10-15 Thread Eli Bendersky

Eli Bendersky added the comment:

Finally found time to look at this, sorry for the delay.

I agree with Amaury, and don't think any change is necessary in 2.7, the 
behavior there is quite consistent with what was usually done in 2.x. For 
porting or keeping the code 2/3 compatible, Amaury's solution is appropriate.

--
resolution:  - wont fix
stage:  - committed/rejected
status: open - closed

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



[issue16238] Automatically remove build directory when build options changed

2012-10-15 Thread Kushal Das

Changes by Kushal Das kushal...@gmail.com:


--
nosy: +kushaldas

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2012-10-15 Thread Eli Bendersky

Eli Bendersky added the comment:

Moving to 3.4

In 3.3 we won't add functionality to filecmp, but in 3.4 we will, so the new 
tests should go there.

--
nosy: +eli.bendersky
versions: +Python 3.4 -Python 3.3

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



[issue16214] 2to3 does not remove exceptions import

2012-10-15 Thread Brett Cannon

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


--
resolution:  - duplicate
status: open - closed
superseder:  - 'exceptions' import fixer

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2012-10-15 Thread Eli Bendersky

Eli Bendersky added the comment:

Chris Calloway, let's move this forward. I want to see more tests for filecmp 
ASAP.

Please address Chris Jerdonek's points in a new patch made vs. fresh default 
branch (3.4), at this point cding (before the test_cwd thing is done). For 
testing code, practicality beats purity. Having these tests in place will help 
moving other issues forward (i.e. #15454). Also, as Chris Jerdonek has 
mentioned, having as little as possible in each test_ method is a good 
practice, and older test code that doesn't follow it can be fixed later 
(patches welcome).

--

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



[issue15351] Add to unittest.TestCase support for using context managers

2012-10-15 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
nosy: +eli.bendersky

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



[issue13133] FD leaks in ZipFile.read(), ZipFile.extract() and also using explicit arc_member.close()

2012-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - closed

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



[issue9969] tokenize: add support for tokenizing 'str' objects

2012-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
versions: +Python 3.4 -Python 3.2, Python 3.3

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



[issue7101] tarfile: OSError with TarFile.add(..., recursive=True) about non-existing file

2012-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - languishing

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



[issue15721] PEP 3121, 384 Refactoring applied to tkinter module

2012-10-15 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Andrew,

I have questions about the following part of commit bf9d118779f5:
+ PyTclObject_Type_slots[3].pfunc = PyObject_GenericGetAttr;

First, the 3 refers to the position of Py_tp_getattro in the array, which is 
a fragile thing IMO.

Then, this hack was not necessary before; why is it needed now?
IIRC on Windows a static initializer cannot contain dll-imported variables, but 
function pointers are OK.
Or do you have evidence of the contrary?

--
nosy: +amaury.forgeotdarc

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



[issue15936] Add link from os.urandom to random.SystemRandom

2012-10-15 Thread Ramchandra Apte

Ramchandra Apte added the comment:

@Bryce
Retract that message.

--

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



[issue1776674] glob.glob inconsistent

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The question is what result desirable for glob.glob(c:/tmp///3691674.jpg*), 
['c:/tmp///3691674.jpg'] or ['c:\\tmp\\3691674.jpg']?

--
nosy: +serhiy.storchaka
versions: +Python 3.3, Python 3.4 -Python 3.1

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



[issue1776674] glob.glob inconsistent

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I have added some comments in Rietveld.

--

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



[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Ezio Melotti

Ezio Melotti added the comment:

I think the escaping workaround should be documented in the glob and/or fnmatch 
docs.  This way users can simply do:

import glob
glob.glob(c:\abc\afolderwith[[]test]\*)

rather than

import glob
import fnmatch
glob.glob(fnmatch.escape(c:\abc\afolderwith[test]\) + *)

The function might still be useful with patterns constructed programmatically, 
but I'm not sure how common the problem really is.

--

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



[issue1776674] glob.glob inconsistent

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Shell preserves the separators. Well, in any case we always can apply 
os.path.normpath() to result.

--

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



[issue1776674] glob.glob inconsistent

2012-10-15 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue10836] regression: TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread Guido van Rossum

Changes by Guido van Rossum gu...@python.org:


--
priority: normal - high

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



[issue16231] pickle persistent_id return value

2012-10-15 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

An easy workaround (and probably the preferred method) it to return a (tag, 
index) tuple, like the example in 
http://docs.python.org/release/3.2/library/pickle.html#pickle-persistent

Testing for the None value introduces a slight incompatibility, so IMO it could 
only be changed for 3.4.

--
nosy: +amaury.forgeotdarc

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



[issue16240] Document a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

fnmatch.translate's docstraing says There is no way to quote 
meta-characters., but this is wrong. One can remove the special meaning of 
``'?'``, ``'*'`` and ``'['`` by wrapping them between square brackets. Thus, 
``'[?]'`` matches the literal character ``'?'``.

There are a lot of related issues: issue8402, issue13929, issue9358, 
issue738389, issue738361, issue1580472, issue5852.

--
assignee: docs@python
components: Documentation
files: fnmatch_doc_escape.patch
keywords: easy, patch
messages: 172976
nosy: docs@python, serhiy.storchaka
priority: high
severity: normal
status: open
title: Document a way to escape metacharacters in glob/fnmatch
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file27581/fnmatch_doc_escape.patch

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



[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 I think the escaping workaround should be documented in the glob and/or 
 fnmatch docs.

See issue16240. This issue left for enhancement.

--

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



[issue10836] regression: TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread Ezio Melotti

Ezio Melotti added the comment:

The problem is in open_local_file (Lib/urllib/request.py:1885).  It passes 3 
arguments to URLError, but the constructor only accepts 2: reason and filename 
(Lib/urllib/error.py:29).
This used to be an IOError when urllib was a single module rather than a 
package.

--
nosy: +ezio.melotti
versions: +Python 3.3, Python 3.4 -Python 3.1

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



[issue8402] Add a function to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
title: Add a way to escape metacharacters in glob/fnmatch - Add a function to 
escape metacharacters in glob/fnmatch

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



[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated (thanks Ezio for review and comments).

--
Added file: http://bugs.python.org/file27582/fnmatch_escape_2.patch

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



[issue16241] -X faulthandler is not documented in -X option docs

2012-10-15 Thread Ramchandra Apte

New submission from Ramchandra Apte:

http://docs.python.org/release/3.3.0/using/cmdline.html#cmdoption-X says 
CPython currently defines none of them... But in Python 3.3, faulthandler 
can be passed to the option.

--
assignee: docs@python
components: Documentation
messages: 172980
nosy: docs@python, ramchandra.apte
priority: normal
severity: normal
status: open
title: -X faulthandler is not documented in -X option docs
versions: Python 3.3

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



[issue16202] sys.path[0] security issues

2012-10-15 Thread Jan Lieskovsky

Jan Lieskovsky added the comment:

Jeroen,

  just out of curiosity. Is the current issue different from
CVE-2008-5983 (at first quick glance it looks the be the same issue):?
[1] http://bugs.python.org/issue5753

Thank you, Jan.
--
Jan iankko Lieskovsky

--
nosy: +iankko

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



[issue10836] urllib.request.urlretrieve calls URLError with 3 args

2012-10-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The presence of During handling of the above exception, another exception 
occurred: is part of an intentional change between 2.x and 3.x. Exception 
handling has been tweaked a bit more in the past year. 3.2.3 only gives the 
second half of the traceback, which I suppose is worse.

In 3.3.0, the exception raising an exception behavior is fixed for this 
particular input on my Win 7 system.

 import urllib.request
 urllib.request.urlretrieve('missing')
Traceback (most recent call last):
  File pyshell#1, line 1, in module
urllib.request.urlretrieve('missing')
  File C:\Programs\Python33\lib\urllib\request.py, line 185, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
  File C:\Programs\Python33\lib\urllib\request.py, line 160, in urlopen
return opener.open(url, data, timeout)
  File C:\Programs\Python33\lib\urllib\request.py, line 458, in open
req = Request(fullurl, data)
  File C:\Programs\Python33\lib\urllib\request.py, line 279, in __init__
self._parse()
  File C:\Programs\Python33\lib\urllib\request.py, line 284, in _parse
raise ValueError(unknown url type: %s % self.full_url)
ValueError: unknown url type: missing

urlretrieve no longer assumes the file: scheme. (It was never documented to do 
so, and there is no good reason to do so.) If given explicitly with an invalid 
name, it gives the current equivalent of the 2.x error and message.

 urllib.request.urlretrieve('file:missing')
...
urllib.error.URLError: urlopen error [WinError 2] The system cannot find the 
file specified: 'missing'

Nonetheless, this 3 arg call should be fixed
1887 except OSError as e:
1888   raise URLError(e.errno, e.strerror, e.filename)

--
nosy: +terry.reedy
title: regression: TypeError during exception handling in 
urllib.request.urlretrieve - urllib.request.urlretrieve calls URLError with 3 
args

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



[issue16202] sys.path[0] security issues

2012-10-15 Thread Nick Coghlan

Nick Coghlan added the comment:

It's actually the same as #946373 - it's not about adding the current directory 
to sys.path, it's adding the directory of a script that's in a world-writable 
directory (such as /tmp).

The difference is that the proposed solution this time recognises that simply 
not adding that directory would break the world, so it aims for a more nuanced 
approach (plus distutils itself writing a script to /tmp and then running it is 
just plain wrong).

--

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



[issue16231] pickle persistent_id return value

2012-10-15 Thread PSchaafsma

PSchaafsma added the comment:

There are indeed many easy workarounds, and we definitely don't want to 
introduce any incompatibilities. 

I guess the best thing to do is just update the documentation, right?

--

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



[issue16241] -X faulthandler is not documented in -X option docs

2012-10-15 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti, haypo
stage:  - needs patch
type:  - enhancement
versions: +Python 3.4

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



[issue15721] PEP 3121, 384 Refactoring applied to tkinter module

2012-10-15 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Amaury, I completely agree with your objection. 
I've found this code in xxlimited.c and adapted to _tkinter source.
If that weird code can be removed I will do it.

I have no idea how we can catch/reproduce the problem, maybe Martin von Loewis 
can help as author of xxlimited.c code?

As I know almost nobody make PEP 384 compliant modules for now and maybe there 
are couple of dark corners at least in the docs.

See also #15650 for another question related to adaptation to pep3121.

--

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



[issue15442] Expand the list of default dirs filecmp.dircmp ignores

2012-10-15 Thread moijes12

moijes12 added the comment:

Yeah. I'm on it.

--

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



[issue16229] Demo *redemo.py* lacking in Windows installation

2012-10-15 Thread Ned Deily

Ned Deily added the comment:

Thanks for the update. So I think the bigger issue here is there something that 
should be changed in the Windows installer to accommodate the demo changes in 
Python 3.  Adding the Windows experts and deassigning from docs.

--
assignee: docs@python - 
components: +Installation, Windows -Documentation
nosy: +brian.curtin, loewis, tim.golden -docs@python
title: Module *redemo.py* lacking in recent Python distributions - Demo 
*redemo.py* lacking in Windows installation

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



[issue10836] urllib.request.urlretrieve calls URLError with 3 args

2012-10-15 Thread Ezio Melotti

Ezio Melotti added the comment:

While fixing this issue is easy, there is a wider problem with the use of 
URLError.
The constructor accepts two args, reason and filename. About half of the errors 
in Lib/urllib/request.py use only one argument, and in the other half not a 
single one uses the second arg for the filename:

raise URLError('file error', 'proxy support for file protocol currently not 
implemented')
raise URLError('local file error', 'not on local host')
raise URLError('ftp error', 'proxy support for ftp protocol currently not 
implemented')
if not host: raise URLError('ftp error', 'no host given')
raise URLError('ftp error', msg).with_traceback(sys.exc_info()[2])
raise URLError('data error', 'proxy support for data protocol currently not 
implemented')
raise URLError('ftp error', reason).with_traceback(
raise URLError('ftp error', reason) from reason

Note that the only the first arg ends up in the error message.

This should be reported in another issue though.


In the attached patch I passed only the first argoment and did

-raise URLError(e.errno, e.strerror, e.filename)
+raise URLError('local file error')

The result is

Traceback (most recent call last):
  File /home/wolf/dev/py/3.2/Lib/urllib/request.py, line 1769, in 
open_local_file
stats = os.stat(localname)
OSError: [Errno 2] No such file or directory: 'foo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/wolf/dev/py/3.2/Lib/urllib/request.py, line 1771, in 
open_local_file
raise URLError('local file error')
urllib.error.URLError: urlopen error local file error

If that's OK I'll add a couple of tests and commit.

--
keywords: +patch
Added file: http://bugs.python.org/file27583/issue10836.diff

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



[issue13538] Improve doc for str(bytesobject)

2012-10-15 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 I would just say that str(bytesobj, encoding, errors) is equivalent to 
 bytesobj.decode(encoding, errors) (assuming it really is).

Good suggestion.  And yes, code is shared in the following way:

http://hg.python.org/cpython/file/d3c7ebdc71bb/Objects/bytesobject.c#l2306

One thing that would need to be addressed in the str() version is if bytesobj 
is a PEP 3118 character buffer, after which it falls back to 
bytesobj.decode(encoding, errors).  I will update the patch so people can see 
how it looks.

--

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



[issue13538] Improve doc for str(bytesobject)

2012-10-15 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Indeed:

 m = memoryview(b)
 str(m, utf-8)
''
 m.decode(utf-8)
Traceback (most recent call last):
  File stdin, line 1, in module
AttributeError: 'memoryview' object has no attribute 'decode'

--

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



[issue13538] Improve doc for str(bytesobject)

2012-10-15 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note: character buffer isn't a term we use anymore (in Python 3, that is).

--

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



[issue10836] urllib.request.urlretrieve calls URLError with 3 args

2012-10-15 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage: needs patch - patch review
Added file: http://bugs.python.org/file27584/issue10836-2.diff

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



[issue15442] Expand the list of default dirs filecmp.dircmp ignores

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Should __pycache__ be ignored too?

--
nosy: +serhiy.storchaka

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



[issue16242] Pickle and __getattr__

2012-10-15 Thread Joseph Fall

New submission from Joseph Fall:

This report is to re-raise an old issue from 2009:
http://bugs.python.org/issue5370
Although that issue is marked as fixed, I disagree that it was ever fixed, 
and spent an evil day tracking it down. 

Use Case:
- take two 3rd party packages: django and django-crispy-forms
- django, deep in its inner-workings, uses Pickle
- django-cripsy-forms implements the _getattr__ method in one of it's classes
- when you put the two together such that django pickles a form, the python 
interpreter goes into a tailspin in very sinister and hard-to-track-down ways 
(different behaviour in 2.5, 2.6, 2.7, as noted in issue5370, which includes a 
simple test case)

The resolution for issue5370 was to add some documentation to Pickle.  But I 
would argue this is insufficient - the implementer of django-crispy-forms would 
have no reason to ever look at the Pickle docs, and so is very likely to 
implement this bug (which s/he did).

Perhaps, if this issue cannot be resolved in code, as suggested by gagenellina 
back in 2009, at least some documentation could be added to __getattr__ (and 
others) warning that these methods could potentially be called before __init__ 
(similar to the documentation added to Pickle)?  I'd be happy to draft a small 
bit of documentation for this, although if someone can think of a way to simply 
resolve this in Pickle so it does not cause the issue in the first place, that 
seems to me ideal.

A test case is included with issue5370

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 172993
nosy: docs@python, powderflask
priority: normal
severity: normal
status: open
title: Pickle and __getattr__
type: behavior
versions: Python 2.6, Python 2.7

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



[issue16197] Several small errors in winreg documentation

2012-10-15 Thread Zachary Ware

Zachary Ware added the comment:

It occurs to me that I should have asked; should the documentation be changed 
to match the code, or the code to match the documentation (with regards to the 
default argument to the access parameter in a few functions)?

--

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



[issue16197] Several small errors in winreg documentation

2012-10-15 Thread Brian Curtin

Brian Curtin added the comment:

Docs should match code. If we did it the other way around we'd probably break 
something.

Thanks for looking into this. I've been busy the last few days but I will get 
to the review and application of the patch very soon.

--

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



[issue15958] bytes.join() should allow arbitrary buffer objects

2012-10-15 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is an updated patch using PySequence_Fast_GET_SIZE to avoid problems when 
the sequence is resized during iteration.

--
Added file: http://bugs.python.org/file27585/bytes_join_buffers2.patch

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



[issue16197] Several small errors in winreg documentation

2012-10-15 Thread Zachary Ware

Zachary Ware added the comment:

That's what I figured, so that's what I did in the patch; but I've also seen 
cases in Python where prior documentation has dictated how the code should 
work.  Thanks for the confirmation.

--

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



[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate

2012-10-15 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.4 -Python 3.3

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



[issue13607] Move generator specific sections out of ceval.

2012-10-15 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.4 -Python 3.3

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



[issue16202] sys.path[0] security issues

2012-10-15 Thread Jeroen Demeyer

Jeroen Demeyer added the comment:

It's sort of the same as #946373, except that bug report deals with other bad 
consequences of sys.path[0], unrelated to security.

#5753 is specifically about the C API, not about running plain Python.

--

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



[issue5256] rlcompleter adds builtins when custom dict is used

2012-10-15 Thread Michele Orrù

Michele Orrù added the comment:

Updated. Note that removing `eval` is necessary for the new logic of the 
function.

--
Added file: http://bugs.python.org/file27586/issue5256.1.patch

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



[issue16202] sys.path[0] security issues

2012-10-15 Thread Jeroen Demeyer

Jeroen Demeyer added the comment:

I should point out that there is also dangerous code in 
Lib/test/test_subprocess.py in the test_cwd() function.  There, the following 
is executed from /tmp:

  python -c 'import sys,os; sys.stdout.write(os.getcwd())'

As Python luckily knows where to import sys and os from, this doesn't seem 
exploitable, but it should be fixed.

--

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



[issue12486] tokenize module should have a unicode API

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch to allow tokenize() accepts string is very simple, only 4 lines. But it 
requires a lot of documentation changes.

Then we can get rid of undocumented generate_tokens(). Note, stdlib an tools 
use only generate_tokens(), none uses tokenize(). Of course, it will be better 
if tokenize() will work with iterator protocol.

Here is a preliminary patch. I will be thankful for the help with the 
documentation and for the discussion.

Of course, it will be better if tokenize() will work with iterator protocol.

--
keywords: +patch
nosy: +serhiy.storchaka
versions: +Python 3.4 -Python 3.3
Added file: http://bugs.python.org/file27587/tokenize_str.diff

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



[issue9771] add an optional default argument to tokenize.detect_encoding

2012-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 I never understood the usage of the second item. IMO it should be None if no 
 cookie found.

UTF-8 is the default source encoding for Python 3.

--
nosy: +serhiy.storchaka

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



[issue12691] tokenize.untokenize is broken

2012-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue16243] Regression in inspect module

2012-10-15 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

In Python 3.3.0 and 3.2.3:

 from inspect import *
 def f(a,b):pass
...
 formatargspec(getargspec(f))
Traceback (most recent call last):
  File stdin, line 1, in module
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/inspect.py, 
line 905, in formatargspec
spec = formatargandannotation(arg)
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/inspect.py, 
line 898, in formatargandannotation
if arg in annotations:
TypeError: unhashable type: 'list'

No such error in 2.7.1:

 formatargspec(getargspec(f))
'((a, b), None, None, None)'

--
components: Library (Lib)
messages: 173003
nosy: belopolsky
priority: normal
severity: normal
status: open
title: Regression in inspect module
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4

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



[issue16243] Regression in inspect module

2012-10-15 Thread STINNER Victor

STINNER Victor added the comment:

It looks like a typo in your code. You should use instead:
formatargspec(*getargspec(f))

Or better:
formatargspec(*getfullargspec(f))

Try with:
def f(a: int, b: float): pass

--
nosy: +haypo

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



[issue16227] Add link to 3.3 version in unicode howto

2012-10-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c59884f4bc8d by Chris Jerdonek in branch '2.7':
Issue #16227: Add to 2.x Unicode HOWTO a link to the Python 3 version.
http://hg.python.org/cpython/rev/c59884f4bc8d

--
nosy: +python-dev

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



[issue16227] Add link to 3.3 version in unicode howto

2012-10-15 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Committed without changing the first sentence, as Éric preferred.

Thanks for the report, Mark!

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

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



[issue16225] add to looping techniques tutorial a note about modifying sequence

2012-10-15 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
title: list.remove in for loop - add to looping techniques tutorial a note 
about modifying sequence
type:  - enhancement
versions: +Python 3.2, Python 3.3, Python 3.4

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



[issue16225] add to looping techniques tutorial a note about modifying sequence

2012-10-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

  It will be nice somewhere in deep clarify 
  for experts what happens with list iterator if the list changed.

Resist the urge to over-specify.  Unless the behavior is tested and known to be 
consistent across all implementations, I'm content with the current docs:

Note There is a subtlety when the sequence is being modified by the loop

Chris's currently patch seems reasonable to me and I don't think anything 
further is a good idea.

With nearly any data structure in any language, most programmers learn to be 
cautious about and generally avoid looping over a structure while mutating it.  
Adding yet more documentation details won't make the issue go away.

I recommend posting the current patch and closing this issue to be done with it.

--
nosy: +rhettinger

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



[issue16225] add to looping techniques tutorial a note about modifying sequence

2012-10-15 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks, Raymond.  I will be doing that later today.

--

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



[issue16239] PEP8 arithmetic operator examples

2012-10-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

  Shouldn't this be in the Yes 
 or an Optionally example block?

+1

--
nosy: +rhettinger

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



[issue16243] Regression in inspect module

2012-10-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

My bad, but I think documentation can be improved by adding an example.

--
assignee:  - docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
type: behavior - enhancement
versions:  -Python 3.2, Python 3.3

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



[issue16225] add to looping techniques tutorial a note about modifying sequence

2012-10-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1f1bf6a3abbc by Chris Jerdonek in branch '3.2':
Issue #16225: Add additional note to tutorial about changing sequence while 
looping.
http://hg.python.org/cpython/rev/1f1bf6a3abbc

New changeset 8cb14494d33c by Chris Jerdonek in branch '3.3':
Issue #16225: Merge from 3.2: Add additional note to tutorial about looping.
http://hg.python.org/cpython/rev/8cb14494d33c

New changeset e0a407d41af5 by Chris Jerdonek in branch 'default':
Issue #16225: Merge from 3.3: Add additional note to tutorial about looping.
http://hg.python.org/cpython/rev/e0a407d41af5

--
nosy: +python-dev

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



[issue16225] add to looping techniques tutorial a note about modifying sequence

2012-10-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dc006b6212e7 by Chris Jerdonek in branch '2.7':
Issue #16225: Backport from 3.2: Add additional note to tutorial about looping.
http://hg.python.org/cpython/rev/dc006b6212e7

--

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



[issue16225] add to looping techniques tutorial a note about modifying sequence

2012-10-15 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Committed.  Thanks for reporting the suggestion, Ian.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue16235] Add python-config.sh for use during cross compilation.

2012-10-15 Thread Trent Nelson

Changes by Trent Nelson tr...@snakebite.org:


--
nosy: +trent

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



[issue9583] Document startup option/environment interaction

2012-10-15 Thread Todd Rovito

Todd Rovito added the comment:

Applies to Python 3.4 in development and Python 2.7.  I recently ran into a 
similar conflict where I was overriding a environment variable with a command 
line option and didn't realize it.  I first checked the documentation and 
noticed that it was not clear.  Then I found this bug report and made a patch 
which is attached.  The patch iterates what Terry Reedy suggested which I 
thought made the documentation clearer.  This is my first patch to Python I 
hope it is helpful as Python has served me well over the years.

--
keywords: +patch
nosy: +Todd.Rovito
versions: +Python 3.4 -Python 3.1, Python 3.2
Added file: http://bugs.python.org/file27588/EnvironmentVariables.patch

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



[issue1283110] Give __len__() advice for don't know

2012-10-15 Thread Todd Rovito

Todd Rovito added the comment:

For Python 3.4 attached is a patch as suggested by Raymond Hettinger.  My 
suggestion is to put the patch in Doc/reference/datamodel.rst because if a user 
searches google.com for __len__ this is the first link in the list.  I think 
this extra information is a valuable addition to the documentation.

--
keywords: +patch
nosy: +Todd.Rovito
versions: +Python 3.4
Added file: http://bugs.python.org/file27589/DataModel__len__.patch

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



[issue16244] TimedRotatingFileHandler forces write mode, should use append

2012-10-15 Thread Richard Jones

New submission from Richard Jones:

The RotatingFileHandler classes force the open() mode of the new log file to be 
w even though it is initially defaulted to a in doRollover() methods:

self.mode = 'w'
self.stream = self._open()

This can cause problems in systems that have multiple programs writing to the 
log file; they can both end up opening the new file in w mode and then 
there's loss of data.

I cannot think of a reason why w should be forced in this manner.

The fix is to remove the self.mode = 'w' line from the two doRollover() 
methods.

--
components: Library (Lib)
messages: 173016
nosy: richard
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler forces write mode, should use append
type: behavior

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



[issue9583] Document startup option/environment interaction

2012-10-15 Thread Todd Rovito

Todd Rovito added the comment:

After another review I decided to submit a newer patch that uses a comma so I 
think the documentation flows better.

--
type:  - enhancement
Added file: http://bugs.python.org/file27590/EnvironmentVariables.patch

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