[Ironpython-users] issue with chardtect.detect with unicode type
fernandez_dan2 at hotmail.com
Thu Jun 4 13:17:22 CEST 2015
I'm playing with request but running into an issue with chardet.detect call.
if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or
(version_info >= (3, 0) and not isinstance(aBuf, bytes))):
raise ValueError('Expected a bytes object, not a unicode object')
from . import universaldetector
u = universaldetector.UniversalDetector()
It always throws ValueError exception 'Expected a bytes object, not a unicode object'. The problem is the isinstance(aBuff,unicode) which returns True for IronPython and not CPython. I guess in IronPython strings are both a str and unicode types
>>> v = 'value'
I was wondering if this is expected behavior for IronPython? At the moment I just removed this check in my local copy so I get pass this issue with requests.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironpython-users