Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #62219
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <vinay_sajip@yahoo.co.uk> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'patterns': 0.04; 'syntax': 0.04; 'argument': 0.05; 'encoding': 0.05; 'output': 0.05; 'url:bitbucket': 0.05; 'dynamically': 0.07; 'linux,': 0.07; 'memory.': 0.07; 'redirected': 0.07; 'subject:ANN': 0.07; 'tries': 0.07; 'variables': 0.07; 'arguments': 0.09; 'debugger': 0.09; 'facilitates': 0.09; 'logic': 0.09; 'parameter': 0.09; 'parsed': 0.09; 'subset': 0.09; 'windows,': 0.09; 'api': 0.11; 'python': 0.11; 'useful,': 0.14; 'windows': 0.15; '"+"': 0.16; 'behaviour.': 0.16; 'bitbucket': 0.16; 'file).': 0.16; 'internally': 0.16; 'iterating': 0.16; 'pathnames': 0.16; 'pipelines': 0.16; 'quoted': 0.16; 'safely.': 0.16; 'simple.': 0.16; 'spurious': 0.16; 'stderr': 0.16; 'subject:library': 0.16; 'syntax,': 0.16; 'threads.': 0.16; 'travis': 0.16; 'wraps': 0.16; 'prevent': 0.16; 'appropriate': 0.16; '(not': 0.18; 'library': 0.18; 'module': 0.19; 'passing': 0.19; 'command': 0.22; '>>>': 0.22; 'import': 0.22; 'shell': 0.22; 'tests': 0.22; 'cc:addr:python.org': 0.22; 'install': 0.23; 'library,': 0.24; 'string,': 0.24; 'initial': 0.24; 'versions': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; 'equivalent': 0.26; 'handling': 0.26; 'tracker': 0.26; 'pass': 0.26; 'values': 0.27; 'fixed': 0.29; 'skip:- 40': 0.29; 'external': 0.29; 'leave': 0.29; 'subject:) ': 0.29; 'characters': 0.30; 'compared': 0.30; 'relative': 0.30; 'gives': 0.31; 'easier': 0.31; 'lines': 0.31; 'that.': 0.31; '3.2': 0.31; 'closer': 0.31; 'parameters.': 0.31; 'pipe': 0.31; 'post.': 0.31; 'allows': 0.31; 'class': 0.32; 'there.': 0.32; 'run': 0.32; 'up.': 0.33; 'bugs': 0.33; 'mac': 0.33; 'style': 0.33; 'subject: (': 0.35; 'skip:s 30': 0.35; 'convert': 0.35; 'objects': 0.35; 'but': 0.35; 'version': 0.36; '2.6': 0.36; 'interact': 0.36; 'leads': 0.36; 'done': 0.36; 'url:org': 0.36; 'example,': 0.37; 'skip:- 20': 0.37; 'project': 0.37; 'expected': 0.38; 'feedback': 0.38; 'problems': 0.38; 'desirable': 0.38; 'e.g.': 0.38; 'filled': 0.38; 'requiring': 0.38; 'rich': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'skip:- 10': 0.38; 'ability': 0.39; 'does': 0.39; 'hosted': 0.39; 'quote': 0.39; 'reported': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'read': 0.60; 'commands': 0.60; 'received:212.82': 0.60; 'hope': 0.61; 'entire': 0.61; 'information,': 0.61; 'simple': 0.61; 'such': 0.63; 'more': 0.64; 'received:77.238.189': 0.65; 'received:bullet.mail.ird.yahoo.com': 0.65; 'hang': 0.67; 'advantages': 0.68; 'alone.': 0.84; 'attacks.': 0.84; 'captures': 0.84; 'commands.': 0.84; 'cygwin': 0.84; 'features:': 0.84; 'received:212.82.109': 0.84; 'streams': 0.84; 'useful!': 0.84; 'capture': 0.91; 'numerous': 0.93 |
| X-Yahoo-Newman-Property | ymail-3 |
| X-Yahoo-Newman-Id | 535712.70751.bm@omp1038.mail.ird.yahoo.com |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1387301243; bh=kdlwDSKSGEHW+amJXjfZvEMDDMZ+Ijol/wybwDG8Sf0=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=tkMr4+WNqyEXou4UdKbenSAC5e0SU+2nlgUZVE71KzGjqUL2vMJiCLDNusMO/yGKGp54MPf+AC5GSwpFgakVHMA6g1gx0UW/C4pLFts9VLoB2RpiCsOr8pCnel8gRQWKdikq6UAgPBBoL/GTQOO7lwn7jcA0UvD9uHru/gYKByg= |
| DomainKey-Signature | a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=JdW5rBdbIhke4oRUBLfA8M4J0lXNO5hAAvJjhxkh1Xky+ojJxcXF3AutMpRT1iiaRfCnaj4PIIcJ4r6J95Vf4WLDFPUaMExXDykz7Ud12+H/W+f2EuBCiOooY3gXL/9KHW/Lv4iKnh5rRHcbN7BaQoyTjWU4tiXJiQXPU0n+d0E=; |
| X-YMail-OSG | WKMKxmQVM1neLlqTSbc4a4zup8orFxz1KAtiOp6C9koIE.G p5wqe6kmLsTSxXOLuOsCi_n0ORKg4gqHJwlQwtXNrHsU1fMzMia8nrLShz5Q XCAXdGL2LU8XDuPrC.zbDVABPF09R7hiKLlD033h3K_4C0f9YpgmpPdDT_zD 0hxsvh_JodoFTLFrwxuiePRR9HRh3d5yZoeb4EKHcZ0KHx6CiutrRYBgnuvQ aW3X3pBReWGxmvhhvABUf2QvchxJ1CUxAJkyumfFn9zk2G2jPBx4b1vFgg25 9K2YxXNbBhNrD2GiyYb3n8MsAeL_n83jma47HA.FgsjTSXP7hAPZAX4PvkPE Fx6jyChXKNZf0XR0vwCZLY7owCwWz2_.ijkX6dRitsR5Nq3nh24aYZiPHxxc vBiKhDhYg22zk6CNdsjz8aRiquK5PDZ7kTJoTr9jA1Wd5QFJvtigJ00VQXDT GoUyvqbxSNXNDYyuC7Q0ewni2fe1RBAPP_9o.ZUs.UjEs7.Zdc_igAKPW0JM GlMRlOlpqYdFghP5m46u4Qy0mzX7gwZOw.mQfFK2jubo_kThcnhp9N3JdNLh di2ZawnxWY.5lMYIXh8FAN8FjgA5fJnOsK5c8JMasNf2YUWXzVVcdzmLd2pf dgQImI6rF7R6FUN03kzsauGXpP59twqY.vYfdFBLcBy5CI.jvnGPSnDfAbZd D5Zn6hI4H8t9LDe7j51iIl2B2uwl4RfXSqv9TY1W0pyBphK.KAcs4 |
| X-Rocket-MIMEInfo | 002.001, VmVyc2lvbiAwLjEuMiBvZiBTYXJnZSwgYSBjcm9zcy1wbGF0Zm9ybSBsaWJyYXJ5IHdoaWNoIHdyYXBzIHRoZSBzdWJwcm9jZXNzDQptb2R1bGUgaW4gdGhlIHN0YW5kYXJkIGxpYnJhcnksIGhhcyBiZWVuIHJlbGVhc2VkLg0KDQpXaGF0IGNoYW5nZWQ_DQotLS0tLS0tLS0tLS0tDQoNCi0gRml4ZWQgaXNzdWUgIzEyOiBQcmV2ZW50ZWQgYSBoYW5nIHdoaWNoIG9jY3VycmVkIHdoZW4gYSByZWRpcmVjdGlvbiBmYWlsZWQuDQoNCi0gRml4ZWQgaXNzdWUgIzExOiBBZGRlZCAiKyIgdG8gdGhlIGNoYXJhY3RlcnMBMAEBAQE- |
| X-Mailer | YahooMailClassic/379 YahooMailWebService/0.8.170.612 |
| Date | Tue, 17 Dec 2013 17:27:23 +0000 (GMT) |
| From | Vinay Sajip <vinay_sajip@yahoo.co.uk> |
| Subject | ANN: Version 0.1.2 of sarge (a subprocess wrapper library) has been released. |
| To | python-list@python.org |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | quoted-printable |
| Cc | python-announce-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4298.1387301351.18130.python-list@python.org> (permalink) |
| Lines | 131 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1387301351 news.xs4all.nl 2934 [2001:888:2000:d::a6]:58676 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:62219 |
Show key headers only | View raw
Version 0.1.2 of Sarge, a cross-platform library which wraps the subprocess
module in the standard library, has been released.
What changed?
-------------
- Fixed issue #12: Prevented a hang which occurred when a redirection failed.
- Fixed issue #11: Added "+" to the characters allowed in parameters.
- Fixed issue #10: Removed a spurious debugger breakpoint.
- Fixed issue #9: Relative pathnames in redirections are now relative to the
current working directory for the redirected process.
- Added the ability to pass objects with "fileno()" methods as values
to the "input" argument of "run()", and a "Feeder" class which
facilitates passing data to child processes dynamically over time (rather
than just an initial string, byte-string or file).
- Added functionality under Windows to use PATH, PATHEXT and the
registry to find appropriate commands. This can e.g. convert a
command 'foo bar', if 'foo.py' is a Python script in the
c:\Tools directory which is on the path, to the equivalent
'c:\Python26\Python.exe c:\Tools\foo.py bar'. This is done internally
when a command is parsed, before it is passed to subprocess.
- Fixed issue #7: Corrected handling of whitespace and redirections.
- Fixed issue #8: Added a missing import.
- Added Travis integration.
- Added encoding parameter to the "Capture" initializer.
- Fixed issue #6: addressed bugs in Capture logic so that iterating over
captures is closer to subprocess behaviour.
- Tests added to cover added functionality and reported issues.
- Numerous documentation updates.
What does Sarge do?
-------------------
Sarge tries to make interfacing with external programs from your
Python applications easier than just using subprocess alone.
Sarge offers the following features:
* A simple way to run command lines which allows a rich subset of Bash-
style shell command syntax, but parsed and run by sarge so that you
can run on Windows without cygwin (subject to having those commands
available):
>>> from sarge import capture_stdout
>>> p = capture_stdout('echo foo | cat; echo bar')
>>> for line in p.stdout: print(repr(line))
...
'foo\n'
'bar\n'
* The ability to format shell commands with placeholders, such that
variables are quoted to prevent shell injection attacks.
* The ability to capture output streams without requiring you to
program your own threads. You just use a Capture object and then you
can read from it as and when you want.
* The ability to look for patterns in captured output and to interact
accordingly with the child process.
Advantages over subprocess
---------------------------
Sarge offers the following benefits compared to using subprocess:
* The API is very simple.
* It's easier to use command pipelines - using subprocess out of the
box often leads to deadlocks because pipe buffers get filled up.
* It would be nice to use Bash-style pipe syntax on Windows, but
Windows shells don't support some of the syntax which is useful, like
&&, ||, |& and so on. Sarge gives you that functionality on Windows,
without cygwin.
* Sometimes, subprocess.Popen.communicate() is not flexible enough for
one's needs - for example, when one needs to process output a line at
a time without buffering the entire output in memory.
* It's desirable to avoid shell injection problems by having the
ability to quote command arguments safely.
* subprocess allows you to let stderr be the same as stdout, but not
the other way around - and sometimes, you need to do that.
Python version and platform compatibility
-----------------------------------------
Sarge is intended to be used on any Python version >= 2.6 and is
tested on Python versions 2.6, 2.7, 3.1, 3.2 and 3.3 on Linux,
Windows, and Mac OS X (not all versions are tested on all platforms,
but sarge is expected to work correctly on all these versions on all
these platforms).
Finding out more
----------------
You can read the documentation at
http://sarge.readthedocs.org/
There's a lot more information, with examples, than I can put into
this post.
You can install Sarge using "pip install sarge" to try it out. The
project is hosted on BitBucket at
https://bitbucket.org/vinay.sajip/sarge/
And you can leave feedback on the issue tracker there.
I hope you find Sarge useful!
Regards,
Vinay Sajip
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
ANN: Version 0.1.2 of sarge (a subprocess wrapper library) has been released. Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2013-12-17 17:27 +0000
csiph-web