[issue6610] Subprocess descriptor debacle

2010-05-12 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks for the test! I'll take a look and likely commit this later. -- assignee: -> gregory.p.smith ___ Python tracker ___ _

[issue8657] urlparse.urlunsplit should be smarter about +

2010-05-12 Thread Senthil Kumaran
Senthil Kumaran added the comment: I have added 'git' and 'git+ssh' under known schemes which will recognize authority/netloc and follow consistent round trip parsing behaviors. For any unknown scheme(x or git+file), it might required to update the uses_netloc in the application. git+ and sv

[issue8591] update mkpkg to latest coding standards

2010-05-12 Thread Dan Buch
Dan Buch added the comment: I've started work on cleanup of ``mkpkg.py`` per instruction from jafo, am pushing to a branch 'mbh/mkpkg-cleanup' of my distutils2 fork: http://bitbucket.org/meatballhat/distutils2/changeset/be40174c59e2 I'll attach patch(es) when finished :) --

[issue8645] PyUnicode_AsEncodedObject is undocumented

2010-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue8646] PyUnicode_EncodeDecimal is undocumented

2010-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue8647] PyUnicode_GetMax is undocumented

2010-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue8648] The UTF-7 codec functions are undocumented

2010-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue8649] Py_UNICODE_* functions are undocumented

2010-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue7689] Pickling of classes with a metaclass and copy_reg

2010-05-12 Thread Bryan Silverthorn
Changes by Bryan Silverthorn : -- nosy: +bsilverthorn ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue8538] Add ConfigureAction to argparse

2010-05-12 Thread Yaniv Aknin
Yaniv Aknin added the comment: I'm looking into making a patch from this for py3k, and have the following observations: 1. I agree with merwok, at the moment the monolithic ConfigureAction is a bit excessive for most uses (other than maybe emulating ./Configure...). I vote we split it to Fla

[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- components: +Unicode ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue8678] crashers in rgbimg

2010-05-12 Thread STINNER Victor
STINNER Victor added the comment: See also #7673 (other crashers). -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4653] Patch to fix typos for Py3K

2010-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue2716] Reimplement audioop because of copyright issues

2010-05-12 Thread STINNER Victor
STINNER Victor added the comment: I found severe bugs (which may lead to security vulnerabilities) in audioop: #7673. Nobody fixed these errors (but my issue contains a patch). -- nosy: +haypo ___ Python tracker _

[issue7978] SocketServer doesn't handle syscall interruption

2010-05-12 Thread Yaniv Aknin
Yaniv Aknin added the comment: While bda's usecase is indeed fixed is recent versions, I want to point out the issue still exists in a recent py3k checkout. I've updated my patch to apply cleanly against recent py3k (and made less structural changes to test_socketserver.py; I still think it h

[issue7978] SocketServer doesn't handle syscall interruption

2010-05-12 Thread Yaniv Aknin
Changes by Yaniv Aknin : Removed file: http://bugs.python.org/file16841/socketserver_eintr_py3k.diff ___ Python tracker ___ ___ Python-bugs-lis

[issue8256] input() doesn't catch _PyUnicode_AsString() exception; io.StringIO().encoding is None

2010-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- title: TypeError: bad argument type for built-in operation -> input() doesn't catch _PyUnicode_AsString() exception; io.StringIO().encoding is None ___ Python tracker

[issue8256] TypeError: bad argument type for built-in operation

2010-05-12 Thread STINNER Victor
STINNER Victor added the comment: This issue is directly related to issue #6697. The first problem is that the builtin input() function doesn't check that _PyUnicode_AsString() result is not NULL. The second problem is that io.StringIO().encoding is None. I don't understand why it is None wh

[issue3621] it would be nice if installers made by bdist_wininst stored an EstimatedSize property in the Windows registry

2010-05-12 Thread Martin v . Löwis
Changes by Martin v. Löwis : -- priority: normal -> low ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue8687] sched.py module doesn't have a test suite

2010-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I agree. Are you recommending to take advantage of this and change the > tests in some way? Yes, it would allow you to check that if you have e.g. : - A scheduled in 1 s - B scheduled in 3 s sched.py first sleeps for 1 s, then calls A, then sleeps for 2 s, t

[issue8687] sched.py module doesn't have a test suite

2010-05-12 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I agree. Are you recommending to take advantage of this and change the tests in some way? -- ___ Python tracker ___

[issue8687] sched.py module doesn't have a test suite

2010-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: You know, one benefit of having user-settable sleep() and time() functions is that you can mock them easily, and therefore check that sched.py really schedules callables at the right intervals. -- ___ Python tracke

[issue8016] Support for cp858

2010-05-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo, lemburg stage: -> patch review versions: +Python 3.2 -Python 2.7 ___ Python tracker ___ _

[issue3605] Py_FatalError causes infinite loop

2010-05-12 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: I have a fix at http://codereview.appspot.com/1184043, which makes PyErr_Occurred() return NULL when there is no thread. I'll commit it tomorrow unless there are comments. -- assignee: -> jyasskin keywords: +needs review nosy: +jyasskin stage: unit

[issue3621] it would be nice if installers made by bdist_wininst stored an EstimatedSize property in the Windows registry

2010-05-12 Thread Jason Spiro
Jason Spiro added the comment: > Can you provide a patch? Unfortunately not. I still don't think it's worth fixing this bug. :) I think you should document it in the bdist_wininst documentation then close this bug as "won't fix due to lack of volunteer resources". That way the problem wi

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Wed, May 12, 2010 at 3:34 PM, Alexander Belopolsky wrote: > I wonder if one could write an elegant recursive version that would > multiply first by last in partial_product. That could be done with a three-parameter partial_product, where the third paramet

[issue8701] tarfile: first character of member names doubled

2010-05-12 Thread Poor Yorick
New submission from Poor Yorick : In the following file, for python 2.6.4, tarfile.list doubles the first character of each member name: http://watson.nci.nih.gov/cran_mirror/src/contrib/Archive/time/time_1.0.tar.gz gnu tar handles the file correctly -- components: Library (Lib) messa

[issue8686] "This isn't defined beyond that" phrase is not friendly to non-native English speakers.

2010-05-12 Thread Tim Peters
Tim Peters added the comment: I find this whole discussion to be hilarious ;-) "Approximate upper bound" is gibberish - "upper bound" is a crisp concept that means what it says. It's not necessarily true that an upper bound is inaccurate - it may be exactly right. So "this is not as accurat

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Here is one more datapoint. $ ./python.exe -m timeit -s "import factorial4 as fm; fm.partial_product = fm.partial_product; f = fm.factorial " "f(1)" 10 loops, best of 3: 66.1 msec per loop [32794 refs] $ ./python.exe -m timeit -s "import factorial4 as

[issue8686] "This isn't defined beyond that" phrase is not friendly to non-native English speakers.

2010-05-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: I think it's important to note that this may err towards larger numbers (rather than being merely inaccurate). I also find this "an upper bound on ratio()" difficult to understand. IIUC, it is the correct value being bounded, not the result of the function u

[issue8694] python3 FAQ mentions unicode()

2010-05-12 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue2138] Add a factorial function

2010-05-12 Thread Mark Dickinson
Mark Dickinson added the comment: maix: good point. Fixed in revisions r81126 through r81129. -- ___ Python tracker ___ ___ Python-b

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Mark Dickinson
Mark Dickinson added the comment: Interesting---thanks for the analysis! Realistically though, I don't see an iterative version of factorial_part_product as an option for the C patch, without a significant increase in complexity. Daniel's current patch is remarkably clean and simple, and I'

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, May 12, 2010 at 4:50 AM, Mark Dickinson wrote: .. > (4) I wonder whether the recursion in factorial_part_product slows things > down;  it might be interesting to compare with an iterative version (but > still one that clumps together small piec

[issue8046] mmap.mmap as a context manager

2010-05-12 Thread Brian Curtin
Changes by Brian Curtin : -- versions: -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Mark Dickinson
Mark Dickinson added the comment: >I was planning to add a "if (dx > (double) LONG_MAX)" check. Would > that be sufficient? Hmm. It's subtle. On an LP64 machine, LONG_MAX will be 2**63-1, which isn't exactly representable as a double. So (double) LONG_MAX would likely be 2.0**63 exactly (

[issue8696] PEP 391: Adding documentation of logging.config.dictConfig

2010-05-12 Thread A.M. Kuchling
A.M. Kuchling added the comment: Thanks! Committed to trunk in rev81125. -- assignee: vinay.sajip -> akuchling resolution: -> accepted status: open -> closed ___ Python tracker ___

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Wed, May 12, 2010 at 12:59 PM, Mark Dickinson wrote: > (4) And please do restore the PyLong_FromDouble line in the main routine, > rather than using a C double-to-long cast.  The direct conversion again leads > to undefined behaviour for large doubles (c

[issue8700] strip() is removing an extra character if the strip pattern contains "-"

2010-05-12 Thread R. David Murray
R. David Murray added the comment: The argument to strip is a set of characters to remove, not a substring. -- nosy: +r.david.murray resolution: -> invalid stage: -> committed/rejected status: open -> closed ___ Python tracker

[issue8700] strip() is removing an extra character if the strip pattern contains "-"

2010-05-12 Thread Balachander Ganesan
New submission from Balachander Ganesan : Version: Python 2.4.3 (#1, Jan 14 2008, 18:31:21) [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2 Description: When the pattern used for strip contains "-" character then it removes one more characters next to it. >>> a = 'image

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Mark Dickinson
Mark Dickinson added the comment: > (cf. C99 6.3.1.4,p2). Oops. C99 6.3.1.4,p1. That'll teach me not to cite chapter and verse. -- ___ Python tracker ___ _

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Mark Dickinson
Mark Dickinson added the comment: Now that I've looked at the patch properly: I'm +1 on including some version of this patch. At the time that the original math.factorial went in (see issue 2138) we were hurrying a bit to get it in before the first 2.6 beta, so ended up with a simple impleme

[issue8696] PEP 391: Adding documentation of logging.config.dictConfig

2010-05-12 Thread Vinay Sajip
Vinay Sajip added the comment: Andrew - the patch looks good - thanks! A few places were "will be" could be replaced with "has been" or some such to indicate that the implementation now exists. Please go ahead with the other changes. -- keywords: -needs review _

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Wed, May 12, 2010 at 10:31 AM, Alexander Belopolsky wrote: > if ((k & 1) != 1) >          k = k - 1; > > looks odd to me. Maybe k += (k & 1) - 1? If we change the logic slightly to put the odd entry on the right instead of the left, we can do: k

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Thank you both for the valuable feedback. I'm working on a revised patch that incorporates your many suggestions. I decided to use an iterative version for two reasons: - the reference has a note at the bottom in a tiny font suggesting it - I found it count

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, May 11, 2010 at 10:19 PM, Alexander Belopolsky wrote: .. > Another readability nit:  for me k % 2 == 0 is a more readable check > for even number than (k & 1) != 1.  Performance-wise the two choices > are the same, and either can be improved by co

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Raghuram Devarakonda
Changes by Raghuram Devarakonda : -- nosy: +draghuram ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue8699] Equality and hashing for functools.partial

2010-05-12 Thread Daniel Urban
New submission from Daniel Urban : On python-dev came up an idea [1] to support equality (== and !=) and hashing by functools.partial instances. Van Lindberg provided an implementation written in Python [2]. I've made a very similar implementation in C (in Modules/_functoolsmodule.c). The P

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, May 11, 2010 at 5:58 PM, Mark Dickinson wrote: > Yes, I'm interested in seeing the pure Python version. Here is my translation of the reference implementation. > It could go into test_math, and would be a useful form of documentation. Note tha

[issue8698] PEP 391: Adding documentation of logging.config.dictConfig

2010-05-12 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- resolution: -> duplicate status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue8697] PEP 391: Adding documentation of logging.config.dictConfig

2010-05-12 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- resolution: -> duplicate status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue8698] PEP 391: Adding documentation of logging.config.dictConfig

2010-05-12 Thread A.M. Kuchling
New submission from A.M. Kuchling : The attached patch adds a first cut at documenting the PEP 391 dictConfig() feature. I've taken the PEP 391 text and rearranged it to fit into the existing logging module docs. I haven't gone through every paragraph and adjusted the markup to use Sphinx ro

[issue8696] PEP 391: Adding documentation of logging.config.dictConfig

2010-05-12 Thread A.M. Kuchling
New submission from A.M. Kuchling : The attached patch adds a first cut at documenting the PEP 391 dictConfig() feature. I've taken the PEP 391 text and rearranged it to fit into the existing logging module docs. I haven't gone through every paragraph and adjusted the markup to use Sphinx ro

[issue8697] PEP 391: Adding documentation of logging.config.dictConfig

2010-05-12 Thread A.M. Kuchling
New submission from A.M. Kuchling : The attached patch adds a first cut at documenting the PEP 391 dictConfig() feature. I've taken the PEP 391 text and rearranged it to fit into the existing logging module docs. I haven't gone through every paragraph and adjusted the markup to use Sphinx ro

[issue6610] Subprocess descriptor debacle

2010-05-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue8685] set(range(100000)).difference(set()) is slow

2010-05-12 Thread Andrew Bennetts
Andrew Bennetts added the comment: Regarding memory, good question... but this patch turns out to be an improvement there too. This optimisation only applies when len(x) > len(y) * 4. So the minimum size of the result is a set with 3/4 of the elems of x (and possibly would be a full copy of

[issue8685] set(range(100000)).difference(set()) is slow

2010-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > 1. In constrained memory environments, creating a temporary internal > copy of a large set may cause the difference operation to fail that > would otherwise succeed. It's a space/time tradeoff. There's nothing wrong about that. (do note that hash tables thems

[issue8685] set(range(100000)).difference(set()) is slow

2010-05-12 Thread Andrew Bennetts
Changes by Andrew Bennetts : Added file: http://bugs.python.org/file17306/set-mem.py ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue8686] "This isn't defined beyond that" phrase is not friendly to non-native English speakers.

2010-05-12 Thread A.M. Kuchling
A.M. Kuchling added the comment: How about just dropping those words entirely, and writing "Return an approximate upper bound on ratio() very quickly. This is not as accurate as ratio(), but is faster to compute." (We'd make similar changes to real_quick_ratio()'s text.) -- nosy: +

[issue6610] Subprocess descriptor debacle

2010-05-12 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +astrand, pitrou stage: needs patch -> patch review versions: -Python 3.0 ___ Python tracker ___ __

[issue1451466] reading very large files

2010-05-12 Thread christen
christen added the comment: I have no idea because - I am using 2.5 (windows) or 2.6 (2.5 because of old stuff that I compiled compatible with 2.5 not 2.6) - I am using open(file, 'U') that solved the problem under windows, and the pd does not exist in Linux best Richard Terry J. Reedy a écri

[issue2620] Multiple buffer overflows in unicode processing

2010-05-12 Thread R. David Murray
Changes by R. David Murray : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue8695] Issue while installing Python 2.6.5 in IBM AIX 6.1

2010-05-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: Can you propose a patch? -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue8693] Py_Initialize: can't initialize sys standard streams

2010-05-12 Thread Muhammad Bashir Al-Noimi
Muhammad Bashir Al-Noimi added the comment: Lie Ryan gave me the solution, copy http://svn.python.org/view/python/branches/py3k/Lib/encodings/cp720.py?view=markup to Python31\Lib\encodings -- ___ Python tracker

[issue8695] Issue while installing Python 2.6.5 in IBM AIX 6.1

2010-05-12 Thread Senthil
New submission from Senthil : Hi, I am trying to install Python 2.6.5 in IBM AIX(6.1) machine. The make seems to failing with the following error. Fatal Python error: Interpreter not initialized (version mismatch?) make: *** [sharedmods] IOT/Abort trap (core dumped) -- components: Buil

Py_Initialize: can't initialize sys standard streams

2010-05-12 Thread M. Bashir Al-Noimi
Hi All, After installing python-3.1.2.msi I'm not able to run to python.exe at all because it gives me the following error message: Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: cp720 This application has requested the Runtime to term

[issue8692] Use divide-and-conquer for faster factorials

2010-05-12 Thread Mark Dickinson
Mark Dickinson added the comment: Some quick comments: (1) Agree about the extra bound checks: let's treat those as a separate issue and just concentrate on performance here. (2) log2 isn't portable: it's not part of C89 (though it is in C99) and I don't think it exists on Windows. Which

[issue6470] Tkinter import fails when running Python.exe from a network share

2010-05-12 Thread Christoph Gohlke
Christoph Gohlke added the comment: This issue is also present in Python 2.7b2. The svn trunk requires a slightly different patch (attached). -- versions: +Python 2.7 Added file: http://bugs.python.org/file17304/Tkinter-import-UNCW-trunk.patch ___ P

[issue1128] msilib.Directory.make_short only handles file names with a single dot in them

2010-05-12 Thread Christoph Gohlke
Christoph Gohlke added the comment: A slightly different patch is attached to issue7639, which generates short names more similar to Windows/NTFS: http://bugs.python.org/file15898/msilib_make_short.diff Here are some short names created with the msilib_make_short patch, which are identical