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
The libyaml Cython wrapper uses PyUnicode_CheckExact around all C string accesses instead of PyUnicode_Check; this prevents str subclasses from being used anywhere with the C-accelerated types, and the varying error conditions when a subclass is encountered can frustrate diagnosis of the underlying problem.
I've already gotten this working with string inputs to load by switching to PyUnicode_Check for just that arg in the CParser init, but fixing it everywhere will require some new tests to ensure that things actually behave properly. Off the top of my head, I can't think of a reason why we wouldn't be able to support proper str subclasses (ie, those that have the same basic C layout as str, not just anything that passes __subclasscheck__).
The text was updated successfully, but these errors were encountered:
The libyaml Cython wrapper uses
PyUnicode_CheckExact
around all C string accesses instead ofPyUnicode_Check
; this preventsstr
subclasses from being used anywhere with the C-accelerated types, and the varying error conditions when a subclass is encountered can frustrate diagnosis of the underlying problem.I've already gotten this working with string inputs to
load
by switching toPyUnicode_Check
for just that arg in the CParser init, but fixing it everywhere will require some new tests to ensure that things actually behave properly. Off the top of my head, I can't think of a reason why we wouldn't be able to support properstr
subclasses (ie, those that have the same basic C layout asstr
, not just anything that passes__subclasscheck__
).The text was updated successfully, but these errors were encountered: