[issue1764407] The -m switch does not use the builtin __main__ module

2007-08-25 Thread Nick Coghlan
Nick Coghlan added the comment: Fixed committed to SVN as r57461 -- resolution: -> fixed status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue1056] test_cmd_line starts python without -E

2007-09-11 Thread Nick Coghlan
Nick Coghlan added the comment: Fixed for 2.6 in rev 58103 (Is the head still being merged to the py3k branch? Or does this need to be forward-ported manually?) -- nosy: +ncoghlan resolution: -> fixed status: open -> closed __ Tracker <[EMAIL

[issue1739468] Add a -z interpreter flag to execute a zip file

2007-09-11 Thread Nick Coghlan
Nick Coghlan added the comment: I like PJE's approach, and the patch works for me. About the only thing I'd change is to switch the expression in PyImport_GetImporter to a simple chain of if-statements in order to: - silence the warning from GCC about an unused value - make it mo

[issue1705170] contextmanager eats StopIteration

2007-11-02 Thread Nick Coghlan
Changes by Nick Coghlan: -- assignee: -> ncoghlan _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1705170> _ ___ Python-bugs-list mailing li

[issue1705170] contextmanager eats StopIteration

2007-11-02 Thread Nick Coghlan
Nick Coghlan added the comment: Fixed for 2.6 in rev 58766. I'm not sure if it will be possible to get this into 2.5.2. Leaving open against 2.5 until it is checked in on the maintenance branch. -- components: +Library (Lib) -None resolution: -> accepted versions: +Py

[issue1705170] contextmanager eats StopIteration

2007-11-02 Thread Nick Coghlan
Nick Coghlan added the comment: Close, but not quite. The problem is that the 'value' argument may be None if instantiation of the exception hasn't been forced before __exit__ gets called. >>> class TestWith(object): ... def __enter__(self): ... pass ... def

[issue1291] test_resource fails on recent linux systems (

2007-11-07 Thread Nick Coghlan
Nick Coghlan added the comment: I just hit this as well when rerunning the 2.5 tests before checking something else in. The test itself appears to be fine, but the call to f.close() outside the try/except block attempting to flush the file to disk and raising an IOError. Didn't something

[issue1705170] contextmanager eats StopIteration

2007-11-07 Thread Nick Coghlan
Nick Coghlan added the comment: Done in rev 58901 -- resolution: accepted -> fixed status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue1291] test_resource fails on recent linux systems (

2007-11-07 Thread Nick Coghlan
Nick Coghlan added the comment: I just compared the 2.5 test_resource with the trunk test_resource - the latter has been modified to remove the file size limitation before it attempts to close the file, eliminating the test failure without changing the underlying behaviour of f.close

[issue1739468] Add a -z interpreter flag to execute a zip file

2007-11-17 Thread Nick Coghlan
Nick Coghlan added the comment: Attached an updated version of PJE's patch with the suggested cleanups and a new unit test file (test_cmd_line_script.py). Finding the roundtuits to finish the latter is actually what has taken me so long. The basic tests and the directory tests are curr

[issue1739468] Add a -z interpreter flag to execute a zip file

2007-11-18 Thread Nick Coghlan
Nick Coghlan added the comment: I worked out what was wrong with my unit tests (I was incorrectly including the path information when adding the test script to the zipfile) I've updated the patch here, and will be committing the change once the test suite finishes running. -- ver

[issue1739468] Add a -z interpreter flag to execute a zip file

2007-11-18 Thread Nick Coghlan
Nick Coghlan added the comment: Committed as rev 59039 (now to see how the buildbots react for other platforms...) -- resolution: -> accepted status: open -> closed _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue1739468] Add a -z interpreter flag to execute a zip file

2007-11-19 Thread Nick Coghlan
Nick Coghlan added the comment: Reverted status to open until I figure out why the tests are failing on the Mac OSX buildbot. -- resolution: accepted -> status: closed -> open _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue1487] PEP 366 implementation

2007-11-22 Thread Nick Coghlan
New submission from Nick Coghlan: Patch to implement PEP 366. Note that it doesn't implement precisely the semantics described in the version of the PEP posted in July, as some of those ideas didn't prove feasible due to the fact that imp.new_module can't tell the difference

[issue11715] Building Python on multiarch Debian and Ubuntu

2011-09-12 Thread Nick Coghlan
Nick Coghlan added the comment: It wouldn't surprise me at all if the laptop's links were a little off - I started with a Kubuntu image off VMWare's site quite some time ago, then dist-upgraded it through a couple of releases a

[issue6560] socket sendmsg(), recvmsg() methods

2011-09-12 Thread Nick Coghlan
Nick Coghlan added the comment: The feature patch for sendmsg/recvmsg support came with a swathe of new tests, and the failures are in those new tests rather than anything breaking in the old ones. As Charles-François noted though, it doesn't look like the feature implementation itse

[issue12958] test_socket failures on Mac OS X

2011-09-18 Thread Nick Coghlan
Nick Coghlan added the comment: OK, I've now looked into *why* the socket tests are throwing errors in tearDown, and it has to do with the way the threaded client/server tests in test_socket are set up. Specifically, ThreadableTest uses tearDown to reraise any exception raised in the c

[issue1294232] Error in metaclass search order

2011-09-18 Thread Nick Coghlan
Nick Coghlan added the comment: Looking at Daniel's updated patch is still on my to-do list, but I won't object if anyone else wants to take this forward (it will be at least a few weeks before I get to it). -- ___ Python trac

[issue12958] test_socket failures on Mac OS X

2011-09-18 Thread Nick Coghlan
Nick Coghlan added the comment: OK, I'll just deal with the problem directly in test_socket then. It looks like my latest attempt (suppressing unittest._ExpectedFailure in test_socket.ThreadableTest.clientRun) did the trick, so I'll push the updated tests some time this eve

[issue10548] Error in setUp not reported as expectedFailure (unittest)

2011-09-18 Thread Nick Coghlan
Nick Coghlan added the comment: As another data point, this question came up again in the context of issue #12958. The new test_socket.ThreadableTest uses tearDown() to pick up and reraise any exception that occurred in the client thread. This meant that my initial attempts at flagging some

[issue13004] pprint: add option to truncate sequences

2011-09-20 Thread Nick Coghlan
Changes by Nick Coghlan : -- dependencies: +general pprint rewrite ___ Python tracker <http://bugs.python.org/issue13004> ___ ___ Python-bugs-list mailin

[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file22616/pep380-missing-docs.diff ___ Python tracker <http://bugs.python.org/issue11682> ___ ___ Python-bug

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

2011-09-20 Thread Nick Coghlan
Nick Coghlan added the comment: Attached patch should now be complete, including the documentation for the new keyword-only 'file' parameter on various dis module functions. -- Added file: http://bugs.python.org/file23197/issue11816_get_opinfo_branch_201

[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Nick Coghlan
Changes by Nick Coghlan : Added file: http://bugs.python.org/file22616/pep380-missing-docs.diff ___ Python tracker <http://bugs.python.org/issue11682> ___ ___ Python-bug

[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Nick Coghlan
Nick Coghlan added the comment: I have updated the bitbucket repo with changes to address most of Benjamin's review comments. A few points of note: - I agree in principle with the idea of splitting Yield and YieldFrom into distinct AST nodes, but I'd prefer to focus on getting t

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

2011-09-21 Thread Nick Coghlan
Nick Coghlan added the comment: 'Op' is just an abbreviation of 'operation'. So 'operation code' becomes 'opcode' and 'operation information' becomes 'opinfo'. The fact that it comes for the 'dis' module gives the context t

[issue13062] Introspection generator and function closure state

2011-09-29 Thread Nick Coghlan
New submission from Nick Coghlan : Based on the python-ideas thread about closures, I realised there are two features the inspect module could offer to greatly simplify some aspects of testing closure and generator behaviour: inspect.getclosure(func) Returns a dictionary mapping closure

[issue13062] Introspection generator and function closure state

2011-09-29 Thread Nick Coghlan
Nick Coghlan added the comment: Yep, that looks right to me. The eval loop then references those cells from the frame object during execution. -- ___ Python tracker <http://bugs.python.org/issue13

[issue13062] Introspection generator and function closure state

2011-09-29 Thread Nick Coghlan
Nick Coghlan added the comment: Huh, I didn't actually realise getclosure() could be written as a one liner until seeing Meador's version above: {var : cell.cell_contents for var, cell in zip(func.__code__.co_freevars, func._

[issue13075] PEP-0001 contains dead links

2011-09-30 Thread Nick Coghlan
Nick Coghlan added the comment: These pages are all still on python.org - the links just need to be updated to point to the devguide equivalents (under http://docs.python.org/devguide) -- nosy: +ncoghlan ___ Python tracker <http://bugs.python.

[issue13053] Add Capsule migration documentation to "cporting"

2011-10-02 Thread Nick Coghlan
Nick Coghlan added the comment: Mostly looks good - couple of minor comments in Reitveld. As far as the patch flow goes, the 2.x and 3.x branches are actually handled independently (they're too divergent for merging to make sense). So 2.7 and 3.2 will be independent commits, then the ch

[issue13062] Introspection generator and function closure state

2011-10-02 Thread Nick Coghlan
Nick Coghlan added the comment: Because a generator can legitimately have no locals: >>> def gen(): ... yield 1 ... >>> g = gen() >>> g.gi_frame.f_locals {} Errors should be reported as exceptions - AttributeError or TypeError if there's no gi_frame and

[issue13062] Introspection generator and function closure state

2011-10-02 Thread Nick Coghlan
Nick Coghlan added the comment: The function case is simpler - AttributeError or TypeError if there's no __closure__ attribute, empty mapping if there's no closure. I've also changed my mind on the "no frame" generator case - since that mapping will evolve over time

[issue7689] Pickling of classes with a metaclass and copy_reg

2011-10-04 Thread Nick Coghlan
Nick Coghlan added the comment: Specifically, 2.7.3. A date for that has not yet been set, but somewhere in the December/January time frame is likely. -- ___ Python tracker <http://bugs.python.org/issue7

[issue13101] Module Doc viewer closes when browser window closes on Windows 8

2011-10-04 Thread Nick Coghlan
Nick Coghlan added the comment: If that's the app I think it is (pydoc -g), we're probably going to kill it off in 3.3 in favour of the -b option. -- nosy: +ncoghlan ___ Python tracker <http://bugs.python.o

[issue13101] Module Doc viewer closes when browser window closes on Windows 8

2011-10-04 Thread Nick Coghlan
Nick Coghlan added the comment: Slight correction, pydoc.gui() is already gone in current hg tip. However, this error may be indicative of an underlying problem with webbrowser.open(url) throwing an exception. -- ___ Python tracker <h

[issue13105] Please elaborate on how 2.x and 3.x are different heads

2011-10-06 Thread Nick Coghlan
Nick Coghlan added the comment: This was from memory, so don't take it as gospel as far as the current security-fix-only branches go, but here's what I sent to Larry: - We maintain two independent heads in hg: 2.7 and default 3.2 is open for general bugfixes 2.5 (

[issue12602] Missing using docs cross-references

2011-10-07 Thread Nick Coghlan
Nick Coghlan added the comment: The 'using docs' are, oddly enough, the part of the docs called 'using' :) In particular, the part about the command line components (including the '

[issue8087] Unupdated source file in traceback

2011-10-10 Thread Nick Coghlan
Nick Coghlan added the comment: (just reviewing the idea here, not the current patch) The problem of "stale code" (i.e. what was executed doesn't match what is displayed in the traceback) is a tricky and subtle one. There are a few different cases: 1. Source displayed does n

[issue13062] Introspection generator and function closure state

2011-10-10 Thread Nick Coghlan
Nick Coghlan added the comment: No, the naming problem had occurred to me as well. Given the 'vars' builtin, perhaps 'getclosurevars' would do as the name? -- ___ Python tracker <http://bug

[issue13062] Introspection generator and function closure state

2011-10-10 Thread Nick Coghlan
Nick Coghlan added the comment: In reviewing Meador's patch (which otherwise looks pretty good), I had a thought about the functionality and signature of getclosurevars(). Currently, it equates "closure" to "nonlocal scope", which isn't really true - the fu

[issue12602] Missing cross-references in Doc/using

2011-10-10 Thread Nick Coghlan
Nick Coghlan added the comment: Don't feel bad about not recognising the context - this stuff wasn't documented at all for a long time, and it wasn't until Georg pointed me to the usage docs that I realised adding it there would be the right place. I should have remembered tha

[issue13187] relative imports don't work when circular

2011-10-15 Thread Nick Coghlan
Nick Coghlan added the comment: This is the same problem that all "from x import y" circular imports have - it isn't specific to relative imports. Closing as a duplicate of issue 992389 -- resolution: -> duplicate status: open -> closed superseder: -> attrib

[issue992389] attribute error due to circular import

2011-10-15 Thread Nick Coghlan
Nick Coghlan added the comment: Changed the issue title to state clearly that the core issue is with circular imports that attempt to reference module contents at import time, regardless of the syntactic form used. All of the following module level code can fail due to this problem

[issue415492] Compiler generates relative filenames

2011-10-16 Thread Nick Coghlan
Nick Coghlan added the comment: It's fairly easy to check this is still a problem: $ ./python Python 3.3.0a0 (default:a06ef7ab7321, Sep 22 2011, 13:41:29) [GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux Type "help", "copyright", "credits" or "license

[issue8060] PEP 3101 string formatting missing engineering presentation type for floating point

2011-10-17 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +ncoghlan ___ Python tracker <http://bugs.python.org/issue8060> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2011-10-19 Thread Nick Coghlan
Nick Coghlan added the comment: They were removed because adding new methods to builtin types violated the language moratorium. Now that the language moratorium is over, the transform/untransform convenience APIs should be added again for 3.3. It's an approved change, the original t

[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2011-10-19 Thread Nick Coghlan
Nick Coghlan added the comment: Sorry, I meant to state my rationale for the unassignment - I'm assuming this issue is covered by MAL's recent decision to step away from Unicode and codec maintenance issues. If that's incorrect, MAL can reclaim the issue, otherwise unassigning

[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2011-10-19 Thread Nick Coghlan
Nick Coghlan added the comment: Some further comments after getting back up to speed with the actual status of this problem (i.e. that we had issues with the error checking and reporting in the original 3.2 commit). 1. I agree with the position that the codecs module itself is intended to be

[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2011-10-19 Thread Nick Coghlan
Nick Coghlan added the comment: Oops, typo in my second error example. The command should be: b'a'.decode('rot_13') (Since str objects don't offer a decode() method any more) -- ___ Python tracker <http

[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2011-10-19 Thread Nick Coghlan
Nick Coghlan added the comment: On Thu, Oct 20, 2011 at 8:34 AM, STINNER Victor wrote: >> str.transform('bz2') ==> CodecLookupError > > A lookup error is surprising here. It may be a TypeError instead. The bz2 can > be used with .transform, but not on str. So:

[issue13227] Option to make the lru_cache type specific

2011-10-19 Thread Nick Coghlan
Nick Coghlan added the comment: Features looks good, but the current patch doesn't handle keyword arguments correctly (more details in the Reitveld review). -- nosy: +ncoghlan ___ Python tracker <http://bugs.python.org/is

[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2011-10-19 Thread Nick Coghlan
Nick Coghlan added the comment: I'm fine with people needing to drop down to the lower level lookup() API if they want the filtering functionality in Python code. For most purposes, constraining the expected codec input and output formats really isn't a major issue - we just need

[issue13229] Add shutil.filter_walk

2011-10-19 Thread Nick Coghlan
New submission from Nick Coghlan : I needed a depth-limited, filtered search of a directory tree recently and came up with the following wrapper around os.walk that brings in a few niceties like glob-style filtering, depth limiting and symlink traversal that is safe from infinite loops. It

[issue13227] Option to make the lru_cache type specific

2011-10-19 Thread Nick Coghlan
Nick Coghlan added the comment: Looks good to me (although it took me longer than it should have to figure out why you didn't need to store the keyword argument names a second time) -- ___ Python tracker <http://bugs.python.org/is

[issue13237] subprocess docs should use emphasise convenience functions

2011-10-20 Thread Nick Coghlan
New submission from Nick Coghlan : Many typical subprocess use cases can now be handled simply via the convenience functions: subprocess.call() subprocess.check_call() subprocess.check_output() However, readers of the documentation could be forgiven for not realising that, since the

[issue13238] Add shell command helpers to shutil module

2011-10-20 Thread Nick Coghlan
New submission from Nick Coghlan : I've been doing a few systems administration tasks with Python recently, and shell command invocation directly via the subprocess module is annoyingly clunky (even with the new convenience APIs). Since subprocess needs to avoid the shell by defaul

[issue13237] subprocess docs should emphasise convenience functions

2011-10-20 Thread Nick Coghlan
Changes by Nick Coghlan : -- title: subprocess docs should use emphasise convenience functions -> subprocess docs should emphasise convenience functions ___ Python tracker <http://bugs.python.org/issu

[issue13238] Add shell command helpers to shutil module

2011-10-20 Thread Nick Coghlan
Nick Coghlan added the comment: And that's exactly the problem - a web developer's or security auditor's "shell injection" is a system administrator's "this language sucks". These wrappers are the kind of thing you want for shell invocations when us

[issue13238] Add shell command helpers to shutil module

2011-10-20 Thread Nick Coghlan
Nick Coghlan added the comment: Perhaps a better idea would be to use different names, so it's clearer at the point of invocation that the shell is being invoked (and hence shell injection attacks are a potential concern). For example: shell_call check_shell_call check_shell_o

[issue13238] Add shell command helpers to shutil module

2011-10-21 Thread Nick Coghlan
Nick Coghlan added the comment: Of the 3 available options (mod style, string.Template and str.format), yes, str.format is the best choice. If people want the shell meaning of the braces, they can escape them by doubling them up in the command string

[issue13238] Add shell command helpers to shutil module

2011-10-21 Thread Nick Coghlan
Nick Coghlan added the comment: Initially, because I was suggesting the names shadow the subprocess convenience functions so they *had* to live in a different namespace. However, even after changing the names to explicitly include "shell", I'd like to keep them away f

[issue13237] subprocess docs should emphasise convenience functions

2011-10-21 Thread Nick Coghlan
Nick Coghlan added the comment: You couldn't just move them - you'd need to change the wording of how they cross-link to each other, since the explanations of the convenience function currently assume you understand how Popen works. I'd like us to get to the point where y

[issue13238] Add shell command helpers to shutil module

2011-10-21 Thread Nick Coghlan
Nick Coghlan added the comment: It's a flow thing. This idea was kicked off by the process of translating a large Perl script to Python and paying attention to what the translation made *worse*. One of the big things it made worse was the translation of "qx" (quoted executab

[issue13238] Add shell command helpers to shutil module

2011-10-21 Thread Nick Coghlan
Nick Coghlan added the comment: That's a fair point, but I think it actually *improves* the argument for better helper functions, since we can have them automatically invoke shlex.quote() on all of the arguments: def _shell_format(cmd, args, kwds): args = map(shlex.quote,

[issue13105] Please elaborate on how 2.x and 3.x are different heads

2011-10-23 Thread Nick Coghlan
Nick Coghlan added the comment: The devguide actually did align with what I said in my email, but this wasn't clear if you only read the "Forward Porting" section (you had to read the "Porting Between Major Versions" section further down the page as well). I add

[issue1294232] Error in metaclass search order

2011-10-23 Thread Nick Coghlan
Nick Coghlan added the comment: Fix has been applied to 3.x and hence will be in 3.3 and the next 3.2 release. I have adjusted the issue metadata to reflect the fact 2,7 still exhibits the problem, but the patch requires significant work to account for the 3.x vs 2.x changes in class

[issue13252] new decumulate() function in itertools module

2011-10-24 Thread Nick Coghlan
Nick Coghlan added the comment: OK, looking at the code I realised what you're trying to get at is the idea of reporting the differences between values in a series, such that: x = list(accumulate(seq)) assert x == list(accumulate(differences(x))) I don't think the use cases ar

[issue13238] Add shell command helpers to shutil module

2011-10-24 Thread Nick Coghlan
Nick Coghlan added the comment: Unfortunately, I don't think including implicit shlex.quote() calls is going to have the effect I was originally looking for: >>> subprocess.call("du -hs ../py*", shell=True) 593M../py3k 577M../py3k_pristine 479M../python27

[issue13237] subprocess docs should emphasise convenience functions

2011-10-24 Thread Nick Coghlan
Nick Coghlan added the comment: I'm reasonably happy with the changes I just checked in, but rather than doing multiple forward ports, my plan is to let them settle for a while, update them based on any feedback I get, then incorporate the final version into the 3.x s

[issue13237] subprocess docs should emphasise convenience functions

2011-10-24 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: docs@python -> ncoghlan ___ Python tracker <http://bugs.python.org/issue13237> ___ ___ Python-bugs-list mailing list Un

[issue13238] Add shell command helpers to shutil module

2011-10-25 Thread Nick Coghlan
Nick Coghlan added the comment: Considering this further, I've realised that the idea of implicit quoting for this style of helper function is misguided on another level - the parameters to be interpolated may not even be strings yet, so attempting to quote them would

[issue10197] subprocess.getoutput fails on win32

2011-10-25 Thread Nick Coghlan
Nick Coghlan added the comment: Without knowing this issue existed, I recently started working on adding some convenience APIs for shell invocation to shutil: http://bugs.python.org/issue13238 I think the getstatus and getstatusoutput APIs were copied from the commands module in 3.0 without

[issue13238] Add shell command helpers to shutil module

2011-10-25 Thread Nick Coghlan
Nick Coghlan added the comment: I discovered a couple of APIs that were moved from the commands module to the subprocess module in 3.0: http://docs.python.org/dev/library/subprocess#subprocess.getstatusoutput However, they have issues, especially on Windows: http://bugs.python.org/issue10197

[issue13238] Add shell command helpers to shutil module

2011-10-25 Thread Nick Coghlan
Nick Coghlan added the comment: After a bit of thought, I realised I could use the string.Formatter API to implement a custom formatter for the shell command helpers that auto-escapes whitespace while leaving the other shell metacharacters alone (so you can still interpolate paths containing

[issue13266] Support for unwrapping __wrapped__ functions in 'inspect' module

2011-10-25 Thread Nick Coghlan
New submission from Nick Coghlan : I just got bitten by the singularly unhelpful results of doing inspect.getsource(generator_context_manager). Now that @functools.wraps adds the __wrapped__ attribute, perhaps inspect.getsource(f) should follow the wrapper chain by default? This would affect

[issue13266] Add inspect.unwrap(f) to easily unravel "__wrapped__" chains

2011-10-25 Thread Nick Coghlan
Nick Coghlan added the comment: After a little thought, I think the explicit "unwrap" function is the only viable approach. Doing the unwrapping implicitly just has too many nasty corner cases to track down to ensure we aren't losing existing functionality. I'd also s

[issue13267] Add an option to disable importing orphaned bytecode files

2011-10-26 Thread Nick Coghlan
Nick Coghlan added the comment: This feature is unnecessary now that PEP 3147 has been adopted. The way it works in 3.2+ is that orphaned bytecode files inside __pycache__ are always ignored, while bytecode files that live directly in the source directories are always imported. This handles

[issue13237] subprocess docs should emphasise convenience functions

2011-10-26 Thread Nick Coghlan
Nick Coghlan added the comment: Absent any further feedback, I think I'm done with the changes to the 2.7 subprocess docs. I'll let them sit for a few days, then do the forward port to 3.2 and default. There are a couple of additional changes I'll add to the 3.x vers

[issue13237] subprocess docs should emphasise convenience functions

2011-10-26 Thread Nick Coghlan
Nick Coghlan added the comment: That's deliberate, as I'm only showing a selected subset of the full signature at that point and using the subprocess API's with positional arguments would lead to almost incomprehensible code. I'm not in any great hurry to forward port tho

[issue13237] subprocess docs should emphasise convenience functions

2011-10-27 Thread Nick Coghlan
Nick Coghlan added the comment: We can only protect people from themselves so much - "shell=True" is invaluable when you actually want to invoke the shell, and the shell has much better tools for process invocation and pipeline processing than Python does (since shells are, in effe

[issue13237] subprocess docs should emphasise convenience functions

2011-10-27 Thread Nick Coghlan
Nick Coghlan added the comment: As the last checkin message says, I've made the documentation for the helper functions more self-contained. Each now has its own short "shell=True" warning with a pointer to the full explanation in the shared parameter description. There was

[issue13238] Add shell command helpers to shutil module

2011-10-28 Thread Nick Coghlan
Nick Coghlan added the comment: I realised I could use the convert_field() option in the custom formatter to choose between several interpolation quoting options: default - str + shutil.quote_ascii_whitespace !q - str + shlex.quote !u - unquoted (i.e. no conversion, str.format default

[issue13238] Add shell command helpers to shutil module

2011-10-28 Thread Nick Coghlan
Nick Coghlan added the comment: Some examples: >>> import shutil >>> shutil.shell_call("du -hs {}", "../py*") 594M../py3k 579M../py3k_pristine 480M../python27 301M../python31 382M../python32 288K../python_swallowed_whole 0 >&

[issue13238] Add shell command helpers to shutil module

2011-10-28 Thread Nick Coghlan
Nick Coghlan added the comment: The first version I wrote *did* automatically invoke shlex.quote on all interpolated values, but that breaks wildcard handling. You can see that in the examples I posted above. With the default whitespace escaping (which allows spaces in filenames), wildcard

[issue13238] Add shell command helpers to shutil module

2011-10-29 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I was thinking about this a bit more and realised that I'd rejected the "quote everything by default" approach before I had the idea of providing a custom conversion specifier to disable the implicit string conversion and quoting. So p

[issue13298] Result type depends on order of operands for bytes and bytearray

2011-10-30 Thread Nick Coghlan
New submission from Nick Coghlan : In a recent python-ideas discussion of the differences between concatenation and augmented assignment on lists, I pointed out the general guiding principle behind Python's binary operation semantics was that the type of a binary operation should not d

[issue13299] namedtuple row factory for sqlite3

2011-10-30 Thread Nick Coghlan
New submission from Nick Coghlan : Currently, sqlite3 allows rows to be easily returned as ordinary tuples (default) or sqlite3.Row objects (which allow dict-style access). collections.namedtuple provides a much nicer interface than sqlite3.Row for accessing ordered data which uses valid

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

2011-10-31 Thread Nick Coghlan
Nick Coghlan added the comment: Bitbucket repo and attached patch updated relative to current tip. -- Added file: http://bugs.python.org/file23569/issue11816_get_opinfo_branch_20111031.diff ___ Python tracker <http://bugs.python.org/issue11

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

2011-10-31 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file23197/issue11816_get_opinfo_branch_20110920.diff ___ Python tracker <http://bugs.python.org/issue11

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

2011-10-31 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file23095/issue11816_get_opinfo_branch_20110904.diff ___ Python tracker <http://bugs.python.org/issue11

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

2011-10-31 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file23019/issue11816_get_opinfo_branch_20110824.diff ___ Python tracker <http://bugs.python.org/issue11

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

2011-10-31 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file21599/dis.patch ___ Python tracker <http://bugs.python.org/issue11816> ___ ___ Python-bugs-list mailin

[issue11682] PEP 380 reference implementation for 3.3

2011-10-31 Thread Nick Coghlan
Nick Coghlan added the comment: Bitbucket repo and attached patch updated relative to latest get_opinfo branch (which in turn was updated to apply cleanly against current CPython tip). (I still need to incorporate the doc updates and look into adding keyword argument support

[issue11682] PEP 380 reference implementation for 3.3

2011-10-31 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file22616/pep380-missing-docs.diff ___ Python tracker <http://bugs.python.org/issue11682> ___ ___ Python-bug

[issue11682] PEP 380 reference implementation for 3.3

2011-10-31 Thread Nick Coghlan
Changes by Nick Coghlan : Removed file: http://bugs.python.org/file23096/issue11682_pep380_branch_20110904.diff ___ Python tracker <http://bugs.python.org/issue11

[issue13306] Add diagnostic tools to importlib?

2011-10-31 Thread Nick Coghlan
New submission from Nick Coghlan : In discussing the module aliasing PEP on python-ideas, it occurred to me that we could potentially add some useful "sanity check" utilities to an "importlib.diagnostics" subpackage. For example: - scan sys.path looking for entries that

[issue13298] Result type depends on order of operands for bytes and bytearray

2011-11-03 Thread Nick Coghlan
Nick Coghlan added the comment: We can just use this one - it was more in the nature of a question "is there anything we want to change about the status quo?" than a request for any specific change. I'm actually OK with buffer API based interoperability, but if we're goin

[issue13229] Add shutil.filter_walk

2011-11-05 Thread Nick Coghlan
Nick Coghlan added the comment: I should probably update that posted recipe to my latest version (which adds "excluded_files" and "excluded_dirs" parameters). However, since I've been dealing with remote filesystems where os.listdir() and os.stat() calls from

[issue13229] Add shutil.filter_walk

2011-11-05 Thread Nick Coghlan
Nick Coghlan added the comment: This needs more thought - pypi package coming soon :) -- ___ Python tracker <http://bugs.python.org/issue13229> ___ ___ Python-bug

  1   2   3   4   5   6   7   8   9   10   >