Skip to content

Issue on getting report and splitting right into utf8 bytes #47

@jaesivsm

Description

@jaesivsm

When getting a report through DownloadReportAsString or DownloadReport, _DownloadReport is called. This method call _DownloadReportAsStream and read it chunk by chunk. The chunk size cannot be changed and it happens that, sometimes, the chunk end up right in the middle of and utf8 multibytes datablock.
I get an error while _DownloadReport tries to decode that chunk; it raises 'utf-8' codec can't decode byte 0xc3 in position 16383: unexpected end of data.

This problem breaks DownloadReportAsString which is annoying since "as string" could mean "as a single chunk".

I, myself, did a workaround where I use DownloadReportAsStream().read().decode().

Anyway I see several way of fixing that problem :

  • making the chunk size a parameters of the _DownloadReport method and make DownloadReportAsString pass -1 or 0 or whatever makes read() read the whole thing in one time
  • make the chunk size a class attribute
  • make the non-stream method use another download method than the stream one

I'd be glad to propose a patch for that.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions