microdot 2.3.0__tar.gz → 2.3.1__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.
Files changed (72) hide show
  1. {microdot-2.3.0/src/microdot.egg-info → microdot-2.3.1}/PKG-INFO +1 -1
  2. {microdot-2.3.0 → microdot-2.3.1}/pyproject.toml +1 -1
  3. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/microdot.py +2 -2
  4. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/sse.py +2 -2
  5. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/test_client.py +2 -2
  6. {microdot-2.3.0 → microdot-2.3.1/src/microdot.egg-info}/PKG-INFO +1 -1
  7. {microdot-2.3.0 → microdot-2.3.1}/LICENSE +0 -0
  8. {microdot-2.3.0 → microdot-2.3.1}/MANIFEST.in +0 -0
  9. {microdot-2.3.0 → microdot-2.3.1}/README.md +0 -0
  10. {microdot-2.3.0 → microdot-2.3.1}/docs/Makefile +0 -0
  11. {microdot-2.3.0 → microdot-2.3.1}/docs/_static/css/custom.css +0 -0
  12. {microdot-2.3.0 → microdot-2.3.1}/docs/api.rst +0 -0
  13. {microdot-2.3.0 → microdot-2.3.1}/docs/conf.py +0 -0
  14. {microdot-2.3.0 → microdot-2.3.1}/docs/extensions.rst +0 -0
  15. {microdot-2.3.0 → microdot-2.3.1}/docs/freezing.rst +0 -0
  16. {microdot-2.3.0 → microdot-2.3.1}/docs/index.rst +0 -0
  17. {microdot-2.3.0 → microdot-2.3.1}/docs/intro.rst +0 -0
  18. {microdot-2.3.0 → microdot-2.3.1}/docs/make.bat +0 -0
  19. {microdot-2.3.0 → microdot-2.3.1}/docs/migrating.rst +0 -0
  20. {microdot-2.3.0 → microdot-2.3.1}/setup.cfg +0 -0
  21. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/__init__.py +0 -0
  22. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/asgi.py +0 -0
  23. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/auth.py +0 -0
  24. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/cors.py +0 -0
  25. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/helpers.py +0 -0
  26. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/jinja.py +0 -0
  27. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/login.py +0 -0
  28. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/multipart.py +0 -0
  29. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/session.py +0 -0
  30. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/utemplate.py +0 -0
  31. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/websocket.py +0 -0
  32. {microdot-2.3.0 → microdot-2.3.1}/src/microdot/wsgi.py +0 -0
  33. {microdot-2.3.0 → microdot-2.3.1}/src/microdot.egg-info/SOURCES.txt +0 -0
  34. {microdot-2.3.0 → microdot-2.3.1}/src/microdot.egg-info/dependency_links.txt +0 -0
  35. {microdot-2.3.0 → microdot-2.3.1}/src/microdot.egg-info/not-zip-safe +0 -0
  36. {microdot-2.3.0 → microdot-2.3.1}/src/microdot.egg-info/requires.txt +0 -0
  37. {microdot-2.3.0 → microdot-2.3.1}/src/microdot.egg-info/top_level.txt +0 -0
  38. {microdot-2.3.0 → microdot-2.3.1}/tests/__init__.py +0 -0
  39. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.bin +0 -0
  40. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.css +0 -0
  41. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.gif +0 -0
  42. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.gz +0 -0
  43. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.html +0 -0
  44. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.jpg +0 -0
  45. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.js +0 -0
  46. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.json +0 -0
  47. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.png +0 -0
  48. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.txt +0 -0
  49. {microdot-2.3.0 → microdot-2.3.1}/tests/files/test.txt.gz +0 -0
  50. {microdot-2.3.0 → microdot-2.3.1}/tests/mock_socket.py +0 -0
  51. {microdot-2.3.0 → microdot-2.3.1}/tests/templates/hello.jinja.txt +0 -0
  52. {microdot-2.3.0 → microdot-2.3.1}/tests/templates/hello.utemplate.txt +0 -0
  53. {microdot-2.3.0 → microdot-2.3.1}/tests/templates/hello_utemplate_txt.py +0 -0
  54. {microdot-2.3.0 → microdot-2.3.1}/tests/test_asgi.py +0 -0
  55. {microdot-2.3.0 → microdot-2.3.1}/tests/test_auth.py +0 -0
  56. {microdot-2.3.0 → microdot-2.3.1}/tests/test_cors.py +0 -0
  57. {microdot-2.3.0 → microdot-2.3.1}/tests/test_end2end.py +0 -0
  58. {microdot-2.3.0 → microdot-2.3.1}/tests/test_jinja.py +0 -0
  59. {microdot-2.3.0 → microdot-2.3.1}/tests/test_login.py +0 -0
  60. {microdot-2.3.0 → microdot-2.3.1}/tests/test_microdot.py +0 -0
  61. {microdot-2.3.0 → microdot-2.3.1}/tests/test_multidict.py +0 -0
  62. {microdot-2.3.0 → microdot-2.3.1}/tests/test_multipart.py +0 -0
  63. {microdot-2.3.0 → microdot-2.3.1}/tests/test_request.py +0 -0
  64. {microdot-2.3.0 → microdot-2.3.1}/tests/test_response.py +0 -0
  65. {microdot-2.3.0 → microdot-2.3.1}/tests/test_session.py +0 -0
  66. {microdot-2.3.0 → microdot-2.3.1}/tests/test_sse.py +0 -0
  67. {microdot-2.3.0 → microdot-2.3.1}/tests/test_url_pattern.py +0 -0
  68. {microdot-2.3.0 → microdot-2.3.1}/tests/test_urlencode.py +0 -0
  69. {microdot-2.3.0 → microdot-2.3.1}/tests/test_utemplate.py +0 -0
  70. {microdot-2.3.0 → microdot-2.3.1}/tests/test_websocket.py +0 -0
  71. {microdot-2.3.0 → microdot-2.3.1}/tests/test_wsgi.py +0 -0
  72. {microdot-2.3.0 → microdot-2.3.1}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microdot
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: The impossibly small web framework for MicroPython
5
5
  Author-email: Miguel Grinberg <miguel.grinberg@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/miguelgrinberg/microdot
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "microdot"
3
- version = "2.3.0"
3
+ version = "2.3.1"
4
4
  authors = [
5
5
  { name = "Miguel Grinberg", email = "miguel.grinberg@gmail.com" },
6
6
  ]
@@ -578,9 +578,9 @@ class Response:
578
578
  self.headers = NoCaseDict(headers or {})
579
579
  self.reason = reason
580
580
  if isinstance(body, (dict, list)):
581
- self.body = json.dumps(body).encode()
581
+ body = json.dumps(body)
582
582
  self.headers['Content-Type'] = 'application/json; charset=UTF-8'
583
- elif isinstance(body, str):
583
+ if isinstance(body, str):
584
584
  self.body = body.encode()
585
585
  else:
586
586
  # this applies to bytes, file-like objects or generators
@@ -29,8 +29,8 @@ class SSE:
29
29
  given, it must be a string.
30
30
  """
31
31
  if isinstance(data, (dict, list)):
32
- data = json.dumps(data).encode()
33
- elif isinstance(data, str):
32
+ data = json.dumps(data)
33
+ if isinstance(data, str):
34
34
  data = data.encode()
35
35
  elif not isinstance(data, bytes):
36
36
  data = str(data).encode()
@@ -105,10 +105,10 @@ class TestClient:
105
105
  if body is None:
106
106
  body = b''
107
107
  elif isinstance(body, (dict, list)):
108
- body = json.dumps(body).encode()
108
+ body = json.dumps(body)
109
109
  if 'Content-Type' not in headers: # pragma: no cover
110
110
  headers['Content-Type'] = 'application/json'
111
- elif isinstance(body, str):
111
+ if isinstance(body, str):
112
112
  body = body.encode()
113
113
  if body and 'Content-Length' not in headers:
114
114
  headers['Content-Length'] = str(len(body))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microdot
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: The impossibly small web framework for MicroPython
5
5
  Author-email: Miguel Grinberg <miguel.grinberg@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/miguelgrinberg/microdot
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes