lczub / TestLink-API-Python-client

A Python client to use the TestLink API
105 stars 63 forks source link

py3 - testlinkapigeneric_online_test under py34 - attachment tests raise TypeError: expected bytes-like object, not str #34

Closed lczub closed 9 years ago

lczub commented 9 years ago

Under py341, the attachment related unit tests in

raises a TypeError: expected bytes-like object, not str

affected test are:

Example

ERROR: test_uploadAttachment_unknownID (utest-online.testlinkapigeneric_online_test.TestLinkAPIOnlineTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\Programme\Python34\lib\base64.py", line 519, in _input_type_check
    m = memoryview(s)
TypeError: memoryview: str object does not have the buffer interface

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Projekte\git\TestLink-API-Python-client\test\utest-online\testlinkapigeneric_online_test.py", line 267, in test_uploadAttachment_unknownID
    title='title 4713', description='descr. 4714')
  File "D:\Projekte\git\TestLink-API-Python-client\src\testlink\testlinkdecorators.py", line 156, in wrapperAddAttachment
    argsAttachment = self._getAttachmentArgs(attachmentfile)
  File "D:\Projekte\git\TestLink-API-Python-client\src\testlink\testlinkapigeneric.py", line 1241, in _getAttachmentArgs
    'content':base64.encodestring(attachmentfile.read())
  File "D:\Programme\Python34\lib\base64.py", line 548, in encodestring
    return encodebytes(s)
  File "D:\Programme\Python34\lib\base64.py", line 536, in encodebytes
    _input_type_check(s)
  File "D:\Programme\Python34\lib\base64.py", line 522, in _input_type_check
    raise TypeError(msg) from err
TypeError: expected bytes-like object, not str
kman0 commented 9 years ago

Fixed in #37

lczub commented 9 years ago

duplicate of #39

lczub commented 9 years ago

fixed with release v0.6.0