Closed lsh-0 closed 5 years ago
Not sure, and I just merged a successful PR a few hours ago. Maybe requests
ends up installing some libraries that are helping in encoding / unicode / character conversion?
It could also be a temporary build issue.
Spending some time looking at this carefully, I've narrowed it down:
The automated tests - both in travis-ci and Alfred - install coveralls
. coveralls
requires requests
, which ends up installing requests==2.20.0
.
That version of requests requires chardet
.
When chardet
is present, when in the test cases it reads an XML file from the fixture folders, I think it is trying to guess at the charset of the file, and it is guessing wrong.
I think this is only related to the test scenarios and appears when it is comparing parser output to the file fixtures, and it is not affecting the actual parser output. If it is changing the parser output, hopefully we'll see test failures in other projects or integration tests like in end2end if the new version of requests (and chardet) is causing more problems when parsing XML files.
I have a potential fix I will commit here shortly, to use io.open
instead of open
for the file fixtures, where the encoding of the file is explicitly opening the file as encoding='utf-8'
.
There are some python 2 vs python 3 encoding tweaks required which I think are localised to the test scenarios only. There could be some python 3 encoding problem lurking in the xmlio.py
module we may see later, unrelated to the nature of this PR.
@gnott do you know about these failures? none of them relate to the updated
requests
lib