Commit graph

11 commits

Author SHA1 Message Date
James Cammarata
b75f305079 Ensure async wrapper and status return consistent fields 2016-07-07 13:41:50 -05:00
David Shrewsbury
4e239f6ce0 Use os.rename() in async_wrapper
Because the async_status module will read from the same file that
the async_wrapper module is writing, it's possible that the file
may not be fully synced during a read, causing spurious failures.
Use a temp file to do an atomic operation on the file. We can't
use atomic_move() here as that doesn't work properly under async.

Also, let's not read concurrently from the same file the subprocess
is writing to. Instead, capture stdout/stderr via PIPE and write to
the file to avoid nasty races.
2016-06-29 09:53:47 -04:00
Brian Coca
a1e6311197 reverted need for module utils imports 2016-06-16 18:12:38 -04:00
Brian Coca
ab4ec24813 added missing import
readded raise
2016-06-16 15:55:45 -04:00
Brian Coca
4a0c483e09 exception ans sys.exit fixes 2016-06-16 15:27:37 -04:00
Toshio Kuratomi
f9b28aaae3 Fix exception handling in async_wrapper 2016-06-16 12:21:57 -07:00
Brano Zarnovican
3456c24b96 Py2.4: SystemExit in async_wrapper is not an error - compatibility fix
Prior to Python 2.5, SystemExit was a subclass of Exception.
In Py2.4, this is causing extra error output on valid sys.exit(0).

(Toshio) Call sys.exit from inside of the SystemExit exception handler so py2.4 and py2.5+ behaviour matches
2016-06-15 10:28:09 -07:00
codemeup @ Work
1e0bb94ced Fixing compile time errors irt (, e => as e, print(), ocat now 0o not 0) exception handling for Python 3 (#3851)
* Fixing compile time errors irt a) exception handling for Python 3 in util, also: b) problem octal usage (fixed) and c) print json_dump -> print(json_dump(xyz) ... et al

* This code was not Python 2.4 compliant. Octal codes and exception handling is now working with Py 2.4, 2.6, & 3.5.

* Fixing formating (or rather reverting an non 2.4 compatible change). Works in compile & runtime checking.

* a) revert to use print sys.stderr not fail_json; b) fixed var name in exception

* Python 3 compatible print (print >>sys.stderr will generate a TypeError - now uses sys.stderr.write instead).
2016-06-13 11:40:13 -07:00
Toshio Kuratomi
6e5b09f3a8 Allow async to not need an args file since new-style modules have args embedded 2016-04-01 19:50:58 -07:00
Brian Coca
d192e2c3e3 code cleanup and reoorg, renamed vars and functions to actual purpose
reneabled logging of steps
2015-10-31 21:35:48 -04:00
Michael DeHaan
cec519f70e Move internal category to utilities to remove one more category from the left hand menu, keeping it concise. 2014-11-04 17:47:07 -05:00
Renamed from internal/async_wrapper.py (Browse further)