Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 1707 by m...@protel.net: "Create File" (OperatingSystem Library)
cannot write binary data which should not be encoded
http://code.google.com/p/robotframework/issues/detail?id=1707
Hi everybody!
There is a problem with "Create File" keyword from OperatingSystem library.
It seems it can't always handle binary data such as PDF.
I use this keyword following way:
Create File blablabla.pdf ${payload}
The result with debugging on is following:
20140228 17:05:02.298 - INFO - +----- START KW: OperatingSystem.Create File
[ blablabla.pdf | ${payload} ]
20140228 17:05:02.317 - FAIL - UnicodeDecodeError: 'ascii' codec can't
decode byte 0x83 in position 11: ordinal not in range(128)
20140228 17:05:02.318 - DEBUG - Traceback (most recent call last):
File "C:\Python27\lib\site-packages\robot\libraries\OperatingSystem.py",
line 611, in create_file
path = self._write_to_file(path, content, encoding, 'w')
File "C:\Python27\lib\site-packages\robot\libraries\OperatingSystem.py",
line 630, in _write_to_file
f.write(content.encode(encoding))
20140228 17:05:02.318 - INFO - +----- END KW: OperatingSystem.Create File
(20)
My PDF content comes from the ImapLibrary and the guys that support
ImapLibrary already debugged this issue and they suspect that there is a
problem with the "Create File" keyword, see here:
https://github.com/lovelysystems/robotframework-imaplibrary/issues/17
Regards,
mr
Robot Framework version: 2.8.4
used interpreter: Python, version 2.7.5
operating system: Windows 7
output of `pybot --version` command: Robot Framework 2.8.4 (Python 2.7.5 on
win32)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
---
You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.