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

2012-01-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1b5abba0c808 by Terry Jan Reedy in branch '2.7': #13506 Add '' to path for interactive interpreter by adding with_cwd parameter http://hg.python.org/cpython/rev/1b5abba0c808 New changeset 1993aa091d89 by Terry Jan Reedy in branch '3.2': #13506 Add

[issue13701] Remove Decimal Python 2.3 Compatibility

2012-01-30 Thread Ramchandra Apte
Ramchandra Apte added the comment: There is another problem with the code it creates a dummy module when threading is not available but now threading imports dummy_threading when threading is not available. Thanks -- ___ Python tracker

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

2012-01-30 Thread Roger Serwy
Roger Serwy added the comment: I tested your patch and it works. For the sake of completeness, here's what I did: Test 1: Start IDLE in shell mode and run "import sys; print(sys.path)". The first entry should be '' This is consistent with the behavior of the regular python shell. Test 2: Re

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

2012-01-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: Whoops, hit submit too soon, before saving tab to space change. -- Added file: http://bugs.python.org/file24377/issue13506d.diff ___ Python tracker ___

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

2012-01-30 Thread Terry J. Reedy
Changes by Terry J. Reedy : Removed file: http://bugs.python.org/file24376/issue13506c.diff ___ Python tracker ___ ___ Python-bugs-list mailin

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

2012-01-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: I tested on 3.2, Win 7. sys.path starts with '' on startup, after restart, and after ^c interrupt of 'while True: pass'. It start with absolute path when running a file from the editor. I believe this is as should be. I simplified the patch a bit. Its basic i

[issue13903] New shared-keys dictionary implementation

2012-01-30 Thread Raymond Hettinger
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 was better idea that 2/3 for resizing or when the ideal small dict

[issue13903] New shared-keys dictionary implementation

2012-01-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Eric Snow
Eric Snow added the comment: The problem is your level is off and the name is incomplete. master.pkgA.foo.py should have the following: __import__('pkgB.bar', master.pkgA.__dict__, level=2).bar or __import__('pkgB.bar', master.pkgA.__dict__, fromlist=['-'], level=2) -- __

[issue13703] Hash collision security issue

2012-01-30 Thread Dave Malcolm
Dave Malcolm added the comment: Am attaching a backport of optin-hash-randomization-for-3.1-dmalcolm-2012-01-30-002.patch to 2.6 Randomization covers the str, unicode and buffer types; equality of hashes is preserved for these types. -- Added file: http://bugs.python.org/file24375/o

[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()

2012-01-30 Thread Ezra Berch
Ezra Berch added the comment: I've created a patch using the conditional expression in msg151945. The one problem I found with it is that when the input string is terminated by a newline it removes that newline. I've added an optional third argument: a function which determines which lines a

[issue13703] Hash collision security issue

2012-01-30 Thread Martin
Martin added the comment: > Has anyone had a chance to try this patch on Windows? Martin? I'm > hoping that it doesn't impose a startup cost in the default > no-randomization cost, and that any startup cost in the -R case is > acceptable. Just tested as requested. Is the patch against 3.1 for

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Eric Snow
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 probably doesn't work with the default branch. -- _

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

2012-01-30 Thread Zbyszek Szmek
Zbyszek Szmek added the comment: Updated version following comments by Victor Stinner: termsize.diff.7 - os.get_terminal_size() is moved to shutil.get_terminal_size() - some small doc updates Victor STINNER wrote: >> I noticed that bash uses $LINES, not $ROWS. I have renamed rows to >> lines e

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

2012-01-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jan 30, 2012 at 6:15 PM, STINNER Victor wrote: > Another possibility is what I proposed before in the issue #11457: take a > callback argument. > http://bugs.python.org/issue11457#msg143738 I think you are over-engineering a complicated solution

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

2012-01-30 Thread STINNER Victor
STINNER Victor added the comment: > One possibility (still awkward IMO) would be to use the return type as > the format specifier. Yeah, I already thaught to this idea. The API would be: - time.time(format=float) - time.time(format=decimal.Decimal) - time.time(format=datetime.datetime) - ti

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Jason R. Coombs
Jason R. Coombs added the comment: Thanks for the tip Brent. Still, no luck. jaraco@devjaraco:~$ python2.7 -c 'import master.pkgA; print("pkgA.__package__ is {}".format(master.pkgA.__package__)); import master.pkgA.foo' pkgA.__package__ is None Traceback (most recent call last):

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

2012-01-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 29, 2012 at 6:42 PM, STINNER Victor wrote: .. > What do you call a constant argument? "float" and "decimal"? > You would prefer a constant like time.FLOAT_FORMAT? > Or maybe a boolean (decimal=True)? Yes. This was explained on python-dev not

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread STINNER Victor
STINNER Victor added the comment: I attached a more complete patch to the issue #13882: it adds an optional timestamp format to os.stat(), os.lstat(), os.fstat(), os.fstatat(). Examples: $ ./python Python 3.3.0a0 (default:2914ce82bf89+, Jan 30 2012, 23:07:24) >>> import os >>> s=os.stat("se

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Brett Cannon
Brett Cannon added the comment: I see your mistake now: you need to call it as __import__('pkgB', globals(), index=1), else __import__ has no clue how to anchor your import in the relative package space. Try that and let me know if it makes it work. And why exactly are you trying to call __i

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

2012-01-30 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file24367/time_decimal-4.patch ___ Python tracker ___ ___ Python-bugs-list ma

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

2012-01-30 Thread STINNER Victor
STINNER Victor added the comment: Version 5: - add "datetime" and "timespec" formats: datetime.datetime object and (sec: int, nsec: int) - add timestamp optional format to os.stat(), os.lstat(), os.fstat(), os.fstatat() - support passing the timestamp format as a keyword: time.time(format

[issue13837] test_shutil fails with symlinks enabled under Windows

2012-01-30 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue13703] Hash collision security issue

2012-01-30 Thread Dave Malcolm
Dave Malcolm added the comment: I slightly messed up the test_hash.py changes. Revised patch attached: optin-hash-randomization-for-3.1-dmalcolm-2012-01-30-002.patch -- Added file: http://bugs.python.org/file24371/optin-hash-randomization-for-3.1-dmalcolm-2012-01-30-002.patch _

[issue13903] New shared-keys dictionary implementation

2012-01-30 Thread Mark Shannon
Mark Shannon added the comment: Does this really need a PEP? There is no new language feature and no change to any API. It is just saving some memory. The only possible issue is changing dict repr() ordering, but issue 13703 will do that anyway. -- ___

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread Martin v . Löwis
Martin v. Löwis added the comment: > I know that the underlying C function expects a timespec structure, > but Python can try to use a higher level API, isn't it? I agree entirely. -- ___ Python tracker _

[issue8828] Atomic function to rename a file

2012-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: os.replace() committed in 3.3! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue8828] Atomic function to rename a file

2012-01-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 80ddbd87 by Antoine Pitrou in branch 'default': Issue #8828: Add new function os.replace(), for cross-platform renaming with overwriting. http://hg.python.org/cpython/rev/80ddbd87 -- nosy: +python-dev _

[issue13868] Add hyphen doc fix

2012-01-30 Thread Georg Brandl
Georg Brandl added the comment: Wow, does that mean he can cash in a Knuth check? -- nosy: +georg.brandl ___ Python tracker ___ ___ P

[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()

2012-01-30 Thread Nick Coghlan
Nick Coghlan added the comment: Please go ahead! And Georg is right - the short spelling doesn't handle the first line correctly. It also suffers from the "trailing whitespace" problem that Amaury pointed out in my original version. The tests for the new function should check both those case

[issue13903] New shared-keys dictionary implementation

2012-01-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: This would likely require a PEP before having a chance of being considered for inclusion. -- nosy: +rhettinger ___ Python tracker ___ _

[issue13703] Hash collision security issue

2012-01-30 Thread Jim Jewett
Jim Jewett added the comment: On Mon, Jan 30, 2012 at 12:31 PM, Dave Malcolm added the comment: > It's useful for the selftests, so I've kept PYTHONHASHSEED. The reason to read PYTHONHASHSEED was so that multiple members of a cluster could use the same hash. It would have been nice to have

[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()

2012-01-30 Thread Justin Wehnes
Justin Wehnes added the comment: Just wondering if someone is already working on this or am I free to supply a patch? -- nosy: +jwehnes ___ Python tracker ___ _

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Jason R. Coombs
Jason R. Coombs added the comment: Sorry for the mistake. I corrected the pkgB package, but the result is the same: jaraco@devjaraco:~$ tree master master ├── __init__.py ├── __init__.pyc ├── pkgA │   ├── foo.py │   ├── foo.pyc │   ├── __init__.py │   └── __

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Brett Cannon
Brett Cannon added the comment: You have a typo in a filename: it should be pkgB/__init__.py (not the missing trailing underscores). -- nosy: +brett.cannon resolution: -> invalid status: open -> closed ___ Python tracker

[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2012-01-30 Thread Bert JW Regeer
Bert JW Regeer added the comment: In my first comment on this bug post I posted what project has issues with this, Botan with Boost.Python on FreeBSD and Mac OS X. If required I will post how to reproduce this error using that project. If you would prefer a simplified test case, unfortunately

[issue13890] test_importlib failures under Windows

2012-01-30 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue13890] test_importlib failures under Windows

2012-01-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2914ce82bf89 by Brett Cannon in branch 'default': Issue #13890: Also fix for extension module tests for case-insensitivity. http://hg.python.org/cpython/rev/2914ce82bf89 -- ___ Python tracker

[issue13890] test_importlib failures under Windows

2012-01-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 54d7823ec488 by Brett Cannon in branch 'default': Issue #13890: Fix importlib case-sensitivity tests to not run on Windows. http://hg.python.org/cpython/rev/54d7823ec488 -- nosy: +python-dev ___ Python t

[issue13851] Packaging distutils2 for Fedora

2012-01-30 Thread Vikash Agrawal
Vikash Agrawal added the comment: hi merwok, I didn't know this is the right place for that bug/query. I am still in the process of learning packaging, and at this moment I wont be able to tell that if its a problem of distutils2 or not, though I do feel that pysetup should have installed di

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Eric Snow
Eric Snow added the comment: what value do you see for __package__ in pkgA? -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bug

[issue13703] Hash collision security issue

2012-01-30 Thread Dave Malcolm
Dave Malcolm added the comment: It's useful for the selftests, so I've kept PYTHONHASHSEED. However, I've removed it from the man page; the only other place it's mentioned (in Doc/using/cmdline.rst) I now explicitly say that it exists just to serve the interpreter's own selftests. Am attaching

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

2012-01-30 Thread STINNER Victor
STINNER Victor added the comment: > I noticed that bash uses $LINES, not $ROWS. I have renamed rows to lines > everywhere, to follow existing convention. The stty program has "rows" and "columns" commands to set the terminal size. The tput programs has "cols" and "lines" commands to get the te

[issue12804] "make test" fails on systems without internet access

2012-01-30 Thread Éric Araujo
Éric Araujo added the comment: Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue13851] Packaging distutils2 for Fedora

2012-01-30 Thread Éric Araujo
Éric Araujo added the comment: Thanks for your support of distutils2, but this tracker is the wrong place for this bug tracker, as no RPM spec file will be added to the distutils2 repo. If there are bugs in distutils2 that prevent you from making a RPM, please say so, otherwise I will close

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

2012-01-30 Thread Éric Araujo
Changes by Éric Araujo : -- title: Installer sentence in bold -> Minor grammar change in Python’s MSI installer versions: -Python 3.1 ___ Python tracker ___ ___

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Jason R. Coombs
New submission from Jason R. Coombs : The Python 2.7.2 docs say this about __import__: Positive values for level indicate the number of parent directories to search relative to the directory of the module calling __import__(). But I find that even when setting level=1, the parent directory

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

2012-01-30 Thread Zbyszek Szmek
Zbyszek Szmek added the comment: Here's is an updated version: termsize.diff.6 Following Antoine Pitrou's comment get_terminal_size_raw is renamed back to query_terminal_size. Tests are moved to test_os.py, and there's a new test for query_terminal_size -- the output from 'stty size' is pars

[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2012-01-30 Thread Ronald Oussoren
Ronald Oussoren added the comment: The only real fix I found is to introduce "Py_" prefixed versions of all definitions in ctypes.h that are used in Python (that is Py_isalnum) and use that throughout the python source tree. That's a pretty invasive patch though and would probably be off-limi

[issue13901] test_get_outputs (test_distutils) failure with --enable-shared on Mac OS X

2012-01-30 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'd prefer a buildbot with --enable-framework and --enable-universalsdk (that is, one closer to the options used to build the installer for OSX). -- ___ Python tracker _

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

2012-01-30 Thread Éric Araujo
Éric Araujo added the comment: > I think this support should be backported to Python 2.7 and 3.2. I think our policy is pretty clear: the module docs did not say multiple streams were supported, so when support for them was added it was clearly a new feature. > Current code can't decompress f

[issue13901] test_get_outputs (test_distutils) failure with --enable-shared on Mac OS X

2012-01-30 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the analysis Ned. Can you apply your patch to distutils and packaging? Also, what do you think about adding a buildbot configured with --enable-shared? -- components: +Distutils2 nosy: +alexis ___ Python

[issue10580] Installer sentence in bold

2012-01-30 Thread Brian Curtin
Changes by Brian Curtin : -- nosy: -brian.curtin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue10580] Installer sentence in bold

2012-01-30 Thread Boštjan Mejak
Boštjan Mejak added the comment: Please apply this patch. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue13868] Add hyphen doc fix

2012-01-30 Thread Boštjan Mejak
Boštjan Mejak added the comment: For the time being I don't find any other "floating point" occurences in Python docs. I found one and made a patch for it. Please apply the patch. Thanks. -- ___ Python tracker _

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread R. David Murray
R. David Murray added the comment: There is also the fact that we have traditionally exposed thin wrappers around posix functions (and then were practical provided Windows emulations). We aren't 100% consistent about this, but we are pretty consistent about it. -- __

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread STINNER Victor
STINNER Victor added the comment: > (secs, nsecs) tuples are more practical in performance-critical applications > (e.g. synchronization of timestamps between 2 trees with large number of > files). This is also why I propose an argument to choose the format: everyone has a different use case a

[issue13868] Add hyphen doc fix

2012-01-30 Thread Stefan Krah
Stefan Krah added the comment: Congratulations: You (again) have found a fundamental error in TAOCP. Example (Third Edition, page 233): "The following definitions seem to be appropriate for base b, excess q, floating point numbers ..." -- nosy: +skrah _

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: (secs, nsecs) tuples are more practical in performance-critical applications (e.g. synchronization of timestamps between 2 trees with large number of files). -- ___ Python tracker

[issue13868] Add hyphen doc fix

2012-01-30 Thread Sandro Tosi
Sandro Tosi added the comment: On Mon, Jan 30, 2012 at 15:08, Boštjan Mejak wrote: > Can you fix all occurences of "floating point" (when in a role of > an adjective) to "floating-point" throughout Python docs? What I was asking is if *you* (since you care about the topic) would provide a pat

[issue13868] Add hyphen doc fix

2012-01-30 Thread Boštjan Mejak
Boštjan Mejak added the comment: I know that there are a lot of non-hyphenated occurences of "floating point" in Python docs, so I just want to raise awareness about those occurences. Can you fix all occurences of "floating point" (when in a role of an adjective) to "floating-point" throughou

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread STINNER Victor
STINNER Victor added the comment: > I think that one of available types of time values returned by os.stat() > should allow to directly pass these values to os.futimens() and > os.utimensat(), which expect (time_sec, time_nsec) tuples. Oh, I realized that these two functions were added to Pyt

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

2012-01-30 Thread Ezio Melotti
Ezio Melotti added the comment: Thanks for the patch! > * fix an error in the error handler for utf-16-le. (In, Python3.2 > b'\xdc\x80\x00\x41'.decode('utf-16-be', 'ignore') returns "\x00" > instead of "A" for some reason) This should probably be done on a separate patch that will be applie

[issue13703] Hash collision security issue

2012-01-30 Thread Martin v . Löwis
Martin v. Löwis added the comment: > Rather than the "" empty string for off I suggest an explicit string > that makes it clear what the meaning is. PYTHONHASHSEED="disabled" > perhaps. > > Agreed, if we can have a single env var that is preferred. It is more > obvious that the PYTHONHASHSEED

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread STINNER Victor
STINNER Victor added the comment: > I think that one of available types of time values returned by os.stat() > should > allow to directly pass these values to os.futimens() and os.utimensat(), which > expect (time_sec, time_nsec) tuples. If we choose to give the possibility to get decimal.Deci

[issue13856] xmlrpc / httplib changes to allow for certificate verification

2012-01-30 Thread Martin v . Löwis
Martin v. Löwis added the comment: > I think, I was using wrong terminology, by 'sending' I meant, 'using' the > ca_file in the client to verify Server's certificates. Then I still don't understand your remarks. You said "is there any reason for the clients in the stdlib are not carrying a ca_

[issue4966] Improving Lib Doc Sequence Types Section

2012-01-30 Thread Nick Coghlan
Nick Coghlan added the comment: Good point, without doing the split in both, any doc merges in this section will be a nightmare. OK, with the caveat that the initial 3.2 version may gloss over some issues that no longer apply in 3.3 (specifically the narrow/wide split), I'll make a new branch