[issue11679] readline interferes with characters beginning with byte \xe9

2011-03-25 Thread Thomas Kluyver
New submission from Thomas Kluyver tak...@gmail.com: To replicate, in Python 3.1 on Linux (utf-8 console): print(chr(0x9000)) 退 Copy and paste this character into the prompt. It appears correctly (as a Chinese character). Then: import readline readline.parse_and_bind('\M-i:') Now try

[issue9969] tokenize: add support for tokenizing 'str' objects

2011-05-31 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9969 ___ ___ Python-bugs-list

[issue13692] 2to3 mangles from . import frobnitz

2012-01-01 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: A couple of things to note: - This was with the Python 3.1 implementation of 2to3 - the problem doesn't appear with the Python 3.2 version. - The import statement in question was inside a method definition. I wonder if the extra two dots

[issue444582] Finding programs in PATH, adding shutil.which

2013-01-13 Thread Thomas Kluyver
Thomas Kluyver added the comment: The 'short circuit' appears to do what I'd consider the wrong thing when an executable file of the same name exists in the working directory. i.e. which('setup.py') can return 'setup.py', even though running 'setup.py' in a shell doesn't work (you need

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-13 Thread Thomas Kluyver
New submission from Thomas Kluyver: There's a 'short circuit' in shutil.which(), described as 'If we're given a full path which matches the mode and it exists, we're done here.' It also matches if an executable file of the same name is present in the working directory, although on most Unix-y

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-17 Thread Thomas Kluyver
Thomas Kluyver added the comment: I've added a patch with my suggested fix, as well as a test for this. test_shutil all passes on Linux - I haven't run the tests on Windows. -- keywords: +patch Added file: http://bugs.python.org/file28761/shutil_which_cwd.patch

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: That makes sense - foo/setup.py can be run from the working directory, but you can't refer to subdirectories on $PATH like that. I've added a revised version of the patch. -- Added file: http://bugs.python.org/file28763/shutil_which_cwd2.patch

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: Yes, as far as I know, ./script works in the same way as dir/script - from the current directory, but not from $PATH. The first test added is for the case I reported - which('script') shouldn't look in the current directory on Unix. The second test would have

[issue8478] tokenize.untokenize first token missing failure case

2013-01-23 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8478 ___ ___ Python-bugs-list

[issue16224] tokenize.untokenize() misbehaves when moved to compatiblity mode

2013-01-25 Thread Thomas Kluyver
Thomas Kluyver added the comment: I think this is a duplicate of #8478. -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16224

[issue8478] tokenize.untokenize first token missing failure case

2013-01-25 Thread Thomas Kluyver
Thomas Kluyver added the comment: #16224 appears to be a duplicate. There seem to be several quite major issues with untokenize - see also #12691 - with patches made to fix them. Is there anything I can do to help push these forwards

[issue12691] tokenize.untokenize is broken

2013-01-28 Thread Thomas Kluyver
Thomas Kluyver added the comment: Is there anything I can do to push this forwards? I'm trying to use tokenize and untokenize in IPython, and for now I'm going to have to maintain our own copies of it (for Python 2 and 3), because I keep running into problems with the standard library module

[issue17061] tokenize unconditionally emits NL after comment lines blank lines

2013-01-28 Thread Thomas Kluyver
New submission from Thomas Kluyver: The docs describe the NL token as Token value used to indicate a non-terminating newline. The NEWLINE token indicates the end of a logical line of Python code; NL tokens are generated when a logical line of code is continued over multiple physical lines

[issue16509] sqlite3 docs do not explain check_same_thread

2013-01-28 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16509 ___ ___ Python-bugs-list

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2013-02-12 Thread Thomas Kluyver
Thomas Kluyver added the comment: I've updated Nick's patch so that test_dis and test_peephole pass again, and added a prototype ByteCode class (without any docs or tests for now, to allow for API discussion). The prototype ByteCode is instantiated with any of the objects

[issue17061] tokenize unconditionally emits NL after comment lines blank lines

2013-02-13 Thread Thomas Kluyver
Thomas Kluyver added the comment: Hmm, that's interesting. For our purposes, a blank line or a comment line shouldn't result in a continuation prompt. This is consistent with what the plain Python shell does. As part of this, we're tokenizing the code, and if the final \n results in a NL

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2013-02-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: Updated version of the patch. Changed from review: - Included test.bytecode_helper module used by some tests - Updated docs to indicate that the changes are new in 3.4 - ByteCode - Bytecode - Added meaningful repr for Bytecode Still to do: - ? Re-expose

[issue17289] readline.set_completer_delims() doesn't play well with others

2013-02-25 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17289 ___ ___ Python-bugs-list

[issue16851] Hint about correct ismethod and isfunction usage

2013-03-04 Thread Thomas Kluyver
Thomas Kluyver added the comment: I agree that the docs for inspect.ismethod() for Python 2 are wrong. The docs say: Return true if the object is a bound method written in Python. However, it also returns True for an unbound method: class A: ... def meth(self): ... pass

[issue444582] Finding programs in PATH, adding shutil.which

2013-03-25 Thread Thomas Kluyver
Thomas Kluyver added the comment: Yes, I opened that as issue 16957, and it has been dealt with. So no objection from me to closing this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue444582

[issue13099] Sqlite3 turkish locale

2011-10-04 Thread Thomas Kluyver
New submission from Thomas Kluyver tak...@gmail.com: When using sqlite3 with the Turkish locale, cursor.lastrowid is not accessible after an insert statement if INSERT is upper case. I believe that the cause is that the detect_statement_kind function [1] calls the locale-dependent C function

[issue13099] Sqlite3 turkish locale

2011-10-04 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: What form does the test need to be in? There's a script at the redhat bug I linked that demonstrates the issue. Do I need to turn it into a function? A patch for the existing test suite? -- type: behavior

[issue13099] Sqlite3 turkish locale

2011-10-04 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: Thanks, Antoine. Should I still try to write a regression test for it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13099

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: I've submitted the contributor agreement, though I've not yet heard anything back about it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14777

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: ...And mere minutes after I said I hadn't heard anything, I've got the confirmation email. :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14777

[issue14846] Change in error when sys.path contains a nonexistent folder (importlib)

2012-05-17 Thread Thomas Kluyver
New submission from Thomas Kluyver tak...@gmail.com: I've come across a difference from 3.2 to 3.3 while running the IPython test suite. It occurs when a directory on sys.path has been used for an import, then deleted without being removed from sys.path. Previous versions of Python ignore

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-10 Thread Thomas Kluyver
New submission from Thomas Kluyver tak...@gmail.com: With the text 'abc€' copied to the clipboard, on Linux, where UTF-8 is the default encoding: Python 3.2.3 (default, Apr 12 2012, 21:55:50) [GCC 4.6.3] on linux2 Type help, copyright, credits or license for more information. import tkinter

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-11 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: On this computer, I see this from Tcl: $ wish % clipboard get abc\u20ac But here Python's following suit: root.clipboard_get() 'abc\\u20ac' Which is odd, because as far as I know, my two computers run the same OS (Ubuntu 12.04) in the same

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-11 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: OK, after a quick bit of reading, I see why I'm confused: the clipboard actually works by requesting the text from the source program, so where you copy it from makes a difference. In my case, copying from firefox gives 'abc\\u20ac

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-11 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: Thanks, Ned. Does it seem like a good idea to test the windowing system like that, and default to UTF8_STRING if it's x11? So far, I've not found any case on X where STRING works but UTF8_STRING doesn't. If it seems reasonable, I'm happy

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-12 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: Here's a patch that makes UTF8_STRING the default type for clipboard_get and selection_get when running in X11. -- keywords: +patch Added file: http://bugs.python.org/file25552/x11-clipboard-utf8.patch

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-13 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: Indeed, and there don't seem to be any other tests for the clipboard functionality. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14777

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-13 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: But the encoding used seemingly depends on the source application - Geany (GTK 2, I think) seemingly sends UTF8 text anyway, whereas Firefox escapes the unicode character. So I don't think we can correctly decode the STRING value in all cases

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-13 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: OK, I'll produce an updated patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14777

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-13 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: As requested, the second version of the patch (x11-clipboard-try-utf8): - Caches the windowing system per object. The tk call to find the windowing system is made the first time clipboard_get or selection_get are called without specifying

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-13 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: I'm happy to put the cache at the module level, but I'll give other people a chance to express their views before I dive into the code again. I imagine most applications would only call clipboard_get() on one item, so it wouldn't matter

[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-13 Thread Thomas Kluyver
Thomas Kluyver tak...@gmail.com added the comment: The 3rd revision of the patch has the cache at the module level. It's a bit awkward, because there's no module level function to call to retrieve it (as far as I know), so it's exposed by objects which can call Tk. Also, serhiy pointed out

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2013-04-06 Thread Thomas Kluyver
Thomas Kluyver added the comment: I've added docs and tests, and split the changes to test_peepholer into a separate patch. I haven't re-exposed details of the code object as attributes of Bytecode instances, because they're already available as e.g. bytecode.codeobj.co_names . I think

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2013-04-06 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: Added file: http://bugs.python.org/file29695/test_peepholer.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11816

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2013-05-06 Thread Thomas Kluyver
Thomas Kluyver added the comment: Ping - the latest patches (dis_api3 test_peepholer) are ready for review when someone's got a moment. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11816

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2013-05-06 Thread Thomas Kluyver
Thomas Kluyver added the comment: bytecode_helper is there in dis_api3.diff - anyone with commit rights should be able to add it to the repository. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11816

[issue15856] inspect.getsource(SomeClass) doesn't show @decorators

2012-09-03 Thread Thomas Kluyver
New submission from Thomas Kluyver: Since bug #1006219 was fixed, inspect.getsource(func) has returned the source of a function including any decorators on the function. But doing the same with a class, the returned source doesn't include decorators. With functions, the co_firstlineno

[issue16349] Document whether it's safe to use bytes for struct format string

2012-10-28 Thread Thomas Kluyver
New submission from Thomas Kluyver: At least in CPython, format strings can be given as bytes, as an alternative to str. E.g. struct.unpack(b'hhl', b'\x00\x01\x00\x02\x00\x00\x00\x03') (1, 2, 3) Looking at the source code [1], this appears to be consciously accounted for. But it doesn't

[issue16467] frozen importlib required for extending Python interpreter not public

2012-11-13 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16467 ___ ___ Python-bugs-list

[issue12967] IDLE RPC Proxy for standard IO streams lacks 'errors' attribute

2012-11-17 Thread Thomas Kluyver
Thomas Kluyver added the comment: It seems pretty arbitrary and newcomer-unfriendly to decide that Python doesn't support running setup.py inside IDLE. Exhibit A: confused newcomer trying to install distribute, getting unhelpful error message. http://stackoverflow.com/questions/13368040

[issue11679] readline interferes with characters beginning with byte \xe9

2012-11-19 Thread Thomas Kluyver
Thomas Kluyver added the comment: OK, thanks, and sorry for the noise. I've closed this issue. Looking at the readline manual, it looks like this is tied up with the options input-meta, output-meta and convert-meta. Fiddling around with .inputrc hasn't clarified exactly what they do

[issue16544] Add external link to ast docs

2012-11-24 Thread Thomas Kluyver
Thomas Kluyver added the comment: Thanks, I'm really glad to see that it's useful to others. I don't mind contributing it to Python, but I wonder if it's better to let it develop separately for a few months first - it's still very new, and I can improve it faster in a repository where I can

[issue16544] Add external link to ast docs

2012-11-24 Thread Thomas Kluyver
Thomas Kluyver added the comment: I think that putting the full content of GTS into the ast module docs would make it awkwardly long. Perhaps the bulk of it could become a howto, and GTS could be maintained separately as a showcase of examples

[issue16349] Document whether it's safe to use bytes for struct format string

2012-11-30 Thread Thomas Kluyver
Thomas Kluyver added the comment: I'm happy to put together a docs patch, but I don't have any indication of the right answer (is it a safe feature to use, or an implementation detail?) Is there another venue where I should raise the question

[issue3158] Doctest fails to find doctests in extension modules

2014-01-27 Thread Thomas Kluyver
Thomas Kluyver added the comment: I think there's an issue with this change - ismethoddescriptor() doesn't guarantee that that the object has an __objclass__ attribute. Unbound PyQt4 signals appear to be a case where this goes wrong. This came up testing IPython on Python 3.4 - we subclass

[issue4931] distutils does not show any error msg when can't build C module extensions due to a missing C compiler

2014-03-07 Thread Thomas Kluyver
Thomas Kluyver added the comment: Any chance of getting this patch applied? It clearly makes the error message more useful, and we've run into another case where grok_environment_error gives the wrong result: when symlinking fails because the target exists, it now says File exists: source

[issue19333] distutils.util.grok_environment_error loses the error message

2014-03-07 Thread Thomas Kluyver
Thomas Kluyver added the comment: Duplicate of issue 4931. This function should be entirely unnecessary now. -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19333

[issue20884] importlib/__init__.py can not be loaded without __file__ - breaks cxFreeze

2014-03-12 Thread Thomas Kluyver
Thomas Kluyver added the comment: I think msg213138 has the key: importlib is actually getting frozen in the Python sense of the module's bytecode being included in a C file and then compiled, not just copied into a zip file. When we freeze importlib._bootstrap as _frozen_importlib, importlib

[issue20884] importlib/__init__.py can not be loaded without __file__ - breaks cxFreeze

2014-03-12 Thread Thomas Kluyver
Thomas Kluyver added the comment: In the clean solution, it sounds like making importlib/__init__.py deal with the lack of a __file__ attribute would fix the problem in cx_Freeze. We'd still need to work out whether freezing importlib into the base executable is the right thing to do

[issue20778] ModuleFinder.load_module skips incorrect number of bytes in pyc files

2014-03-27 Thread Thomas Kluyver
Thomas Kluyver added the comment: For future reference, cx_Freeze ships its own copy of ModuleFinder, so it doesn't depend on the stdlib copy. This issue was fixed there some time around the release of Python 3.3. I realised recently that this is based on code in the stdlib, and I've been

[issue21338] Silent mode for compileall

2014-04-23 Thread Thomas Kluyver
New submission from Thomas Kluyver: The compileall module's command line interface has a -q (quiet) flag which suppresses most of the output, but it still prints error messages. I'd like an entirely silent mode with no output. My use case is byte-compiling Python files as part of a graphical

[issue21338] Silent mode for compileall

2014-04-23 Thread Thomas Kluyver
Thomas Kluyver added the comment: Patch attached. This works by making the -q flag countable, so you pass -qq to suppress all output. In the Python API, the quiet parameter has become an integer, so passing 2 is equivalent to -qq. This should be fully backwards compatible with passing True

[issue21338] Silent mode for compileall

2014-04-23 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: Removed file: http://bugs.python.org/file35012/compileall_silent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338

[issue21338] Silent mode for compileall

2014-04-23 Thread Thomas Kluyver
Thomas Kluyver added the comment: Sorry, I somehow attached an old version of the patch. This one should be correct. Steven: Redirection relies on a shell - the native 'run a process' interface that the installer uses can't do that. There are ways to work around this, but I think

[issue21338] Silent mode for compileall

2014-04-23 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: Removed file: http://bugs.python.org/file35013/compileall_silent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338

[issue21338] Silent mode for compileall

2014-04-23 Thread Thomas Kluyver
Thomas Kluyver added the comment: Gah, still wrong. Trying again. -- Added file: http://bugs.python.org/file35014/compileall_silent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21338

[issue21338] Silent mode for compileall

2014-04-23 Thread Thomas Kluyver
Thomas Kluyver added the comment: In fact, I will probably end up working around this anyway, because I'll have to support versions of Python without this fix for some time. So I don't feel strongly that it needs to go in, but I will do any revisions or changes requested if people think

[issue16509] sqlite3 docs do not explain check_same_thread

2014-07-16 Thread Thomas Kluyver
Thomas Kluyver added the comment: The module docs do mention Older SQLite versions had issues with sharing connections between threads. Presumably that means that sharing the connection between threads is safe so long as you're not using 'older versions', but it would be nice to have some

[issue16509] sqlite3 docs do not explain check_same_thread

2014-07-16 Thread Thomas Kluyver
Thomas Kluyver added the comment: This page also looks relevant: sqlite can be compiled or used in three different threading modes. Presumably Python compiles/initialises it in the serialised mode, which makes it safe to use a connection from different threads. http://www.sqlite.org

[issue18395] Make _Py_char2wchar() and _Py_wchar2char() public

2014-07-17 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18395 ___ ___ Python-bugs-list

[issue18395] Make _Py_char2wchar() and _Py_wchar2char() public

2014-07-17 Thread Thomas Kluyver
Thomas Kluyver added the comment: You seem to need wchar_t to call Py_Main and Py_SetProgramName. I think there's an example in the docs which is wrong, because it appears to pass a char* to Py_SetProgramName: https://docs.python.org/3.4/extending/embedding.html#very-high-level-embedding

[issue22200] Remove distutils checks for Python version

2014-08-14 Thread Thomas Kluyver
New submission from Thomas Kluyver: We noticed the other day that distutils, despite being part of the standard library, checks the version of Python it's running under and has some different code paths - one of which is only taken for Python 2.2. We haven't managed to figure out why

[issue22200] Remove distutils checks for Python version

2014-08-26 Thread Thomas Kluyver
Thomas Kluyver added the comment: I spotted a few others as well. When I get a bit less busy in a couple of weeks time, I intend to go through and make a bigger patch to clean things up. -- ___ Python tracker rep...@bugs.python.org http

[issue22346] asyncio documentation does not mention provisional status

2014-09-05 Thread Thomas Kluyver
New submission from Thomas Kluyver: From PEP 411: A package will be marked provisional by a notice in its documentation page and its docstring. The following paragraph will be added as a note at the top of the documentation page: The X package has been included in the standard library

[issue22349] Remove more unnecessary version checks from distutils

2014-09-06 Thread Thomas Kluyver
New submission from Thomas Kluyver: Following on from issue 22200, this removes some more code in distutils that checks which Python version it's running on. As part of the standard library, distutils should always be running on the version of Python which it ships with. -- components

[issue22200] Remove distutils checks for Python version

2014-09-06 Thread Thomas Kluyver
Thomas Kluyver added the comment: I've made a patch removing some more of these version checks in issue 22349. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22200

[issue9949] os.path.realpath on Windows does not follow symbolic links

2014-10-01 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9949 ___ ___ Python-bugs-list

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2015-02-04 Thread Thomas Kluyver
New submission from Thomas Kluyver: In tracking down an obscure error we were seeing, we boiled it down to this test case for thread.interrupt_main(): import signal, threading, _thread, time signal.signal(signal.SIGINT, signal.SIG_DFL) # or SIG_IGN def thread_run(): _thread.interrupt_main

[issue23342] run() - unified high-level interface for subprocess

2015-02-02 Thread Thomas Kluyver
Thomas Kluyver added the comment: Third version of the patch (subprocess_run3): - Simplifies the documentation of the trio (call, check_call, check_output) to describe them in terms of the equivalent run() call. - Remove a warning about using PIPE with check_output - I believe

[issue23342] run() - unified high-level interface for subprocess

2015-02-10 Thread Thomas Kluyver
Thomas Kluyver added the comment: Jeff: This makes it somewhat easier to handle input and output as strings instead of streams. Most of the functionality was already there, but this makes it more broadly useful. It doesn't especially address your other points, but I'm not aiming to completely

[issue23342] run() - unified high-level interface for subprocess

2015-01-28 Thread Thomas Kluyver
Thomas Kluyver added the comment: Updated patch following Gregory's suggestions: - The check_returncode parameter is now called check. The method on CompletedProcess is still check_returncode, though. - Clarified the docs about args - CalledProcessError and TimeoutExceeded gain a stdout

[issue23342] run() - unified high-level interface for subprocess

2015-01-28 Thread Thomas Kluyver
New submission from Thomas Kluyver: This follows on from the python-ideas thread starting here: https://mail.python.org/pipermail/python-ideas/2015-January/031479.html subprocess gains: - A CompletedProcess class representing a process that has finished, with attributes args, returncode

[issue23342] run() - unified high-level interface for subprocess

2015-01-28 Thread Thomas Kluyver
Thomas Kluyver added the comment: Another question: With this patch, CalledProcessError and TimeoutExceeded exceptions now have attributes called output and stderr. It would seem less surprising for output to be called stdout, but we can't break existing code that relies on the output

[issue23342] run() - unified high-level interface for subprocess

2015-01-31 Thread Thomas Kluyver
Thomas Kluyver added the comment: Yep, they are pretty much equivalent to those, except: - check_call has a 'return 0' if it succeeds - add '.stdout' to the end of the expression for check_output I'll work on documenting the trio in those terms. If people want, some/all of the trio could also

[issue23342] run() - unified high-level interface for subprocess

2015-02-09 Thread Thomas Kluyver
Thomas Kluyver added the comment: Would anyone like to do further review of this - or commit it ;-) ? I don't think anyone has objected to the concept since I brought it up on python-ideas, but if anyone is -1, please say so. -- ___ Python tracker

[issue23342] run() - unified high-level interface for subprocess

2015-02-09 Thread Thomas Kluyver
Thomas Kluyver added the comment: Aha, I hadn't seen any of those. They had indeed been caught by the spam filter. I'll look over them now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23342

[issue23342] run() - unified high-level interface for subprocess

2015-02-09 Thread Thomas Kluyver
Thomas Kluyver added the comment: Fourth version of patch, responding to review comments on Rietveld. The major changes are: - Eliminated the corner case when passing input=None to run() - now it's a real default parameter. Added a shim in check_output to keep it behaving the old way in case

[issue23682] distutils docs still talk about compatibility with Python 2.2

2015-03-16 Thread Thomas Kluyver
New submission from Thomas Kluyver: I'm pretty sure the distutils docs for Python 3.4 don't need to describe how to make packages compatible with Python 2.2.3. I know that these docs are deprecated in favour of the Python packaging guide, but I still look at them at times

[issue11726] clarify that linecache only works on files that can be decoded successfully

2015-03-16 Thread Thomas Kluyver
Thomas Kluyver added the comment: Anything else I should be doing here? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11726 ___ ___ Python-bugs

[issue23342] run() - unified high-level interface for subprocess

2015-03-19 Thread Thomas Kluyver
Thomas Kluyver added the comment: Thanks, that was an oversight. Patch 5 adds CompletedProcess to __all__. -- Added file: http://bugs.python.org/file38574/subprocess_run5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23735] Readline not adjusting width after resize with 6.3

2015-03-21 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23735 ___ ___ Python-bugs-list

[issue11726] linecache becomes specific to Python scripts in Python 3

2015-03-09 Thread Thomas Kluyver
Thomas Kluyver added the comment: Someone on reddit ran into this, expecting that linecache can be used for an arbitrary text file: http://www.reddit.com/r/Python/comments/2yetxc/utf8_encoding_problems/ I was quite surprised that the docs say allows one to get any line from any file. I've

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-08 Thread Thomas Kluyver
New submission from Thomas Kluyver: Issue #22599 changed tokenize.open() from using builtins.open() to having a module-level reference to _builtin_open, stored by doing _builtin_open = open. However, on reloading the module, _builtin_open is pointed to tokenize.open from the last execution

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-10 Thread Thomas Kluyver
Thomas Kluyver added the comment: Patch attached to fix this. -- keywords: +patch Added file: http://bugs.python.org/file38423/tokenize-reloadable.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23615

[issue11726] clarify that linecache only works on files that can be decoded successfully

2015-03-10 Thread Thomas Kluyver
Thomas Kluyver added the comment: First attempt at describing this attached. -- keywords: +patch Added file: http://bugs.python.org/file38424/linecache-encoding-doc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11726

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-10 Thread Thomas Kluyver
Thomas Kluyver added the comment: -B.patch as Serhiy suggests, for tokenize only for the time being. -- Added file: http://bugs.python.org/file38425/tokenize-reloadable-B.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-10 Thread Thomas Kluyver
Thomas Kluyver added the comment: Fixed the other three cases you pointed out (-B2.patch). -- Added file: http://bugs.python.org/file38426/tokenize-reloadable-B2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23615

[issue23342] run() - unified high-level interface for subprocess

2015-03-02 Thread Thomas Kluyver
Thomas Kluyver added the comment: Is there anything further I should be doing for this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23342

[issue23342] run() - unified high-level interface for subprocess

2015-02-20 Thread Thomas Kluyver
Thomas Kluyver added the comment: Can I interest any of you in further review? I think I have responded to all comments so far. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23342

[issue23342] run() - unified high-level interface for subprocess

2015-04-25 Thread Thomas Kluyver
Thomas Kluyver added the comment: I expect this can be closed now, unless there's some post-commit review somewhere that needs addressing? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23342

[issue23955] Add python.ini file for embedded/applocal installs

2015-04-20 Thread Thomas Kluyver
Thomas Kluyver added the comment: Relative paths would be nice for Pynsist - I would prefer to create the config file at build time and then install it along with the other files. If it needed absolute paths, then the installer would have to write the config file after the user selects

[issue23955] Add python.ini file for embedded/applocal installs

2015-04-20 Thread Thomas Kluyver
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23955 ___ ___ Python-bugs-list

[issue23955] Add python.ini file for embedded/applocal installs

2015-04-27 Thread Thomas Kluyver
Thomas Kluyver added the comment: Would that option be the only thing that needs to be set to make Python app-local? I'm not familiar with what lives in pyvenv.cfg. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23955

[issue16544] Add external link to ast docs

2015-05-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: Here's a simple patch that links to Green Tree Snakes from the ast module docs, using the 'sidebar' directive (that's what the logging module uses to link to tutorials, which seemed analogous). I'm still happy to contribute these docs to CPython if people

[issue23342] run() - unified high-level interface for subprocess

2015-04-14 Thread Thomas Kluyver
Thomas Kluyver added the comment: 6a following in-person review with Gregory: - Reapplied to the updated codebase. - Docs: mention the older functions near the top, because they'll still be important for some time. - Docs: Be explicit that combined stdout/stderr goes in stdout attribute

  1   2   3   >