We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1477a2c commit 8b7ea78Copy full SHA for 8b7ea78
Lib/multiprocessing/shared_memory.py
@@ -308,7 +308,9 @@ def _extract_recreation_code(value):
308
def _get_str_or_bytes_format(self, item):
309
"""Used to ensure the correct length is inserted into the
310
the formatted _types_mapping for multibyte utf-8 characters."""
311
- length = len(item if isinstance(item, bytes) else item.encode())
+ length = len(
312
+ item if isinstance(item, bytes) else item.encode(_encoding)
313
+ )
314
aligned_length = self._alignment * (length // self._alignment + 1)
315
return self._types_mapping[type(item)] % aligned_length
316
0 commit comments