[issue21342] multiprocessing RLock and Lock raise incorrect exceptions when releasing an unlocked lock.
New submission from Steinn Steinsen: In the documentation of multiprocessing the locks, RLock and Lock, are said to be clones of their respective threading synchronization primitives. There is an inconsistency in what exceptions are raised when an unlocked lock is released. According to the threading documentation a RuntimeError should be raised. Lock.release raises ValueError RLock.release raises AssertionError Tested this in python 2.7, 3.2, 3.4, 3.5 and broken in all those versions. The attached patch fixes this for 3.5 -- components: Library (Lib) files: release_exceptions.patch keywords: patch messages: 217117 nosy: steinn priority: normal severity: normal status: open title: multiprocessing RLock and Lock raise incorrect exceptions when releasing an unlocked lock. type: behavior versions: Python 2.7, Python 3.2, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file35017/release_exceptions.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21342 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16104] Compileall script: add option to use multiple cores
Claudiu.Popa added the comment: Added a new version of the patch which incorporates suggestions made by Jim. Thanks for the review! -- Added file: http://bugs.python.org/file35018/issue16104_8.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16104 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21343] os.path.relpath returns inconsistent types
New submission from Matt Bachmann: I noticed an issue passing in unicode to os.path.relpath. Specifically that in some cases when passing in unicode I would get back unicode and others I would get back a string. Below I demonstrate the issue. I also attached a patch. Is this an issue or am I misunderstanding something. Is the patch reasonable? Totally willing to improve and i'll admit I cannot test the ntpath version. Python 2.7.6 (default, Apr 9 2014, 11:48:52) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin Type help, copyright, credits or license for more information. import os os.path.relpath(u'.', u'.') '.' os.path.relpath(u'.', u'../') u'bachmann' -- components: Library (Lib) files: reldir.patch keywords: patch messages: 217119 nosy: Matt.Bachmann priority: normal severity: normal status: open title: os.path.relpath returns inconsistent types type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file35019/reldir.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21343 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17552] socket.sendfile()
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 for the offset, and another one for the number of bytes to send, like in Java's version (and sendfile(), see below). I really don't like the blocksize argument. I've *never* seen code which explicitly uses a blocksize Both sendfile() and TransmitFile provide a blocksize parameter for very good reasons therefore it seems natural that an API built on top of them exposes the same parameter as well. No, they expose a *count* parameter: http://linux.die.net/man/2/sendfile ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count); count is the number of bytes to copy between the file descriptors. You're mixing up blocksize, which is the maximum number of bytes to transfer in one syscall and only makes sense in the context of repeated syscalls, and count, which is the total amount of data you want the function to transfer. No sensible sendfile-like API exposes a maximum blocksize to send at once, since the goal is to limit copies and system calls: you just pass a source and destination FD, a starting offset, and a number of bytes to transfer, and the syscall takes care of the rest. Here, you basically implement sendall() on top of sendfile() (in pseudo-code, using a buffer instead of a file and not taking into account short writes but the idea if the same): while remaining data to send: socket.sendfile(data[offset:offset+chunksize) The way it's supposed to be used is simply: socket.sendfile(data[offset:offset+count]) That's how everyone one uses sendfile(), that's how Java exposes it, and that's IMO how it should be exposed. To sum up, I think there's a fundamental confusion between blocksize and count in this API: that's what I've been saying since the beginning of this thread: if you disagree, that's OK, I just want to make sure we're talking about the same thing ;-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17552 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17552] socket.sendfile()
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 0 at the start of the function. :: _SEND_BLOCKSIZE = 262144 # ??? def sendfile(self, file, offset=None, nbytes=None, *, nbytes_per_send=_SEND_BLOCKSIZE) - nbytes_sent: Send *nbytes* bytes from regular *file* starting at *offset* position. Return the number of bytes sent. If *offset* is ``None``; start at the current file position. If *nbytes* is ``None``; send file until EOF is reached. The socket should be connection-oriented e.g., SOCK_STREAM *nbytes_per_send* is used by a *send()*-based fallback code. *os.sendfile()* ignores it. - if socket is blocking (timeout is None) then it may keep trying to send data until an error occurs. Even on success it may return less than *nbytes* if there is not enough data available in *file*. - if socket is non-blocking and timeout == 0 then fail if even a single byte can't be sent immediately - if socket has timeout 0 then raise the timeout error if more than *timeout* seconds pass since the call is started and nothing is sent i.e., use a single deadline for all system calls (like *socket.send()*). If timeout is not None then *socket.sendfile()* may send less bytes than specified. *file* position after the call is unspecified. # pseudo-code total = 0 if offset is None offset = file.tell() if nbytes is None: nbytes = os.path.getsize(file.name) interval = self.timeout if interval is not None: deadline = now() + interval while select([], [self], [], interval)[1]: # writable try: sent = os.sendfile(self, file, offset, nbytes) except BlockingIOError as e: assert getattr(e, 'characters_written', 0) == 0 if interval is not None: # update interval interval = deadline - now() if interval 0: break continue # ignore else: if sent == 0: return total total += sent offset += sent nbytes -= sent if nbytes == 0: return total if interval is not None: # update interval interval = deadline - now() if interval 0: break # timeout if total == 0: raise TimeoutError else: return total -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17552 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20098] email policy needs a mangle_from setting
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 rep...@bugs.python.org http://bugs.python.org/issue20098 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20098] email policy needs a mangle_from setting
Changes by Milan Oberkirch milan...@oberkirch.org: Added file: http://bugs.python.org/file35021/mangle_from_20140424.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20098 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20098] email policy needs a mangle_from setting
Changes by Milan Oberkirch milan...@oberkirch.org: Removed file: http://bugs.python.org/file35020/mangle_from_20140424.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20098 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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 that may be passed to alter the return output from a list of words, to a list of (score, word) tuples. -- components: Library (Lib) files: difflib.py messages: 217123 nosy: russellballestrini priority: normal severity: normal status: open title: save scores or ratios in difflib get_close_matches type: enhancement versions: Python 2.7, Python 3.5 Added file: http://bugs.python.org/file35022/difflib.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
Changes by Russell Ballestrini russell.ballestr...@gmail.com: Removed file: http://bugs.python.org/file35022/difflib.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
Changes by Russell Ballestrini russell.ballestr...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file35023/difflib-patch-to-save-scores-in-get-close-matches.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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_close_matches (for instance), which returns the modified result. -- nosy: +Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
Claudiu.Popa added the comment: Ah, nevermind my first comment. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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 private function that holds the algorithm: * _get_scored_close_matches -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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 access the computationally expensive scores/ratios produced as a by-product. The new usage does _not_ impact backward compatibility:: import difflib import keyword as _keyword difflib.get_scored_matches(wheel, _keyword.kwlist) [(0.6, 'while')] difflib.get_close_matches(wheel, _keyword.kwlist) ['while'] HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: RussellBallestrini HG: branch 'default' changed Lib/difflib.py -- Added file: http://bugs.python.org/file35024/difflib-patch-to-save-scores-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17552] socket.sendfile()
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 other. =) And yes, I suppose you're right: if possible we should pass a high value and let sendfile() do its thing. Note that we still have to implement an internal loop ourselves though because if the socket has a timeout sendfile() will return before EOF (I've checked this just now). As for what to do, here's what I propose: - we provide a blocksize argument defaulting to None - in case of send() and blocksize == None we set it to 262144 - in case of sendfile() we set it to a very high value (4M or something) - using os.path.getsize(file.name) looks risky to me as the user might have changed CWD in the meantime or something 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. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17552 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21345] multiprocessing.Pool._handle_workers sleeps too long
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 this, I pinned the slowdown down to the 'Pool.join()' method. Removing it removed the slowdown almost completely. I then checked the version history of the 'multiprocessing.pool' module between 2.6 and 2.7 and noticed that when the 'maxtasksperchild' parameter was introduced, a thread to handle the workers was introduced, which was 'join()'ed when the pool was joined. This is the function that is executed in the thread (from latest CPython checkout): @staticmethod def _handle_workers(pool): thread = threading.current_thread() # Keep maintaining workers until the cache gets drained, unless the pool # is terminated. while thread._state == RUN or (pool._cache and thread._state != TERMINATE): pool._maintain_pool() time.sleep(0.1) # -- Cause of slow 'join()' after 2.6 # send sentinel to stop workers pool._taskqueue.put(None) util.debug('worker handler exiting') I highlighted the portion that makes 'join()' take a rather long time with short-lived processes in Python 2.7 and greater. Replacing it with 'time.sleep(0)' (as is done in '_help_stuff_finish()' later in the module) makes joining go as fast as in 2.6. Is there a specific reason why this sleep period was chosen? -- components: Library (Lib) messages: 217129 nosy: Johannes.Baiter priority: normal severity: normal status: open title: multiprocessing.Pool._handle_workers sleeps too long type: performance versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21345 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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 rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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 to document the new function. (I thought it would be) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
Changes by Zachary Ware zachary.w...@gmail.com: -- stage: - patch review versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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.) -- nosy: +zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21340] Possible concurrency bug in asyncio, AttributeError in tasks.py
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21340 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21346] typos in test_itertools.py
Changes by Brian Kearns bdkea...@gmail.com: -- 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-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21346 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21340] Possible concurrency bug in asyncio, AttributeError in tasks.py
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 not make sense to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21340 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21342] multiprocessing RLock and Lock raise incorrect exceptions when releasing an unlocked lock.
Changes by Ned Deily n...@acm.org: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21342 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21345] multiprocessing.Pool._handle_workers sleeps too long
Changes by Ned Deily n...@acm.org: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21345 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21346] typos in test_itertools.py
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. changeset 90452:21012515c249 default Closes #21346: Merge with 3.4 -- nosy: +zach.ware resolution: - fixed stage: - resolved status: open - closed versions: +Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21346 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19662] smtpd.py should not decode utf-8
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. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19662 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21347] Don't use a list argument together with shell=True in subprocess' docs
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 #20344, msg98732, #7839 http://stackoverflow.com/questions/21029154/understanding-python-subprocess-check-outputs-first-argument-and-shell-true http://stackoverflow.com/questions/20787712/start-openoffice-process-with-python-to-use-with-pyuno-using-subprocess http://stackoverflow.com/questions/17880847/python-subprocess-error-in-using-cp http://stackoverflow.com/questions/17226912/why-does-simple-echo-in-subprocess-not-working http://stackoverflow.com/questions/15109665/subprocess-call-using-string-vs-using-list http://stackoverflow.com/questions/20128114/pythons-subprocess-does-not-interpret-as-expected-on-cygwin http://stackoverflow.com/questions/16840427/python-on-linux-subprocess-popen-works-weird-with-shell-true ... -- assignee: docs@python components: Documentation files: docs-subprocess-dont_use_list_with_shell_true.patch keywords: patch messages: 217136 nosy: akira, docs@python priority: normal severity: normal status: open title: Don't use a list argument together with shell=True in subprocess' docs type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file35026/docs-subprocess-dont_use_list_with_shell_true.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21347 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- nosy: +tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9291 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
Changes by Russell Ballestrini russell.ballestr...@gmail.com: Removed file: http://bugs.python.org/file35023/difflib-patch-to-save-scores-in-get-close-matches.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9731] Add ABCMeta.has_methods and tests that use it
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 rep...@bugs.python.org http://bugs.python.org/issue9731 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8297] AttributeError message text should include module name
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11874] argparse assertion failure with brackets in metavars
Changes by paul j3 ajipa...@gmail.com: Added file: http://bugs.python.org/file35028/format_usage.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11874] argparse assertion failure with brackets in metavars
Changes by paul j3 ajipa...@gmail.com: Removed file: http://bugs.python.org/file30941/format_usage.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11874 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21348] File C:\Python27\lib\distutils\msvc9compiler.py, line 295, in query_vcvarsal l raise ValueError(str(list(result.keys()))) ValueError: [u'path']
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-py2.7.exe?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpywin32%2Ffiles%2Fpywin32%2FBuild%2520214%2Fts=1398376919use_mirror=kent) When I try to install Scrapy it gives me this error: File twisted\runner\topfiles\setup.py, line 14, in lambda File .\twisted\python\dist.py, line 413, in _check_header File .\twisted\python\dist.py, line 399, in _compile_helper File C:\Python27\lib\distutils\msvc9compiler.py, line 469, in compile self.initialize() File C:\Python27\lib\distutils\msvc9compiler.py, line 379, in initialize vc_env = query_vcvarsall(VERSION, plat_spec) File C:\Python27\lib\distutils\msvc9compiler.py, line 295, in query_vcvarsal l raise ValueError(str(list(result.keys( ValueError: [u'path'] How can I fix it? -- messages: 217140 nosy: Cris priority: normal severity: normal status: open title: File C:\Python27\lib\distutils\msvc9compiler.py, line 295, in query_vcvarsal l raise ValueError(str(list(result.keys( ValueError: [u'path'] type: compile error versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21348 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8297] AttributeError message text should include module name
Changes by Benjamin Peterson benja...@python.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20962] Rather modest chunk size in gzip.GzipFile
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/tiwilliam/11273483 My test data was generated with following commands: dd if=/dev/random of=10K bs=1024 count=10 dd if=/dev/random of=1M bs=1024 count=1000 dd if=/dev/random of=5M bs=1024 count=5000 dd if=/dev/random of=100M bs=1024 count=10 dd if=/dev/random of=1000M bs=1024 count=100 gzip 10K 1M 5M 100M 1000M -- nosy: +tiwilliam Added file: http://bugs.python.org/file35029/benchmark_20962.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20962 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8297] AttributeError message text should include module name
Ethan Furman added the comment: Yay, 'resolved' ! -- stage: patch review - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21349] crash in winreg SetValueEx with memoryview
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file35030/fix_winreg_setvalueex-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21349] crash in winreg SetValueEx with memoryview
Changes by Brian Kearns bdkea...@gmail.com: -- 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_setvalueex-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21349] crash in winreg SetValueEx with memoryview
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file35031/fix_winreg_setvalueex-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21349 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18967] Find a less conflict prone approach to Misc/NEWS
Changes by Ezio Melotti ezio.melo...@gmail.com: Added file: http://bugs.python.org/file35032/newsmerge.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18967 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18967] Find a less conflict prone approach to Misc/NEWS
Changes by Ezio Melotti ezio.melo...@gmail.com: Removed file: http://bugs.python.org/file35011/newsmerge.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18967 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17552] socket.sendfile()
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.sendfile or *nbytes* in msg217121 *blocksize* doesn't change how many bytes is read in the end by socket.sendfile. At most it may affect time performance. It is *nbytes_per_send* in msg217121 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17552 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17552] socket.sendfile()
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.name) looks risky to me Why not fstat(fd) ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17552 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
Changes by Russell Ballestrini russell.ballestr...@gmail.com: Removed file: http://bugs.python.org/file35024/difflib-patch-to-save-scores.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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 rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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) can the user do with the scores? If there are compelling uses, in _those_ contexts are the `n` and `cutoff` arguments useful too? Or would it, for example, be more useful to generate all (score, word) pairs and let the user filter them as they wish? Without a concrete use case, there's no clear answer. About existing tests for `get_close_matches()`, those are in the function's docstring. doctest checks them. About the new tests in the patch, note that comparing lists for equality should be done via AssertListEqual, not via AssertEqual. Don't ask me why, but someone will eventually yell about it ;-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21292] C API in debug fails
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 on the table at this moment. As for the linking part, I am not sure I am following you. Your runtime libraries and DLLs should not need to be linked to anything. They may be dependent on the release msvcrt, and that is fine (like I said, we can live with the Python parts in release). We have many other such libraries that are only in release mode (even when we build in debug). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21292 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14218] include rendered output in addition to markup
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.org/devguide/documenting.html#restructuredtext-primer https://docs.python.org/devguide/documenting.html#additional-markup-constructs I still agree in general with the request. What I tried to say before is that showing results somehow reinforces learning. Why does the tutorial start with 2 + 2 4 ? Everyone *knows* that 2 + 2 is 4. Yet is helps to show that Python actually does the right thing. Tshepang is asking for something similar. I agree that one or more tables are needed. The example given could have a third column. One thing good about the table is that is gives the goal first, and then the means. Contrast that with one asterisk: *text* for emphasis (italics), This sentence might be ok for a reading guide (if I see one asterisk, what does it mean), but not for choosing what to write. Here is a sentence that would be really clearer with the result: it must be separated from surrounding text by non-word characters. Use a backslash escaped space to work around that: thisis\ *one*\ word. It took me several seconds to really get that the result would be thisisONEword, where the capitals indicate italics. This sentence I do not understand. Every explicit markup block which isn’t a valid markup construct (like the footnotes above) is regarded as a comment. It seems to say that the footnote markup given is not valid. And what does 'regarded as a comment' mean? Is the invalid markup block deleted? specially displayed? or displayed normally? As for style differences: the guide could start with The exact way markup is rendered depends on the theme. The examples below are rendered with the 'devguide' theme used for the rest of the devguide. I am probably the best person nosy here to write at least a draft of a patch since I believe it is needed, have some sense of doc style, but still know .rst poorly enough to have difficulties with the current version. It would be a good way to finally learn the markup. It is somewhat confusing that many of the same topics are covered twice, first for standard .rst, and then for python extensions. Ezio's example table seems to combine both. If this is done (and I think it helpful), there should be a column indicating which is which. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14218 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15569] Doc doc: incorrect description of some roles as format-only
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, use simple ``code`` markup. I think The following role does possibly create a cross-reference, but does not refer to objects: should be changed to something like The following roles do not refer to module objects, but possibly create cross-references or internal links:. Move the three misplaced roles here, along with token and term. -- nosy: +terry.reedy versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15569 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21344] save scores or ratios in difflib get_close_matches
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, we shouldn't always throw this data away. Most users will continue to use get_close_matches, some users might want to build indexes on the scores. Other users may want to cache (memonize) common queries for super fast look ups. Additionally the new function will give end-users the opportunity to inspect the scoring algos output. I prefer to use the same arg spec because it is already widely understood and documented. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21344 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16574] clarify policy on updates to final peps
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 what he thought he might add or where, The only related question I have is in relation to Martin's point 3. https://docs.python.org/devguide/documenting.html#id3 has the following: pep A reference to a Python Enhancement Proposal. This generates appropriate index entries. The text “PEP number” is generated; in the HTML output, this text is a hyperlink to an online copy of the specified PEP. Should we add something like Such links should not be a substitute for properly documenting the language in the manuals. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16574 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17227] devguide: buggy heading numbers
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 hours, drink water, and do it. I am not sure how this would affect the linked index at the top that appears before 28.1 Communications. -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17227 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11708] argparse: suggestion for formatting optional positional args
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 look like: usage: regp [-h] foo [arg1 [arg2 [arg3 [arg3 ...] [arg4 -- keywords: +patch Added file: http://bugs.python.org/file35034/regroup.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11708 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11708] argparse: suggestion for formatting optional positional args
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 = p.add_argument('arg3',nargs='*') b = p.add_argument('arg4', nargs='?') # usage: regp [-h] foo [arg1 [arg2 [arg3 [arg3 ...] [arg4 -- Added file: http://bugs.python.org/file35035/test_regroup.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11708 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com