search for: _run_code

Displaying 12 results from an estimated 12 matches for "_run_code".

Did you mean: _run_cmd
2019 Aug 13
2
Re: [PATCH libnbd 5/6] generator: Implement OClosure.
On 8/13/19 5:06 AM, Richard W.M. Jones wrote: > An optional Closure parameter, but otherwise works the same way as > Closure. > @@ -3778,6 +3777,7 @@ let generate_lib_api_c () = > ) args; > List.iter ( > function > + | OClosure { cbname } -> pr ", %s_callback ? \"<fun>\" : \"NULL\"" cbname Well, it also permits a
2019 Jun 28
3
[PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
Following Eric's suggestions from v2, this adds .string, .errno and .__str__ properties. The .string property returns the error string. The .errno property returns the errno (from the errno module), or None. The __str__ property makes the exception nicely printable. Rich.
2019 Jun 28
2
Re: [PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
...or example: > > $ ./run nbdsh -c 'h.pread(0, 0)' > Traceback (most recent call last): > File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main > "__main__", mod_spec) > File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code > exec(code, run_globals) > File "/home/rjones/d/libnbd/python/nbd.py", line 1163, in <module> > nbdsh.shell() > File "/home/rjones/d/libnbd/python/nbdsh.py", line 62, in shell > exec (c) > File "<string>", line 1, in &lt...
2019 Aug 13
0
Re: [PATCH libnbd 5/6] generator: Implement OClosure.
..."buf = nbd.Buffer(512)" -c "h.aio_pread_callback (buf, 0)"' Traceback (most recent call last): File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/rjones/d/libnbd/python/nbd.py", line 1417, in <module> nbdsh.shell() File "/home/rjones/d/libnbd/python/nbdsh.py", line 62, in shell exec (c) File "<string>", line 1, in <module> File "/home...
2019 Jun 28
3
[PATCH libnbd v2] python: Raise a custom exception containing error string and errno.
This kind of fixes the problems in v1. The exception still primarily lives in the libnbdmod and you could still refer to it using libnbdmod.Error (but don't do that). However when the exception is printed it now appears as nbd.Error, and you can catch it also using the same name. Other problems: - There is no "nice" interface to accessing the exception fields. You have to use
2017 Oct 26
2
syncpassword and (strange) base64...
...pnWUE/cmV1Q3hjLm5BQUQycX5EdyR1NGh" | LANG=C python -m base64 -d Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/lib/python2.7/base64.py", line 360, in <module> test() File "/usr/lib/python2.7/base64.py", line 349, in test func(sys.stdin, sys.stdout) File "/usr/lib/python2.7/base64.py", line 306, in decode s =...
2019 Jun 28
0
Re: [PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
...t; $ ./run nbdsh -c 'h.pread(0, 0)' > > Traceback (most recent call last): > > File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main > > "__main__", mod_spec) > > File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code > > exec(code, run_globals) > > File "/home/rjones/d/libnbd/python/nbd.py", line 1163, in <module> > > nbdsh.shell() > > File "/home/rjones/d/libnbd/python/nbdsh.py", line 62, in shell > > exec (c) > > File "<st...
2019 Jun 28
0
[PATCH libnbd v2] python: Raise a custom exception containing error string and errno.
...h may be 0 if unavailable). For example: $ ./run nbdsh -c 'h.pread(0, 0)' Traceback (most recent call last): File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/rjones/d/libnbd/python/nbd.py", line 1136, in <module> nbdsh.shell() File "/home/rjones/d/libnbd/python/nbdsh.py", line 62, in shell exec (c) File "<string>", line 1, in <module> File "/home...
2019 Jun 28
1
[PATCH libnbd] python: Raise a custom exception containing error string and errno.
I spent a good few hours this morning trying to make this work and came up with the following patch. It's not quite right though. The exception I've created exists in the libnbdmod module (ie. the underlying C module that we use for the Python bindings). Ideally we'd define and throw an exception from the normal nbd module, but I couldn't work out how to do that. Probably
2019 Jun 28
0
[PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
...h may be 0 if unavailable). For example: $ ./run nbdsh -c 'h.pread(0, 0)' Traceback (most recent call last): File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/rjones/d/libnbd/python/nbd.py", line 1163, in <module> nbdsh.shell() File "/home/rjones/d/libnbd/python/nbdsh.py", line 62, in shell exec (c) File "<string>", line 1, in <module> File "/home...
2019 Sep 11
1
Re: [PATCH nbdkit] tests: Convert some tests to use nbdsh instead of qemu-io.
...s not defined During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/lib64/python3.7/site-packages/nbd.py", line 1343, in <module> nbdsh.shell() File "/usr/lib64/python3.7/site-packages/nbdsh.py", line 62, in shell exec (c) File "<string>", line 11, in <module> Fil...
2019 Sep 11
4
[PATCH nbdkit] tests: Convert some tests to use nbdsh instead of qemu-io.
Very much a work in progress as there are still many tests using qemu-io which are candidates for conversion. You'll notice at the end of test-full.sh that the new test has some duplicated code which looks as if it ought to be refactored into a Python function. When I tried to do that, I got loads of strange Python problems which may indicate bugs in nbdsh itself or problems with my