rtcclient
rtcclient copied to clipboard
Disable xmltodict.parse for File Contents/non-XML-responses?
utils.py:29 is raising an ExpatError for correct content retrieved by fetchBeforeStateFile (of a Change).
File "[...]rtcclient\models.py", line 248, in fetchBeforeStateFile
return self._fetchFile(self.before, file_folder, override=False)
File "[...]rtcclient\models.py", line 298, in _fetchFile
headers=self.rtc_obj.headers)
File "[...]rtcclient\utils.py", line 44, in wrapper
raise ExpatError(excp)
xml.parsers.expat.ExpatError: syntax error: line 1, column 0
@Mershl I think the exception is about the token. That function in the decorator is mainly for relogin when the token gets expired.
@dixudx Debugging this issue shows that the parsed resp.content is the File Content of fetchBeforeStateFile (containing source code only), not an xml/token response.
@Mershl Yeah, I understand what you mean. Would you please submit a PR fixing this? Thanks.
@dixudx I'll try to find a lean solution for this. For now I'm skipping the check in my local project.
@Mershl For my problem, just comment # xmltodict.parse (resp.content) in utils.py. I just need to get the file name using fetchBeforeStateFile without get file, this solution works for me.