cobs 1.2.1__tar.gz → 1.2.2__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
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: cobs
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: Consistent Overhead Byte Stuffing (COBS)
5
5
  Author-email: Craig McQueen <python@craig.mcqueen.id.au>
6
6
  License: ----------------------------------------------------------------------------
@@ -37,6 +37,7 @@ Classifier: Topic :: Communications
37
37
  Requires-Python: >=3.6
38
38
  Description-Content-Type: text/x-rst
39
39
  License-File: LICENSE.txt
40
+ Dynamic: license-file
40
41
 
41
42
  ========================================
42
43
  Consistent Overhead Byte Stuffing (COBS)
@@ -184,10 +185,10 @@ application.
184
185
  Supported Python Versions
185
186
  -------------------------
186
187
 
187
- Python >= 3.6 are supported, and have both a C extension and a pure Python
188
+ Python >= 3.10 are supported, and have both a C extension and a pure Python
188
189
  implementation.
189
190
 
190
- Python versions < 3.6 might work, but have not been tested.
191
+ Python versions < 3.10 might work, but have not been tested.
191
192
 
192
193
 
193
194
  ------------
@@ -144,10 +144,10 @@ application.
144
144
  Supported Python Versions
145
145
  -------------------------
146
146
 
147
- Python >= 3.6 are supported, and have both a C extension and a pure Python
147
+ Python >= 3.10 are supported, and have both a C extension and a pure Python
148
148
  implementation.
149
149
 
150
- Python versions < 3.6 might work, but have not been tested.
150
+ Python versions < 3.10 might work, but have not been tested.
151
151
 
152
152
 
153
153
  ------------
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: cobs
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: Consistent Overhead Byte Stuffing (COBS)
5
5
  Author-email: Craig McQueen <python@craig.mcqueen.id.au>
6
6
  License: ----------------------------------------------------------------------------
@@ -37,6 +37,7 @@ Classifier: Topic :: Communications
37
37
  Requires-Python: >=3.6
38
38
  Description-Content-Type: text/x-rst
39
39
  License-File: LICENSE.txt
40
+ Dynamic: license-file
40
41
 
41
42
  ========================================
42
43
  Consistent Overhead Byte Stuffing (COBS)
@@ -184,10 +185,10 @@ application.
184
185
  Supported Python Versions
185
186
  -------------------------
186
187
 
187
- Python >= 3.6 are supported, and have both a C extension and a pure Python
188
+ Python >= 3.10 are supported, and have both a C extension and a pure Python
188
189
  implementation.
189
190
 
190
- Python versions < 3.6 might work, but have not been tested.
191
+ Python versions < 3.10 might work, but have not been tested.
191
192
 
192
193
 
193
194
  ------------
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cobs"
7
- version = "1.2.1"
7
+ version = "1.2.2"
8
8
  authors = [
9
9
  { name = "Craig McQueen", email = "python@craig.mcqueen.id.au" },
10
10
  ]
@@ -8,6 +8,8 @@ if sys.version_info[0] == 2:
8
8
  raise Exception('Python 2.x is no longer supported')
9
9
 
10
10
  setup_dict = dict(
11
+ name="cobs",
12
+ version="1.2.2",
11
13
  packages=[ 'cobs', 'cobs.cobs', 'cobs.cobsr', 'cobs._version', ],
12
14
  package_dir={
13
15
  'cobs' : 'src/cobs',
@@ -14,7 +14,8 @@ def _get_buffer_view(in_bytes):
14
14
  if mv.ndim > 1 or mv.itemsize > 1:
15
15
  raise BufferError('object must be a single-dimension buffer of bytes.')
16
16
  try:
17
- mv = mv.cast('c')
17
+ if mv.format != 'B':
18
+ mv = mv.cast('B')
18
19
  except AttributeError:
19
20
  pass
20
21
  return mv
@@ -36,7 +37,7 @@ def encode(in_bytes):
36
37
  idx = 0
37
38
  search_start_idx = 0
38
39
  for in_char in in_bytes_mv:
39
- if in_char == b'\x00':
40
+ if in_char == 0:
40
41
  final_zero = True
41
42
  out_bytes.append(idx - search_start_idx + 1)
42
43
  out_bytes += in_bytes_mv[search_start_idx:idx]
@@ -70,13 +71,13 @@ def decode(in_bytes):
70
71
 
71
72
  if len(in_bytes_mv) > 0:
72
73
  while True:
73
- length = ord(in_bytes_mv[idx])
74
+ length = in_bytes_mv[idx]
74
75
  if length == 0:
75
76
  raise DecodeError("zero byte found in input")
76
77
  idx += 1
77
78
  end = idx + length - 1
78
79
  copy_mv = in_bytes_mv[idx:end]
79
- if b'\x00' in copy_mv:
80
+ if 0 in copy_mv:
80
81
  raise DecodeError("zero byte found in input")
81
82
  out_bytes += copy_mv
82
83
  idx = end
@@ -14,7 +14,8 @@ def _get_buffer_view(in_bytes):
14
14
  if mv.ndim > 1 or mv.itemsize > 1:
15
15
  raise BufferError('object must be a single-dimension buffer of bytes.')
16
16
  try:
17
- mv = mv.cast('c')
17
+ if mv.format != 'B':
18
+ mv = mv.cast('B')
18
19
  except AttributeError:
19
20
  pass
20
21
  return mv
@@ -39,13 +40,13 @@ def encode(in_bytes):
39
40
  out_bytes.append(0xFF)
40
41
  out_bytes += in_bytes_mv[search_start_idx:idx]
41
42
  search_start_idx = idx
42
- if in_char == b'\x00':
43
+ if in_char == 0:
43
44
  out_bytes.append(idx - search_start_idx + 1)
44
45
  out_bytes += in_bytes_mv[search_start_idx:idx]
45
46
  search_start_idx = idx + 1
46
47
  idx += 1
47
48
  try:
48
- final_byte_value = ord(in_bytes_mv[-1])
49
+ final_byte_value = in_bytes_mv[-1]
49
50
  except IndexError:
50
51
  final_byte_value = 0
51
52
  length_value = idx - search_start_idx + 1
@@ -77,13 +78,13 @@ def decode(in_bytes):
77
78
 
78
79
  if len(in_bytes_mv) > 0:
79
80
  while True:
80
- length = ord(in_bytes_mv[idx])
81
+ length = in_bytes_mv[idx]
81
82
  if length == 0:
82
83
  raise DecodeError("zero byte found in input")
83
84
  idx += 1
84
85
  end = idx + length - 1
85
86
  copy_mv = in_bytes_mv[idx:end]
86
- if b'\x00' in copy_mv:
87
+ if 0 in copy_mv:
87
88
  raise DecodeError("zero byte found in input")
88
89
  out_bytes += copy_mv
89
90
  idx = end
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