python-http_request 0.1.0__tar.gz → 0.1.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-http_request
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Python http response utils.
5
5
  Home-page: https://github.com/ChenyangGao/python-modules/tree/main/python-http_request
6
6
  License: MIT
@@ -20,10 +20,10 @@ Classifier: Programming Language :: Python :: 3 :: Only
20
20
  Classifier: Topic :: Software Development
21
21
  Classifier: Topic :: Software Development :: Libraries
22
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
- Requires-Dist: http_response (>=0.0.4)
23
+ Requires-Dist: http_response (>=0.0.7)
24
24
  Requires-Dist: orjson
25
25
  Requires-Dist: python-asynctools (>=0.1.3)
26
- Requires-Dist: python-dicttools (>=0.0.1)
26
+ Requires-Dist: python-dicttools (>=0.0.2)
27
27
  Requires-Dist: python-ensure (>=0.0.1)
28
28
  Requires-Dist: python-filewrap (>=0.2.8)
29
29
  Requires-Dist: python-texttools (>=0.0.4)
@@ -2,7 +2,7 @@
2
2
  # encoding: utf-8
3
3
 
4
4
  __author__ = "ChenyangGao <https://chenyanggao.github.io>"
5
- __version__ = (0, 1, 0)
5
+ __version__ = (0, 1, 1)
6
6
  __all__ = [
7
7
  "SupportsGeturl", "url_origin", "complete_url", "ensure_ascii_url",
8
8
  "urlencode", "cookies_str_to_dict", "headers_str_to_dict_by_lines",
@@ -143,10 +143,13 @@ def urlencode(
143
143
  yield "="
144
144
  if v is True:
145
145
  yield "true"
146
+ continue
146
147
  elif v is False:
147
148
  yield "false"
149
+ continue
148
150
  elif v is None:
149
151
  yield "null"
152
+ continue
150
153
  elif isinstance(v, (str, UserString)):
151
154
  pass
152
155
  elif isinstance(v, Buffer):
@@ -287,12 +290,10 @@ def encode_multipart_data(
287
290
  def encode_iter() -> Iterator[Buffer]:
288
291
  if data:
289
292
  for name, value in iter_items(data):
290
- yield boundary_line
291
293
  yield from encode_item(name, value)
292
294
  yield b"\r\n"
293
295
  if files:
294
296
  for name, value in iter_items(files):
295
- yield boundary_line
296
297
  yield from encode_item(name, value, is_file=True)
297
298
  yield b"\r\n"
298
299
  yield b'--%s--\r\n' % boundary_bytes
@@ -382,13 +383,11 @@ def encode_multipart_data_async(
382
383
  async def encode_iter() -> AsyncIterator[Buffer]:
383
384
  if data:
384
385
  for name, value in iter_items(data):
385
- yield boundary_line
386
386
  async for line in encode_item(name, value):
387
387
  yield line
388
388
  yield b"\r\n"
389
389
  if files:
390
390
  for name, value in iter_items(files):
391
- yield boundary_line
392
391
  async for line in encode_item(name, value, is_file=True):
393
392
  yield line
394
393
  yield b"\r\n"
@@ -450,7 +449,7 @@ def normalize_request_args(
450
449
  content_type = headers_.get("content-type", "")
451
450
  charset = get_charset(content_type)
452
451
  mimetype = get_mimetype(charset).lower()
453
- if files is not None:
452
+ if files:
454
453
  headers2, data = encode_multipart_data(
455
454
  cast(None | Mapping[string, Any] | Iterable[tuple[string, Any]], data),
456
455
  files,
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-http_request"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "Python http response utils."
5
5
  authors = ["ChenyangGao <wosiwujm@gmail.com>"]
6
6
  license = "MIT"
@@ -27,10 +27,10 @@ include = [
27
27
 
28
28
  [tool.poetry.dependencies]
29
29
  python = "^3.12"
30
- http_response = ">=0.0.4"
30
+ http_response = ">=0.0.7"
31
31
  orjson = "*"
32
32
  python-asynctools = ">=0.1.3"
33
- python-dicttools = ">=0.0.1"
33
+ python-dicttools = ">=0.0.2"
34
34
  python-ensure = ">=0.0.1"
35
35
  python-filewrap = ">=0.2.8"
36
36
  python-texttools = ">=0.0.4"