[issue21340] Possible concurrency bug in asyncio, AttributeError in tasks.py

2014-04-24 Thread Guido van Rossum
Guido van Rossum added the comment: Oh wait, it looks like the assert failed because KeyboardInterrupt hit right at that point. I ran the program a few times and when I hit ^C I get a traceback at a different point in the code each time. This is as expected. You must have hit the rare case whe

[issue11708] argparse: suggestion for formatting optional positional args

2014-04-24 Thread paul j3
paul j3 added the comment: This is a testing script for this patch. It is not a unit test. Example: p = argparse.ArgumentParser() p.formatter_class = argparse.ReGroupHelpFormatter p.add_argument('foo') p.add_argument('arg1',nargs='?') p.add_argument('arg2',nargs='?') a =

[issue11708] argparse: suggestion for formatting optional positional args

2014-04-24 Thread paul j3
paul j3 added the comment: This patch adds a ReGroupHelpFormatter class, which regroups positional arguments in the usage line as discussed before. It builds on the reworked usage formatter in bugs/python.org/issue11874 (which keeps usage as a list longer). For a complicate parser, usage may

[issue17227] devguide: buggy heading numbers

2014-04-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: The only change is that '25' is now '28'. A possible solution, without changing Sphinx, is to reduce the headers to a couple of words and put the question under the header, possibly in italics. *Q. How do I do this difficult thing?* A. Do 2 pushups, sleep 3 h

[issue16574] clarify policy on updates to final peps

2014-04-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: With respect to editing final peps, I think this issue should be closed. The current PEP 1 statement accurately describes what we do, which is that in general we do not edit final peps. Moreover, Chris has not submitted a patch and I doubt anyone else knows wh

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: At some point I plan to write a web API that accepts a word, 'doge' and returns a list of possible suggestions and scores. Later a "did you mean dog" style suggestion could be implemented on top. We compute the scores, and it is computationally taxing, w

[issue15569] Doc doc: incorrect description of some roles as format-only

2014-04-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: There are no versions for the devguide. There is another misplaced role: : option A command-line option of Python. The leading hyphen(s) must be included. If a matching cmdoption directive exists, it is linked to. For options of other programs or scripts, u

[issue14218] include rendered output in addition to markup

2014-04-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: The link in the first message does not work. This should: https://docs.python.org/devguide/documenting.html The section under discussion, which pydev controls, as opposed to the full .rst doc at http://docutils.sourceforge.net/rst.html, is https://docs.python.or

[issue21292] C API in debug fails

2014-04-24 Thread Steve
Steve added the comment: Indeed, but not defining _DEBUG for debug compiling is not realistic. Too many dependencies. I am not even sure it would work, because if we bind with the debug libraries, but build with the "release" headers, it might break. In any case it is not an option we have

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Tim Peters
Tim Peters added the comment: I wonder whether this new function would attract any users, given that the user already has control over the smallest ratio that will be accepted, and over the maximum number of close matches returned. That's always been sufficient for me. What useful thing(s) ca

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: Ok, this patch is ready for review. -- Added file: http://bugs.python.org/file35033/diff-lib-get-scored-matches-tests-and-docs.patch ___ Python tracker __

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Changes by Russell Ballestrini : Removed file: http://bugs.python.org/file35024/difflib-patch-to-save-scores.patch ___ Python tracker ___ ___

[issue17552] socket.sendfile()

2014-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'm -1 about adding "count" *and* "blocksize" parameters. "blocksize" > alone > is good enough IMO and considering what I've just described it > is a better name than "count". I'm confused. Why is "blocksize" necessary at all? > using os.path.getsize(file.na

[issue17552] socket.sendfile()

2014-04-24 Thread akira
akira added the comment: count and blocksize are completely different. *count* specifies how many bytes at most socket.sendfile should sent overall. It may change the result i.e., it may not be necessary that the file is read until EOF. It has the same meaning as *nbytes* parameter for os.sen

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-24 Thread Ezio Melotti
Changes by Ezio Melotti : Removed file: http://bugs.python.org/file35011/newsmerge.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-24 Thread Ezio Melotti
Changes by Ezio Melotti : Added file: http://bugs.python.org/file35032/newsmerge.py ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-24 Thread Brian Kearns
Changes by Brian Kearns : Added file: http://bugs.python.org/file35031/fix_winreg_setvalueex-py27.patch ___ Python tracker ___ ___ Python-bugs

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-24 Thread Brian Kearns
Changes by Brian Kearns : Removed file: http://bugs.python.org/file35030/fix_winreg_setvalueex-py27.patch ___ Python tracker ___ ___ Python-bu

[issue21349] crash in winreg SetValueEx with memoryview

2014-04-24 Thread Brian Kearns
Changes by Brian Kearns : -- files: fix_winreg_setvalueex-py27.patch keywords: patch nosy: bdkearns priority: normal severity: normal status: open title: crash in winreg SetValueEx with memoryview type: crash versions: Python 2.7 Added file: http://bugs.python.org/file35030/fix_winreg_se

[issue8297] AttributeError message text should include module name

2014-04-24 Thread Ethan Furman
Ethan Furman added the comment: Yay, 'resolved' ! -- stage: patch review -> resolved ___ Python tracker ___ ___ Python-bugs-list mailin

[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-24 Thread William Tisäter
William Tisäter added the comment: I played around with different file and chunk sizes using attached benchmark script. After several test runs I think 1024 * 16 would be the biggest win without losing too many μs on small seeks. You can find my benchmark output here: https://gist.github.com/

[issue8297] AttributeError message text should include module name

2014-04-24 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue21348] File "C:\Python27\lib\distutils\msvc9compiler.py", line 295, in query_vcvarsal l raise ValueError(str(list(result.keys()))) ValueError: [u'path']

2014-04-24 Thread Cris
New submission from Cris: I have Windows 8 64bit and Python 64bit (installed from here: https://www.python.org/ftp/python/2.7/python-2.7.amd64.msi) I also installed pywin32-214.win-amd64-py2.7 (from here http://downloads.sourceforge.net/project/pywin32/pywin32/Build%20214/pywin32-214.win-amd64

[issue11874] argparse assertion failure with brackets in metavars

2014-04-24 Thread paul j3
Changes by paul j3 : Removed file: http://bugs.python.org/file30941/format_usage.patch ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue11874] argparse assertion failure with brackets in metavars

2014-04-24 Thread paul j3
Changes by paul j3 : Added file: http://bugs.python.org/file35028/format_usage.patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue8297] AttributeError message text should include module name

2014-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset d84a69b7ba72 by Ethan Furman in branch 'default': Issue8297: module attribute lookup failures now include module name in error message. http://hg.python.org/cpython/rev/d84a69b7ba72 -- nosy: +python-dev

[issue9731] Add ABCMeta.has_methods and tests that use it

2014-04-24 Thread Claudiu.Popa
Claudiu.Popa added the comment: I have updated the previous patch, by documenting the new class method. -- versions: +Python 3.5 -Python 3.4 Added file: http://bugs.python.org/file35027/issue9731.patch ___ Python tracker

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Changes by Russell Ballestrini : Removed file: http://bugs.python.org/file35023/difflib-patch-to-save-scores-in-get-close-matches.patch ___ Python tracker ___ __

[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2014-04-24 Thread stoyanov
stoyanov added the comment: Alternative temporary solution def enum_types(mimedb): try: ctype = ctype.encode(default_encoding) # omit in 3.x! except UnicodeEncodeError: pass except Exception: #<-- pass#<-- else: yield ctype -- nosy: +quick.es ___

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +tim.peters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue21347] Don't use a list argument together with shell=True in subprocess' docs

2014-04-24 Thread akira
New submission from akira: *Popen(["something"], shell=True)* works but it is similar to *Popen(["something", "arg"], shell=True)* that passes "arg" to /bin/sh on POSIX systems instead of "something". It is best to always use a string if `shell=True` is necessary. It is a common confusion #203

[issue19662] smtpd.py should not decode utf-8

2014-04-24 Thread Sreepriya Chalakkal
Sreepriya Chalakkal added the comment: Hi Maciej, I am travelling now and it might take some delay for me to work on this! I got to know that you are working on RFC 6532. You might take this up and fix it as this is related to your work and I don't want to create delays. -- __

[issue21346] typos in test_itertools.py

2014-04-24 Thread Zachary Ware
New submission from Zachary Ware: Fixed, thanks for the patch! changeset 90450:1beb3e0507fa 2.7 Issue #21346: Fix typos in test_itertools. Patch by Brian Kearns. changeset 90451:901b9afc918e 3.4 Issue #21346: Fix typo, make message consistent in test_itertools. Pointed out by Brian Kearns. ch

[issue21345] multiprocessing.Pool._handle_workers sleeps too long

2014-04-24 Thread Ned Deily
Changes by Ned Deily : -- nosy: +sbt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/ma

[issue21342] multiprocessing RLock and Lock raise incorrect exceptions when releasing an unlocked lock.

2014-04-24 Thread Ned Deily
Changes by Ned Deily : -- nosy: +sbt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/ma

[issue21340] Possible concurrency bug in asyncio, AttributeError in tasks.py

2014-04-24 Thread Guido van Rossum
Guido van Rossum added the comment: Looks like there is a bug in CoroWrapper -- when the assert in __init__ fails, __del__ gets called imediately after and that triggers this traceback. However I'm not sure what causes the assert to fail -- it looks like this is coming from sleep(), which does

[issue21346] typos in test_itertools.py

2014-04-24 Thread Brian Kearns
Changes by Brian Kearns : -- files: test_itertools_typos-py27.patch keywords: patch nosy: bdkearns priority: normal severity: normal status: open title: typos in test_itertools.py type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file35025/test_itertools_typos-py2

[issue21340] Possible concurrency bug in asyncio, AttributeError in tasks.py

2014-04-24 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov ___ Python tracker ___ ___ Python-bugs-li

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Zachary Ware
Zachary Ware added the comment: Russell Ballestrini wrote: > Determine if docstrings are enough to document the new function. No, Doc/library/difflib.rst will need an update. (Btw, I removed 2.7 from versions because 2.7 is not open to new features, bugs and security-critical enhancements only

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Zachary Ware
Changes by Zachary Ware : -- stage: -> patch review versions: -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: get_close_matches() doesn't seem to have any tests... I suppose I should write them considering I'm changing the functionality a bit. TODO: write tests for * difflib.get_close_matches() * difflib.get_scored_matches() Determine if docstrings are enough

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Claudiu.Popa
Claudiu.Popa added the comment: Your patch needs tests and documentation update. For examples, you could look in test_difflib.py and see how get_close_matches is tested. -- ___ Python tracker _

[issue21345] multiprocessing.Pool._handle_workers sleeps too long

2014-04-24 Thread Johannes Baiter
New submission from Johannes Baiter: While testing a module that uses multiprocessing.Pool to distribute load across multiple processes, I noticed that my test suite was copmleting very quickly (~0.15s) on Python 2.6, while Python 2.7 and above took around 10x as long (~1.6s). Upon debugging t

[issue17552] socket.sendfile()

2014-04-24 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > [...] I'd like a parameter for the offset, and another one for the > number of bytes to send. > To sum up, I think there's a fundamental confusion between blocksize > and count in this API. Ah OK, I see what you mean now. If seems we didn't understand each

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: New function in difflib: get_scored_matches() This function acts just like the existing get_close_matches() function however instead of returning a list of words, it returns a list of tuples (score, word) pairs. This gives the end-user the ability to acce

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Russell Ballestrini added the comment: Claudiu.Popa, Yes, that was my first idea on how to tackle this issue. I will create another proper patch that prepares two separate functions: * get_close_matches * get_scored_close_matches Where each are basically wrapper / API functions around a priva

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Claudiu.Popa
Claudiu.Popa added the comment: Ah, nevermind my first comment. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Claudiu.Popa
Claudiu.Popa added the comment: It would be easier to review your patch if you'll upload it as a proper patch. Usually for these cases (modifying the return by passing a specific argument) it's best to provide a new function with this functionality, by having get_close_matches and get_scored_c

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Changes by Russell Ballestrini : -- keywords: +patch Added file: http://bugs.python.org/file35023/difflib-patch-to-save-scores-in-get-close-matches.patch ___ Python tracker ___

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
Changes by Russell Ballestrini : Removed file: http://bugs.python.org/file35022/difflib.py ___ Python tracker ___ ___ Python-bugs-list mailing

[issue21344] save scores or ratios in difflib get_close_matches

2014-04-24 Thread Russell Ballestrini
New submission from Russell Ballestrini: The current implementation of difflib's get_close_matches() function computes computationally complex scores (ratios) but then tosses them out without giving the end-user the chance to have at them. This patch adds an optional "scores" boolean argument

[issue20098] email policy needs a mangle_from setting

2014-04-24 Thread Milan Oberkirch
Changes by Milan Oberkirch : Removed file: http://bugs.python.org/file35020/mangle_from_20140424.patch ___ Python tracker ___ ___ Python-bugs-

[issue20098] email policy needs a mangle_from setting

2014-04-24 Thread Milan Oberkirch
Changes by Milan Oberkirch : Added file: http://bugs.python.org/file35021/mangle_from_20140424.patch ___ Python tracker ___ ___ Python-bugs-li

[issue20098] email policy needs a mangle_from setting

2014-04-24 Thread Milan Oberkirch
Milan Oberkirch added the comment: Updated the last patch according to the review comments at https://bugs.python.org/review/20098/. -- Added file: http://bugs.python.org/file35020/mangle_from_20140424.patch ___ Python tracker

[issue17552] socket.sendfile()

2014-04-24 Thread akira
akira added the comment: use_fallback parameter is mostly a debugging tool. If it helps to avoid the indecision; I would side with neologix' remarks and also suggest to drop the use_fallback parameter. It seems the patch assumes *offset == nbytes_sent* that is false in general e.g., if offset >

[issue17552] socket.sendfile()

2014-04-24 Thread Charles-François Natali
Charles-François Natali added the comment: >> A useful parameter instead would be to support sending only part of the file, >> so adding a count argument. > > Have you read my patch? This is already provided by the "offset" parameter. Of course I read your patch ;-) I mean I'd like a parameter f