virtualenvwrapper 3.0 - Python 3 support

2012-01-30 Thread Doug Hellmann
What is virtualenvwrapper = virtualenvwrapper is a set of extensions to Ian Bicking's virtualenv tool. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one

Re: Reading Adobe PDF File

2012-01-30 Thread Matej Cepl
On 29.1.2012 06:52, Shrewd Investor wrote: Or do I need to find a way to convert a PDF file into a text file? If so how? http://en.wikipedia.org/wiki/Pdftotext ? -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPI - how do you pronounce it?

2012-01-30 Thread Neil Cerutti
On 2012-01-28, Chris Angelico ros...@gmail.com wrote: On Sat, Jan 28, 2012 at 8:57 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Obviously that's pronounced Fin-tim-lin-bin-whin-bim-lim-bus-stop-F'tang- F'tang-Ol?-Biscuitbarrel. Ah, it's of British origin then. The British

add two strings

2012-01-30 Thread contro opinion
s1='\x45' s2='\xe4' s1+s2 'E\xe4' print s1+s2 E why s1+s2 not = '\x45\xe4'?? -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading Adobe PDF File

2012-01-30 Thread Adam Tauno Williams
On Sat, 2012-01-28 at 21:59 -0800, Chris Rebert wrote: On Sat, Jan 28, 2012 at 9:52 PM, Shrewd Investor clt...@gmail.com wrote: I have a very large Adobe PDF file. I was hoping to use a script to extract the information for it. Is there a way to loop through a PDF file using Python?

Re: add two strings

2012-01-30 Thread Dave Angel
On 01/30/2012 08:02 AM, contro opinion wrote: s1='\x45' s2='\xe4' s1+s2 'E\xe4' print s1+s2 E why s1+s2 not = '\x45\xe4'?? It is. E is \x45. That's plain ASCII and documented everywhere. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPI - how do you pronounce it?

2012-01-30 Thread Chris Angelico
On Mon, Jan 30, 2012 at 11:12 PM, Neil Cerutti ne...@norwich.edu wrote: The British pronunciation of Beauchamp created a minor incident at Yeoman of the Guard auditions this weekend. What about Sir Richard Chumley, the Left Tenant of the Tower? Although this is now quite off-topic for this

Re: PyPI - how do you pronounce it?

2012-01-30 Thread Neil Cerutti
On 2012-01-30, Chris Angelico ros...@gmail.com wrote: On Mon, Jan 30, 2012 at 11:12 PM, Neil Cerutti ne...@norwich.edu wrote: The British pronunciation of Beauchamp created a minor incident at Yeoman of the Guard auditions this weekend. What about Sir Richard Chumley, the Left Tenant of the

IDLE not setting current directory in its path

2012-01-30 Thread gujax
Hi, When I open python shell and change to any directory, the sys.path always shows ' '. This means it has temporarily added the current directory to its path i.e., sys.path shows [' ', other paths] I can then load any module from the current directory even though the current directory is not

PMW+BLT on windows, any chance?

2012-01-30 Thread Giacomo Boffi
on my linux box i have a small python program that draws some 2-d line graphs in a window aside a graphical interface to change the problem data as you may have guessed from the subject line, the gui widgets are done with help from PMW [1], and the graps are done by the PMW - BLT[2] interface

except clause syntax question

2012-01-30 Thread Charles Yeomans
To catch more than one exception type in an except block, one writes except (A, B, C) as e: I'm wondering why it was decided to match tuples, but not lists: except [A, B, C] as e: The latter makes more sense semantically to me -- catch all exception types in a list as opposed to catch this

Re: except clause syntax question

2012-01-30 Thread Aaron
On 01/30/2012 06:41 PM, Charles Yeomans wrote: To catch more than one exception type in an except block, one writes except (A, B, C) as e: I'm wondering why it was decided to match tuples, but not lists: except [A, B, C] as e: The latter makes more sense semantically to me -- catch all

Re: except clause syntax question

2012-01-30 Thread Charles Yeomans
On Jan 30, 2012, at 12:56 PM, Aaron wrote: On 01/30/2012 06:41 PM, Charles Yeomans wrote: To catch more than one exception type in an except block, one writes except (A, B, C) as e: I'm wondering why it was decided to match tuples, but not lists: except [A, B, C] as e: The latter

Re: except clause syntax question

2012-01-30 Thread Mel Wilson
Charles Yeomans wrote: To catch more than one exception type in an except block, one writes except (A, B, C) as e: I'm wondering why it was decided to match tuples, but not lists: except [A, B, C] as e: The latter makes more sense semantically to me -- catch all exception types in a

Condition.wait() behavior with timeout

2012-01-30 Thread Ross Boylan
The Python 2.7 documents for the threading module says, in part, wait([timeout])¶ Wait until notified or until a timeout occurs. If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised. This method

Re: IDLE not setting current directory in its path

2012-01-30 Thread Terry Reedy
On 1/30/2012 10:06 AM, gujax wrote: Hi, When I open python shell and change to any directory, the sys.path always shows ' '. It actually shows '' (without a space). When I do the same with IDLE, it shows the name of the current directory i.e., ['name1', other paths...] instead of showing ['

Disable use of pyc file with no matching py file

2012-01-30 Thread Roy Smith
Every so often (typically when refactoring), I'll remove a .py file and forget to remove the corresponding .pyc file. If I then import the module, python finds the orphaned .pyc and happily imports it. Usually leading to confusing and hard to debug failures. Is there some way to globally

Re: PyPI - how do you pronounce it?

2012-01-30 Thread André Malo
* Chris Angelico wrote: Hopefully this will be a step up from Rick's threads in usefulness, but I'm aware it's not of particularly great value! How do you pronounce PyPI? Is it: * Pie-Pie? * Pie-Pip, but without the last p? (same as above but short i) * Pie-Pea-Eye? * Something else? I

Re: Disable use of pyc file with no matching py file

2012-01-30 Thread Miki Tebeka
Not that I'm aware of. I have a script that run the test suite, one of the first commands (before calling nosetests) is: find . -name '*.py[co]' -exec rm {} \; This makes sure the tests run in a clean environment. -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable use of pyc file with no matching py file

2012-01-30 Thread Terry Reedy
On 1/30/2012 4:30 PM, Roy Smith wrote: Every so often (typically when refactoring), I'll remove a .py file and forget to remove the corresponding .pyc file. If I then import the module, python finds the orphaned .pyc and happily imports it. Usually leading to confusing and hard to debug

Re: speaking at PyCon

2012-01-30 Thread Roy Smith
Wow. As somebody who has given plenty of talks, I can tell you this is an awesome checklist (and most of it not specific to PyCon). Let me add one suggestion -- never, ever, ever, type a URL into a browser connected to the internet in front of a live audience. You never know when you're

Re: speaking at PyCon

2012-01-30 Thread Devin Jeanpierre
On Mon, Jan 30, 2012 at 6:48 PM, Roy Smith r...@panix.com wrote: Wow.  As somebody who has given plenty of talks, I can tell you this is an awesome checklist (and most of it not specific to PyCon). Let me add one suggestion -- never, ever, ever, type a URL into a browser connected to the

Re: except clause syntax question

2012-01-30 Thread Steven D'Aprano
On Mon, 30 Jan 2012 12:41:00 -0500, Charles Yeomans wrote: To catch more than one exception type in an except block, one writes except (A, B, C) as e: I'm wondering why it was decided to match tuples, but not lists: except [A, B, C] as e: Simplicity. If you also allow lists, then why

Re: except clause syntax question

2012-01-30 Thread Devin Jeanpierre
On Mon, Jan 30, 2012 at 7:00 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 30 Jan 2012 12:41:00 -0500, Charles Yeomans wrote: To catch more than one exception type in an except block, one writes except (A, B, C) as e: I'm wondering why it was decided to match

Re: speaking at PyCon

2012-01-30 Thread python
Roy, Let me add one suggestion -- never, ever, ever, type a URL into a browser connected to the internet in front of a live audience. You never know when you're going to make a typo and something *totally* not what you expected will fill the screen. Great advice! Years ago I did a

Re: IDLE not setting current directory in its path

2012-01-30 Thread Terry Reedy
On 1/30/2012 3:15 PM, Terry Reedy wrote: This issue is under consideration at http://bugs.python.org/issue13506 It should be fixed before the next Python releases. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: add two strings

2012-01-30 Thread David Lambert
On 01/30/2012 07:02 AM, contro opinion wrote: s1='\x45' s2='\xe4' s1+s2 'E\xe4' print s1+s2 E why s1+s2 not = '\x45\xe4'?? It is, but '\x45' is ASCII 'E', and '\xe4' is not a printable character: print '\x45' E print '\xe4' Try printing s1 and s2 separately in your example.

Killing threads, and os.system()

2012-01-30 Thread Laurent Claessens
Hello all I've a program that launches a lot of threads and each of them launches a os.system(my_command). My program also keeps a list of the launched threads, so I can make for loops on the threads. My aim is to kill everything with ctrl-C (KeyboardInterrupt). Of course I tried

[issue4966] Improving Lib Doc Sequence Types Section

2012-01-30 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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),

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

2012-01-30 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de 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

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

2012-01-30 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

[issue13703] Hash collision security issue

2012-01-30 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de 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

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

2012-01-30 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com 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

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

2012-01-30 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

[issue13868] Add hyphen doc fix

2012-01-30 Thread Boštjan Mejak
Boštjan Mejak bostjan.me...@gmail.com 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 

[issue13868] Add hyphen doc fix

2012-01-30 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: On Mon, Jan 30, 2012 at 15:08, Boštjan Mejak rep...@bugs.python.org 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

[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 arfrever@gmail.com 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

[issue13868] Add hyphen doc fix

2012-01-30 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org 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 STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

[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 rdmur...@bitdance.com 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.

[issue13868] Add hyphen doc fix

2012-01-30 Thread Boštjan Mejak
Boštjan Mejak bostjan.me...@gmail.com 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

[issue10580] Installer sentence in bold

2012-01-30 Thread Boštjan Mejak
Boštjan Mejak bostjan.me...@gmail.com added the comment: Please apply this patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10580 ___ ___

[issue10580] Installer sentence in bold

2012-01-30 Thread Brian Curtin
Changes by Brian Curtin br...@python.org: -- nosy: -brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10580 ___ ___ Python-bugs-list

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

2012-01-30 Thread Éric Araujo
Éric Araujo mer...@netwok.org 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

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

2012-01-30 Thread Éric Araujo
Éric Araujo mer...@netwok.org 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

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

2012-01-30 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com 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 rep...@bugs.python.org

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

2012-01-30 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com 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

[issue13609] Add os.get_terminal_size() function

2012-01-30 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl 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

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Jason R. Coombs
New submission from Jason R. Coombs jar...@jaraco.com: 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,

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

2012-01-30 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- title: Installer sentence in bold - Minor grammar change in Python’s MSI installer versions: -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10580

[issue13851] Packaging distutils2 for Fedora

2012-01-30 Thread Éric Araujo
Éric Araujo mer...@netwok.org 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,

[issue12804] make test fails on systems without internet access

2012-01-30 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12804 ___ ___ Python-bugs-list mailing

[issue13609] Add os.get_terminal_size() function

2012-01-30 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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

[issue13703] Hash collision security issue

2012-01-30 Thread Dave Malcolm
Dave Malcolm dmalc...@redhat.com 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

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com added the comment: what value do you see for __package__ in pkgA? -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13912 ___

[issue13851] Packaging distutils2 for Fedora

2012-01-30 Thread Vikash Agrawal
Vikash Agrawal vikashagrawal1...@gmail.com 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

[issue13890] test_importlib failures under Windows

2012-01-30 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za 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

[issue13890] test_importlib failures under Windows

2012-01-30 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za 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 --

[issue13890] test_importlib failures under Windows

2012-01-30 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13890 ___

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

2012-01-30 Thread Bert JW Regeer
Bert JW Regeer ber...@regeer.org 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

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Brett Cannon
Brett Cannon br...@python.org 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

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com 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 │   ├──

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

2012-01-30 Thread Justin Wehnes
Justin Wehnes jweh...@gmail.com added the comment: Just wondering if someone is already working on this or am I free to supply a patch? -- nosy: +jwehnes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13857

[issue13703] Hash collision security issue

2012-01-30 Thread Jim Jewett
Jim Jewett jimjjew...@gmail.com added the comment: On Mon, Jan 30, 2012 at 12:31 PM, Dave Malcolm dmalc...@redhat.com 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

[issue13903] New shared-keys dictionary implementation

2012-01-30 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: This would likely require a PEP before having a chance of being considered for inclusion. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org

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

2012-01-30 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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

[issue13868] Add hyphen doc fix

2012-01-30 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Wow, does that mean he can cash in a Knuth check? -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13868 ___

[issue8828] Atomic function to rename a file

2012-01-30 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za 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:

[issue8828] Atomic function to rename a file

2012-01-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: os.replace() committed in 3.3! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8828

[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 mar...@v.loewis.de 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 rep...@bugs.python.org

[issue13903] New shared-keys dictionary implementation

2012-01-30 Thread Mark Shannon
Mark Shannon m...@hotpy.org 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. --

[issue13703] Hash collision security issue

2012-01-30 Thread Dave Malcolm
Dave Malcolm dmalc...@redhat.com 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:

[issue13837] test_shutil fails with symlinks enabled under Windows

2012-01-30 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13837 ___ ___ Python-bugs-list

[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 victor.stin...@haypocalc.com 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

[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 victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file24367/time_decimal-4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13882 ___

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Brett Cannon
Brett Cannon br...@python.org 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

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

2012-01-30 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com 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)

[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 alexander.belopol...@gmail.com added the comment: On Sun, Jan 29, 2012 at 6:42 PM, STINNER Victor rep...@bugs.python.org wrote: .. What do you call a constant argument? float and decimal? You would prefer a constant like time.FLOAT_FORMAT? Or maybe a boolean

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com 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

[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 victor.stin...@haypocalc.com 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) -

[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 alexander.belopol...@gmail.com added the comment: On Mon, Jan 30, 2012 at 6:15 PM, STINNER Victor rep...@bugs.python.org wrote: Another possibility is what I proposed before in the issue #11457: take a callback argument. http://bugs.python.org/issue11457#msg143738 I

[issue13609] Add os.get_terminal_size() function

2012-01-30 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl 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

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com 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. --

[issue13703] Hash collision security issue

2012-01-30 Thread Martin
Martin gzl...@googlemail.com 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

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

2012-01-30 Thread Ezra Berch
Ezra Berch ezrabe...@mac.com 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

[issue13703] Hash collision security issue

2012-01-30 Thread Dave Malcolm
Dave Malcolm dmalc...@redhat.com 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:

[issue13912] ImportError using __import__ and relative level 1

2012-01-30 Thread Eric Snow
Eric Snow ericsnowcurren...@gmail.com 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=['-'],

[issue13903] New shared-keys dictionary implementation

2012-01-30 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13903 ___ ___

[issue13903] New shared-keys dictionary implementation

2012-01-30 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com 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

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

2012-01-30 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu 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

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

2012-01-30 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: Removed file: http://bugs.python.org/file24376/issue13506c.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13506 ___

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

2012-01-30 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu 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 rep...@bugs.python.org

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

2012-01-30 Thread Roger Serwy
Roger Serwy roger.se...@gmail.com 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

[issue13701] Remove Decimal Python 2.3 Compatibility

2012-01-30 Thread Ramchandra Apte
Ramchandra Apte maniandra...@gmail.com 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 -- ___

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

2012-01-30 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za 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