search for: closedhandle

Displaying 6 results from an estimated 6 matches for "closedhandle".

2013 Jan 24
1
[PATCH] python: Inherit from 'object' base class.
...u want to build the python bindings (optional) - Ruby, rake if you want to build the ruby bindings (optional) diff --git a/generator/python.ml b/generator/python.ml index 8752fd3..0b0a79c 100644 --- a/generator/python.ml +++ b/generator/python.ml @@ -662,7 +662,7 @@ import libguestfsmod class ClosedHandle(ValueError): pass -class GuestFS: +class GuestFS(object): \"\"\"Instances of this class are libguestfs API handles.\"\"\" def __init__ (self, environment=True, close_on_exit=True): -- 1.8.1
2016 Feb 12
2
[PATCH] python: tests: use more targeted assert*() functions/checks
...# Expect an exception if we call a method on a closed handle. g = guestfs.GuestFS (python_return_dict=True) g.close () - try: - g.set_memsize (512) - raise Exception("expected an exception from previous statement") - except guestfs.ClosedHandle: - pass + self.assertRaises (guestfs.ClosedHandle, g.set_memsize, 512) del g # Verify that the handle is really being closed by g.close, by diff --git a/python/t/810-rhbz811650.py b/python/t/810-rhbz811650.py index c812c30..c37abac 100644 --- a/python/t/810-rhb...
2017 May 21
3
[PATCH 0/2] python: improved UTF8 decoding error handling
The Python 3 bindings currently are unable to deal with non UTF8 characters. This series continues what proposed in RHBZ#1406906. A new function 'set_decode_error_handler' allows the User to specify how to deal with decoding errors. The default behaviour will be raising a UnicodeDecodeError. If the handler is changed to 'surrogateescape', non UTF8 characters will be escaped in a
2016 May 04
9
[PATCH 0/8] python: PEP 8 fixes
Hi, this series cleans up the Python sources, either static or generated, including also tests, to make them PEP 8 compliant; see https://www.python.org/dev/peps/pep-0008/ and tools like pep8. Almost all the issues reported by pep8 are fixed, reducing the issues from 3818 to 7. The changes should have no effect on the actual code, while it will help Python users with consistency with other
2017 May 21
0
[PATCH 2/2] python: unicode decode handler error scheme setter
...ot;; pr " { (char *) \"create\", guestfs_int_py_create, METH_VARARGS, NULL },\n"; pr " { (char *) \"close\", guestfs_int_py_close, METH_VARARGS, NULL },\n"; pr " { (char *) \"set_event_callback\",\n"; @@ -728,6 +731,19 @@ class ClosedHandle(ValueError): pass +def set_decode_error_handler(handler): + \"\"\"Set the error handling scheme to use for the handling + of decoding errors. + The default is 'strict' meaning that decoding errors raise a + UnicodeDecodeError. + + The other possible valu...
2016 Feb 22
3
[PATCH 1/3] python: tests: refactor to use unittest's discovery
...ose () # explicit close - del g # implicit close - should be no error/warning - - # Expect an exception if we call a method on a closed handle. - g = guestfs.GuestFS (python_return_dict=True) - g.close () - self.assertRaises (guestfs.ClosedHandle, g.set_memsize, 512) - del g - - # Verify that the handle is really being closed by g.close, by - # setting up a close event and testing that it happened. - g = guestfs.GuestFS (python_return_dict=True) - - g.set_event_callback (close_callback, guestfs.EVENT_CLOSE...