We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bytes
Currently (v3.3.6), a Units instance cannot be defined by bytes:
Units
>>> from cfunits import Units >>> Units('m') # Initialize with str: OK <Units: m> >>> Units(b'm') # Initialize with bytes: NOT OK --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[5], line 1 ----> 1 Units(b'm') File ~/miniconda3/lib/python3.11/site-packages/cfunits/units.py:805, in Units.__init__(self, units, calendar, formatted, names, definition, _ut_unit) 802 ut_unit = _cached_ut_unit.get(units, None) 803 if ut_unit is None: 804 ut_unit = _ut_parse( --> 805 _ut_system, _c_char_p(units.encode("utf-8")), _UT_ASCII 806 ) 807 if not ut_unit: 808 ut_unit = None AttributeError: 'bytes' object has no attribute 'encode' >>>
It would be good to fix this!
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Currently (v3.3.6), a
Units
instance cannot be defined bybytes
:It would be good to fix this!
The text was updated successfully, but these errors were encountered: