Project

Profile

Help

Bug #4349

TypeError: expected bytes, str found in make_string_value

Added by O'Neil Delpratt over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Python
Start date:
2019-10-18
Due date:
% Done:

100%

Estimated time:
Found in version:
1.2.0
Fixed in version:
1.2.1
Platforms:

Description

Reported here: https://saxonica.plan.io/boards/4/topics/7618

When building a PyXdmValue from a string we get the following error:

TypeError: expected bytes, str found

Bug fix applied in the make_string_value function of the class PySaxonProcessor. Add the following code to convert the Python str to a C char array:

        py_value_string = str_.encode('UTF-8') if str_ is not None else None
        cdef char * c_str_ = py_value_string if str_ is not None else ""

Added test case to the unit test cases.

History

#2 Updated by O'Neil Delpratt about 2 years ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 1.2.1

Bug fix applied in the Saxon/C maintenance release 1.2.1

Please register to edit this issue

Also available in: Atom PDF