You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to create a package using zkg create, I encountered an issue where non-ASCII characters in the user variables (e.g., author name) result in a UnicodeEncodeError. This prevents the package creation from completing successfully
2024-06-27 17:36:44 ERROR problem during template instantiation: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)Traceback (most recent call last): File "/opt/homebrew/Cellar/zeek/6.2.1/bin/zkg", line 2295, in cmd_create package.do_instantiate(tmpl, args.packagedir, args.force) File "/opt/homebrew/Cellar/zeek/6.2.1/lib/zeek/python/zeekpkg/template.py", line 708, in do_instantiate super().do_instantiate(tmpl, packagedir, use_force) File "/opt/homebrew/Cellar/zeek/6.2.1/lib/zeek/python/zeekpkg/template.py", line 552, in do_instantiate self.instantiate(tmpl) File "/opt/homebrew/Cellar/zeek/6.2.1/lib/zeek/python/zeekpkg/template.py", line 566, in instantiate for orig_file, path_name, file_name, content in self._walk(tmpl): File "/opt/homebrew/Cellar/zeek/6.2.1/lib/zeek/python/zeekpkg/template.py", line 670, in _walk out_content = self._replace(tmpl, hdl.read()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/zeek/6.2.1/lib/zeek/python/zeekpkg/template.py", line 692, in _replace val = bytes(val, "ascii") ^^^^^^^^^^^^^^^^^^^UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
error: problem during template instantiation: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
Expected Output:
The package should be created successfully, handling non-ASCII characters in the user inputs without errors.
Environment:
zkg version: 3.0.1
Zeek version: 6.2.1
Python version: 3.12.4
OS: macOS (using homebrew)
Additional Information:
The issue seems to stem from an attempt to encode non-ASCII characters using the ASCII codec, resulting in a UnicodeEncodeError.
Please consider updating the relevant code to handle non-ASCII characters.
The text was updated successfully, but these errors were encountered:
AmazingPP
changed the title
zkg create fails with UnicodeEncodeError when using non-ASCII characters in user varszkg create fails with UnicodeEncodeError when using non-ASCII characters in user vars
Jun 27, 2024
Description:
When attempting to create a package using
zkg create
, I encountered an issue where non-ASCII characters in the user variables (e.g., author name) result in aUnicodeEncodeError
. This prevents the package creation from completing successfullySteps to Reproduce:
Observed Output:
Expected Output:
The package should be created successfully, handling non-ASCII characters in the user inputs without errors.
Environment:
Additional Information:
The issue seems to stem from an attempt to encode non-ASCII characters using the ASCII codec, resulting in a
UnicodeEncodeError
.Please consider updating the relevant code to handle non-ASCII characters.
The text was updated successfully, but these errors were encountered: