[issue6210] Exception Chaining missing method for suppressing context

2012-01-31 Thread Ethan Furman
Ethan Furman added the comment: Okay, *all* the documentation updates this time. Thanks, Nick! -- Added file: http://bugs.python.org/file24387/raise_from_none_v5.diff ___ Python tracker ___

[issue6210] Exception Chaining missing method for suppressing context

2012-01-31 Thread Ethan Furman
Ethan Furman added the comment: Attached patch now includes doc changes. -- Added file: http://bugs.python.org/file24386/raise_from_none_v4.diff ___ Python tracker ___ __

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2012-01-31 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea versions: +Python 3.3 -Python 2.7, Python 3.1, Python 3.2 ___ Python tracker ___ ___ Python

[issue12100] Incremental encoders of CJK codecs reset the codec at each call to encode()

2012-01-31 Thread Kang-Hao (Kenny) Lu
Changes by Kang-Hao (Kenny) Lu : -- nosy: +kennyluck ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue13913] utf-8 or utf8 or utf-8 (codec display name inconsistency)

2012-01-31 Thread Kang-Hao (Kenny) Lu
Kang-Hao (Kenny) Lu added the comment: > and the table on the documentation of the codec module suggests *utf_8* > as the name of the codec, which I believe to be equivalent to "utf_8" > because '-' is not a valid character of an identifier. typo: equivalent to "utf_8" → equivalent to "utf-8".

[issue12892] UTF-16 and UTF-32 codecs should reject (lone) surrogates

2012-01-31 Thread Kang-Hao (Kenny) Lu
Kang-Hao (Kenny) Lu added the comment: > The followings are on my TODO list, although this patch doesn't depend > on any of these and can be reviewed and landed separately: > * make the surrogatepass error handler work for utf-16 and utf-32. (I >should be able to finish this by today) Unfo

[issue13903] New shared-keys dictionary implementation

2012-01-31 Thread Gregory P. Smith
Gregory P. Smith added the comment: FYI - I strongly support this type of work to reduce memory use of the Python interpreter! :) Also, yes, constant changing should be separate from this change but are worth occasionally re-measuring and justifying as common computer architectures have cha

[issue13706] non-ascii fill characters no longer work in formatting

2012-01-31 Thread STINNER Victor
STINNER Victor added the comment: With the changeset 056f5cc8885d, format(1234, 'n') fails in a locale using a non-ASCII thousands separator. Patch showing the problem: diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py --- a/Lib/test/test_format.py +++ b/Lib/test/test_format.py @@

[issue13882] Add format argument for time.time(), time.clock(), ... to get a timestamp as a Decimal object

2012-01-31 Thread STINNER Victor
STINNER Victor added the comment: Hum, it looks like _PyTime_AsDecimal() is wrong is ts->divisor is not a power of 10. The exponent must be computed with Context(1), not Context(26). Something simpler can maybe be used, I don't know even the decimal API. -- __

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2012-01-31 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2012-01-31 Thread Kang-Hao (Kenny) Lu
New submission from Kang-Hao (Kenny) Lu : Currently the "surrogatepass" handler always encodes the surrogates in UTF-8 and hence the behavior for, say, "\udc80".encode("latin-1", "surrogatepass").decode("latin-1") might be unexpected and I don't even know what would, say, "\udc80\udc80".encode

[issue13915] Update Tutorial 6.1.3 for PEP 3145

2012-01-31 Thread Terry J. Reedy
New submission from Terry J. Reedy : http://docs.python.org/py3k/tutorial/modules.html#compiled-python-files needs to be updated for 3.2+ to reflect http://python.org/dev/peps/pep-3147/ The first sentence is still technically correct, but finding x.pyc in the same directory as x.py is now an a

[issue13706] non-ascii fill characters no longer work in formatting

2012-01-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 056f5cc8885d by Victor Stinner in branch 'default': Issue #13706: Add assertions to detect bugs earlier http://hg.python.org/cpython/rev/056f5cc8885d -- ___ Python tracker

[issue10580] Minor grammar change in Python’s MSI installer

2012-01-31 Thread Martin v . Löwis
Martin v. Löwis added the comment: Retro: Indeed I'm ignoring your reports because of your tone. If you want to insult me, go ahead, but please don't use the bug tracker (I can ignore insults pretty well by now). If you want to achieve something, stop insulting people. -- ___

[issue13847] Catch time(), ftime(), localtime() and clock() errors

2012-01-31 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue13845] Use GetSystemTimeAsFileTime() to get a resolution of 100 ns on Windows

2012-01-31 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file24306/timespec-2.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2012-01-31 Thread STINNER Victor
STINNER Victor added the comment: Issue #13914 has been marked as a duplicate of this issue. -- ___ Python tracker ___ ___ Python-bug

[issue13914] In module re the repeat interval {} doesn't accept numbers greater than 65535

2012-01-31 Thread STINNER Victor
STINNER Victor added the comment: This issue is a duplicate of #13169. -- nosy: +haypo resolution: -> duplicate status: open -> closed ___ Python tracker ___ __

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I was a little worried about the performance impact, so I did some > trivial benchmarks: > - O(depth) fwalk() is actually a tiny bit faster than walk() (it may > be because we don't do as much path lookup) > - O(1) fwalk() is around 20% slower, on a pure-trave

[issue13914] In module re the repeat interval {} doesn't accept numbers greater than 65535

2012-01-31 Thread py.user
New submission from py.user : >>> import re >>> len(re.search(r'a+', 'a' * 10).group()) 10 >>> >>> re.search(r'a{65536,}', 'a' * 10) Traceback (most recent call last): File "/usr/local/lib/python3.2/functools.py", line 176, in wrapper result = cache[key] KeyError: (, 'a{65536,}'

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-01-31 Thread Charles-François Natali
Charles-François Natali added the comment: Here are two new versions, both addressing Antoine's and Nick's comments: - fwalk-3.diff is just an updated version - fwalk-single_fd.diff doesn't use more than 2 FDs to walk a directory tree, instead of the depth of directory tree. It's not as simple a

[issue13868] Add hyphen doc fix

2012-01-31 Thread Stefan Krah
Stefan Krah added the comment: Georg Brandl wrote: > Wow, does that mean he can cash in a Knuth check? Two already: One for the insight that "i-th" is the only true spelling, and now this one. -- ___ Python tracker

[issue10580] Minor grammar change in Python’s MSI installer

2012-01-31 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Retro, this kind of tone is not appropriate for the bug tracker, and not appreciated at all by core developers. -- nosy: +amaury.forgeotdarc ___ Python tracker

[issue10580] Minor grammar change in Python’s MSI installer

2012-01-31 Thread Boštjan Mejak
Boštjan Mejak added the comment: Apply this patch. It is not necessary to change the title of this issue report, it is of most importance that this patch gets applied already after more than a year. Come on people, move your butts on this. -- ___ P

[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2012-01-31 Thread Stefan Krah
Stefan Krah added the comment: I've uploaded a new patch that should address the remaining issues: o In the documentation _testbuffer has been replaced by m.cast() + the now multi-dimensional m.tolist(). o I restored the state of the limited API. If we want to include Py_buffer

[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2012-01-31 Thread Stefan Krah
Changes by Stefan Krah : Added file: http://bugs.python.org/file24381/a5c4a96dc981.diff ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue13402] Document absoluteness of sys.executable

2012-01-31 Thread Petri Lehtinen
Petri Lehtinen added the comment: Attached one more patch. The documentation now also mentions None as a possible value. -- Added file: http://bugs.python.org/file24380/issue13402_v3.patch ___ Python tracker

[issue13496] bisect module: Overflow at index computation

2012-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps adding a comment before those two lines would make the reason for the cast clearer. -- ___ Python tracker ___

[issue13496] bisect module: Overflow at index computation

2012-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: > Does it work with http://bugs.python.org/msg148567, in a 32 bits python? Yes. -- ___ Python tracker ___

[issue13496] bisect module: Overflow at index computation

2012-01-31 Thread Mark Dickinson
Mark Dickinson added the comment: > I think the patch is *NOT* correct. Can you elaborate? It works fine for that example on a 64-bit build; not sure why 32-bit would be any different. The idea is just that the single cast forces the addition to be done as an addition of integers of type s

[issue13817] deadlock in subprocess while running several threads using Popen

2012-01-31 Thread Charles-François Natali
Changes by Charles-François Natali : -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue13913] utf-8 or utf8 or utf-8 (codec display name inconsistency)

2012-01-31 Thread Kang-Hao (Kenny) Lu
Changes by Kang-Hao (Kenny) Lu : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue13913] utf-8 or utf8 or utf-8 (codec display name inconsistency)

2012-01-31 Thread Kang-Hao (Kenny) Lu
New submission from Kang-Hao (Kenny) Lu : Since Python 3.2.2 (I don't have earlier version to test with), >>> "\udc80".encode("utf-8") UnicodeEncodeError: *utf-8* codec can't encode character '\udc80'... but >>> b"\xff".decode("utf-8") UnicodeDecodeError: *utf8* codec can't decode byte 0xff in

[issue13609] Add "os.get_terminal_size()" function

2012-01-31 Thread anatoly techtonik
anatoly techtonik added the comment: On Tue, Jan 31, 2012 at 7:48 PM, Zbyszek Szmek wrote: > > Zbyszek Szmek added the comment: > > > the Python script is executed. Will get_terminal_size() > > return new value? > Please see previous discussion and the docs (and the SUSv2 specs). > The env. v

[issue13609] Add "os.get_terminal_size()" function

2012-01-31 Thread Zbyszek Szmek
Zbyszek Szmek added the comment: > the Python script is executed. Will get_terminal_size() > return new value? Please see previous discussion and the docs (and the SUSv2 specs). The env. var. is for overriding. -- ___ Python tracker

[issue13609] Add "os.get_terminal_size()" function

2012-01-31 Thread anatoly techtonik
anatoly techtonik added the comment: What happens with COLUMNS env variables if terminal is resized after the Python script is executed. Will get_terminal_size() return new value? -- ___ Python tracker __

[issue7856] cannot decode from or encode to big5 \xf9\xd8

2012-01-31 Thread Kang-Hao (Kenny) Lu
Changes by Kang-Hao (Kenny) Lu : -- nosy: +kennyluck ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue13899] re pattern r"[\A]" should work like "A" but matches nothing. Ditto B and Z.

2012-01-31 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13897] Move fields relevant to coroutine/generators out of frame into generator/threadstate

2012-01-31 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13609] Add "os.get_terminal_size()" function

2012-01-31 Thread Zbyszek Szmek
Zbyszek Szmek added the comment: Well, right now it's just one function. Functionality which you propose could of course be useful, but let's leave if for another day, another issue. See also http://bugs.python.org/issue13609#msg149627 and #444582 and #12442 -- shutil is growing in different

[issue1625] bz2.BZ2File doesn't support multiple streams

2012-01-31 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Éric, bz2 module in Python is documented as able to manage bz2 files. But that is not true, since it is unable to manage popular bz2 files. That looks like a bug to me. In fact, you can create those files from python, files that python can not unpack later.

[issue13496] bisect module: Overflow at index computation

2012-01-31 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: I think the patch is *NOT* correct. Does it work with http://bugs.python.org/msg148567, in a 32 bits python? -- ___ Python tracker ___ __

[issue13912] ImportError using __import__ and relative level 1

2012-01-31 Thread Brett Cannon
Brett Cannon added the comment: On Mon, Jan 30, 2012 at 18:33, Eric Snow wrote: > > Eric Snow added the comment: > > Jason: just a warning. importlib_backport is a relatively naive tool for > generating the backport from the py3k source. It's also relatively fragile > and at this point prob

[issue13609] Add "os.get_terminal_size()" function

2012-01-31 Thread STINNER Victor
STINNER Victor added the comment: termsize.diff.7: - shutil.get_terminal_size(): I would prefer columns and lines variable names instead of "ccc" and "rrr" - "Right now the values are not cached, but this might change." why would it be cached? this sentence can just be removed - I would prefe

[issue13609] Add "os.get_terminal_size()" function

2012-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: "except Exception" clauses in the tests are too broad. Otherwise, looks fine. -- ___ Python tracker ___ ___

[issue13609] Add "os.get_terminal_size()" function

2012-01-31 Thread anatoly techtonik
anatoly techtonik added the comment: Terminal stuff is irrelevant to `shutil`, which is the module for 'High-level file operations' and deserve a separate module named 'console'. Why? Because terminal size is only relevant when you want to page output. The next step would be to detect if term

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-01-31 Thread Charles-François Natali
Charles-François Natali added the comment: It's to mimic os.walk()'s behavior: http://hg.python.org/cpython/file/bf31815548c9/Lib/os.py#l268 -- ___ Python tracker ___ _

[issue13903] New shared-keys dictionary implementation

2012-01-31 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: One other thing: is it deliberate to silence errors in the following snippet? +try: +names = fdlistdir(topfd) +except error as err: +if onerror is not None: +onerror(err) +return -- _

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-01-31 Thread Charles-François Natali
Charles-François Natali added the comment: > Given that, flistdir() and fwalk() seem like the most consistent choices of > name for APIs that aren't directly > matching an underlying POSIX function name. Well, that seems OK for me. I guess the only reason fdlistdir() is named that way is becau

[issue13899] re pattern r"[\A]" should work like "A" but matches nothing. Ditto B and Z.

2012-01-31 Thread Ezio Melotti
Ezio Melotti added the comment: The rule 1 makes sense, but it's not entirely obvious (people might consider bBaAzZ special too). The "normal Python rules for backslash escapes but revert to the C behaviour of stripping the \ from unrecognised escapes" is not obvious either, and from r'[\A]'

[issue10580] Minor grammar change in Python’s MSI installer

2012-01-31 Thread Boštjan Mejak
Boštjan Mejak added the comment: Rather apply the patch, not change the title. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue13868] Add hyphen doc fix

2012-01-31 Thread Boštjan Mejak
Boštjan Mejak added the comment: What's the purpose of this tracker if the author of an issue report has to beg for something to be fixed, despite the fact that (s)he even made a patch ? -- ___ Python tracker

[issue13229] Improve tools for iterating over filesystem directories

2012-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: (speaking of which, I'd just mention I've published pathlib as a standalone package: http://pypi.python.org/pypi/pathlib/ ) -- ___ Python tracker

[issue13903] New shared-keys dictionary implementation

2012-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: As Victor I think the tunables could be changed separately, unless they truely get in the way of the shared-keys optimization. By the way, there will need a "protection" for the case where instances are used as bags of key/value pairs (dict-alikes with attrib

[issue13229] Improve tools for iterating over filesystem directories

2012-01-31 Thread Nick Coghlan
Nick Coghlan added the comment: With the release of 0.3, I'm pretty happy with the WalkDir design (previous versions coerced the output values to ordinary 3-tuples, now it will pass along whatever the underlying iterable produces with changing the type at all). -- ___

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: There's something I don't understand in the patch: why does _are_same_file examine st_mode? -- ___ Python tracker ___

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-01-31 Thread Nick Coghlan
Nick Coghlan added the comment: Taking a closer look at the current naming scheme in the os module, fdopen() appears to be the only current function that uses the 'fd' prefix. All the other operations that accept a file descriptor just use 'f' as the prefix (fchmod, fchown, faccess, etc). Gi

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-01-31 Thread Nick Coghlan
Nick Coghlan added the comment: Hmm, given the various *at() APIs that sort alphabetically next to their path based counterparts, perhaps we can make the naming consistency change go the other way? (i.e. listdirfd() and walkfd()). Even if POSIX puts the fd at the front, do we really have to f

[issue13882] Add format argument for time.time(), time.clock(), ... to get a timestamp as a Decimal object

2012-01-31 Thread STINNER Victor
STINNER Victor added the comment: Patch version 6: - timestamp format is now a type instead of a string, e.g. time.time(int) - add int and datetime.timedelta formats, remove timespec format - complete the documentation - fix integer overflows, convert correctly time_t to PyLong There are n

[issue13912] ImportError using __import__ and relative level 1

2012-01-31 Thread Nick Coghlan
Nick Coghlan added the comment: It sounds like you may want runpy.run_module [1], rather than using imports at all. If you know how many levels up you want to go, it isn't hard to do your own munging of __name__ to create absolute module references to pass to runpy. The signature of __import_

[issue13903] New shared-keys dictionary implementation

2012-01-31 Thread Mark Shannon
Mark Shannon added the comment: Raymond Hettinger wrote: > Raymond Hettinger added the comment: > > Changing dictionaries is a big deal. You're changing many pieces at once > (not a good idea) including changing tunable parameters that are well-studied > (I spent a month testing whether 5/8

[issue13506] IDLE sys.path does not contain Current Working Directory

2012-01-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: I noticed that the script in ScriptBinding.py already dereferences interp and calls 3 interp functions directly, so I decided that calling a 4th on interp was fine. That lets restart_shell be specialized to the one purpose of being bound to Restart Shell on t