Displaying 5 results from an estimated 5 matches for "jsondecoder".
2015 May 21
2
[nbdkit python]: unable to locate modules
I'm working on a python plugin for nbdkit that treats Google Cloud
Storage as a block device. I have a library, gcs.py, that implements
simple commands: list, get, put, delete; source is here:
https://github.com/wspeirs/cldblkdev/blob/master/gcs.py
When I attempt to run nbdkit I get the following error:
nbdkit python script=/home/wspeirs/src/cldblkdev/cldblkdev.py
Traceback (most recent call
2015 May 21
0
Re: [nbdkit python]: unable to locate modules
...pt to run nbdkit I get the following error:
I get a slightly different error:
Traceback (most recent call last):
File "/tmp/gcs.py", line 1, in <module>
import json
File "/usr/lib64/python2.7/json/__init__.py", line 108, in <module>
from .decoder import JSONDecoder
File "/usr/lib64/python2.7/json/decoder.py", line 5, in <module>
import struct
File "/usr/lib64/python2.7/struct.py", line 1, in <module>
from _struct import *
ImportError: /usr/lib64/python2.7/lib-dynload/_struct.so: undefined symbol: PyFloat_Type
nbdkit...
2015 May 21
2
Re: [nbdkit python]: unable to locate modules
...or:
>
> I get a slightly different error:
>
> Traceback (most recent call last):
> File "/tmp/gcs.py", line 1, in <module>
> import json
> File "/usr/lib64/python2.7/json/__init__.py", line 108, in <module>
> from .decoder import JSONDecoder
> File "/usr/lib64/python2.7/json/decoder.py", line 5, in <module>
> import struct
> File "/usr/lib64/python2.7/struct.py", line 1, in <module>
> from _struct import *
> ImportError: /usr/lib64/python2.7/lib-dynload/_struct.so: undefined sy...
2019 Mar 28
0
[PATCH v2 4/4] OCaml tools: output messages into JSON for machine readable
...dule(mod)
+ return True
+ except ImportError:
+ return False
+
+
+def skipUnlessHasModule(mod):
+ if not isModuleInstalled(mod):
+ return unittest.skip("%s not available" % mod)
+ return lambda func: func
+
+
+def iterload(stream):
+ dec = json.JSONDecoder()
+ for line in stream:
+ yield dec.raw_decode(line)
+
+
+def loadJsonFromCommand(extraargs):
+ r, w = os.pipe()
+ set_fd_inheritable(r)
+ r = fdopen(r, "r")
+ set_fd_inheritable(w)
+ w = fdopen(w, "w")
+ pid = os.fork()
+ if pid:
+ w.close(...
2019 Mar 28
8
[PATCH v2 0/4] OCaml tools: output messages as JSON machine
Enhance the output in machine parseable mode, by outputting all the
messages of OCaml tools as JSON to the machine parseable stream.
Related, although not strictly needed for this (and thus can be split
if requested), is the addition of the fd format for the machine
readable stream.
Changes from v1:
- use Obj.magic to convert int -> Unix.file_descr
- add tests
Pino Toscano (4):