jsonrpc-base 2.2.0__tar.gz → 2.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: jsonrpc-base
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: A JSON-RPC client library base interface
5
5
  Home-page: http://github.com/emlove/jsonrpc-base
6
- Author: Emily Love Mills
6
+ Author: Emily Love Watson
7
7
  Author-email: emily@emlove.me
8
8
  License: BSD
9
9
  Keywords: json-rpc base
@@ -12,11 +12,22 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: Topic :: Software Development :: Libraries
13
13
  Classifier: License :: OSI Approved :: BSD License
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.7
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
15
  Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Programming Language :: Python :: 3.15
19
21
  License-File: LICENSE.txt
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: home-page
27
+ Dynamic: keywords
28
+ Dynamic: license
29
+ Dynamic: license-file
30
+ Dynamic: summary
20
31
 
21
32
  jsonrpc-base: a compact JSON-RPC client library interface supporting multiple backends
22
33
  =======================================================================================================
@@ -31,7 +42,6 @@ This is a compact and simple JSON-RPC client implementation interface python cod
31
42
  Main Features
32
43
  -------------
33
44
 
34
- * Python 3.6, 3.7, 3.8 & 3.9 compatible
35
45
  * Supports nested namespaces (eg. `app.users.getUsers()`)
36
46
  * 100% test coverage
37
47
 
@@ -46,6 +56,11 @@ Install the Python tox package and run ``tox``, it'll test this package with var
46
56
 
47
57
  Changelog
48
58
  ---------
59
+ 2.3.0 (2026-11-30)
60
+ ~~~~~~~~~~~~~~~~~~
61
+ - Show the text of the reason in a transport error `(#10) <https://github.com/emlove/jsonrpc-base/pull/10>`_ `@olympia <https://github.com/olympia>`_
62
+ - Raise ProtocolError for an error member that is not an object `(#11) <https://github.com/emlove/jsonrpc-base/pull/11>`_ `@olympia <https://github.com/olympia>`_
63
+
49
64
  2.2.0 (2023-12-11)
50
65
  ~~~~~~~~~~~~~~~~~~
51
66
  - Omit params attribute when empty `(#9) <https://github.com/emlove/jsonrpc-base/pull/9>`_ `@Makman2 <https://github.com/Makman2>`_
@@ -11,7 +11,6 @@ This is a compact and simple JSON-RPC client implementation interface python cod
11
11
  Main Features
12
12
  -------------
13
13
 
14
- * Python 3.6, 3.7, 3.8 & 3.9 compatible
15
14
  * Supports nested namespaces (eg. `app.users.getUsers()`)
16
15
  * 100% test coverage
17
16
 
@@ -26,6 +25,11 @@ Install the Python tox package and run ``tox``, it'll test this package with var
26
25
 
27
26
  Changelog
28
27
  ---------
28
+ 2.3.0 (2026-11-30)
29
+ ~~~~~~~~~~~~~~~~~~
30
+ - Show the text of the reason in a transport error `(#10) <https://github.com/emlove/jsonrpc-base/pull/10>`_ `@olympia <https://github.com/olympia>`_
31
+ - Raise ProtocolError for an error member that is not an object `(#11) <https://github.com/emlove/jsonrpc-base/pull/11>`_ `@olympia <https://github.com/olympia>`_
32
+
29
33
  2.2.0 (2023-12-11)
30
34
  ~~~~~~~~~~~~~~~~~~
31
35
  - Omit params attribute when empty `(#9) <https://github.com/emlove/jsonrpc-base/pull/9>`_ `@Makman2 <https://github.com/Makman2>`_
@@ -10,6 +10,15 @@ class JSONRPCError(Exception):
10
10
  """Root exception for all errors related to this library"""
11
11
 
12
12
 
13
+ def _argument_text(argument):
14
+ """Return the str() of an argument, or its type if empty or failing."""
15
+ try:
16
+ text = str(argument)
17
+ except Exception:
18
+ text = ''
19
+ return text or type(argument).__name__
20
+
21
+
13
22
  class TransportError(JSONRPCError):
14
23
  """An error occurred while performing a connection to the server"""
15
24
 
@@ -22,6 +31,12 @@ class TransportError(JSONRPCError):
22
31
  else:
23
32
  super(TransportError, self).__init__(exception_text, *args)
24
33
 
34
+ def __str__(self):
35
+ """Join the str() of each argument when there is more than one."""
36
+ if len(self.args) < 2:
37
+ return super(TransportError, self).__str__()
38
+ return ': '.join(_argument_text(arg) for arg in self.args)
39
+
25
40
 
26
41
  class ProtocolError(JSONRPCError):
27
42
  """An error occurred while dealing with the JSON-RPC protocol"""
@@ -208,9 +223,11 @@ class Request(Message):
208
223
  if not isinstance(data, dict):
209
224
  raise ProtocolError('Response is not a dictionary')
210
225
  if data.get('error') is not None:
211
- code = data['error'].get('code', '')
212
- message = data['error'].get('message', '')
213
- raise ProtocolError(code, message, data)
226
+ get = getattr(data['error'], 'get', None)
227
+ if not callable(get):
228
+ raise ProtocolError(
229
+ '', 'Response error is not an object', data)
230
+ raise ProtocolError(get('code', ''), get('message', ''), data)
214
231
  elif 'result' not in data:
215
232
  raise ProtocolError('Response without a result field')
216
233
  else:
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: jsonrpc-base
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: A JSON-RPC client library base interface
5
5
  Home-page: http://github.com/emlove/jsonrpc-base
6
- Author: Emily Love Mills
6
+ Author: Emily Love Watson
7
7
  Author-email: emily@emlove.me
8
8
  License: BSD
9
9
  Keywords: json-rpc base
@@ -12,11 +12,22 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: Topic :: Software Development :: Libraries
13
13
  Classifier: License :: OSI Approved :: BSD License
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.7
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
15
  Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Programming Language :: Python :: 3.15
19
21
  License-File: LICENSE.txt
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: home-page
27
+ Dynamic: keywords
28
+ Dynamic: license
29
+ Dynamic: license-file
30
+ Dynamic: summary
20
31
 
21
32
  jsonrpc-base: a compact JSON-RPC client library interface supporting multiple backends
22
33
  =======================================================================================================
@@ -31,7 +42,6 @@ This is a compact and simple JSON-RPC client implementation interface python cod
31
42
  Main Features
32
43
  -------------
33
44
 
34
- * Python 3.6, 3.7, 3.8 & 3.9 compatible
35
45
  * Supports nested namespaces (eg. `app.users.getUsers()`)
36
46
  * 100% test coverage
37
47
 
@@ -46,6 +56,11 @@ Install the Python tox package and run ``tox``, it'll test this package with var
46
56
 
47
57
  Changelog
48
58
  ---------
59
+ 2.3.0 (2026-11-30)
60
+ ~~~~~~~~~~~~~~~~~~
61
+ - Show the text of the reason in a transport error `(#10) <https://github.com/emlove/jsonrpc-base/pull/10>`_ `@olympia <https://github.com/olympia>`_
62
+ - Raise ProtocolError for an error member that is not an object `(#11) <https://github.com/emlove/jsonrpc-base/pull/11>`_ `@olympia <https://github.com/olympia>`_
63
+
49
64
  2.2.0 (2023-12-11)
50
65
  ~~~~~~~~~~~~~~~~~~
51
66
  - Omit params attribute when empty `(#9) <https://github.com/emlove/jsonrpc-base/pull/9>`_ `@Makman2 <https://github.com/Makman2>`_
@@ -9,8 +9,8 @@ except ImportError:
9
9
 
10
10
  setup(
11
11
  name='jsonrpc-base',
12
- version='2.2.0',
13
- author='Emily Love Mills',
12
+ version='2.3.0',
13
+ author='Emily Love Watson',
14
14
  author_email='emily@emlove.me',
15
15
  packages=('jsonrpc_base',),
16
16
  license='BSD',
@@ -25,10 +25,12 @@ setup(
25
25
  'Topic :: Software Development :: Libraries',
26
26
  'License :: OSI Approved :: BSD License',
27
27
  'Programming Language :: Python :: 3',
28
- 'Programming Language :: Python :: 3.7',
29
- 'Programming Language :: Python :: 3.8',
30
- 'Programming Language :: Python :: 3.9',
31
28
  'Programming Language :: Python :: 3.10',
29
+ 'Programming Language :: Python :: 3.11',
30
+ 'Programming Language :: Python :: 3.12',
31
+ 'Programming Language :: Python :: 3.13',
32
+ 'Programming Language :: Python :: 3.14',
33
+ 'Programming Language :: Python :: 3.15',
32
34
  ],
33
35
 
34
36
  )
File without changes
File without changes
File without changes