Opened 9 years ago

Closed 8 years ago

#5332 closed defect (fixed)

Storage test fails on python3

Reported by: spaetz Owned by:
Priority: minor Milestone:
Component: programming Keywords: python3, patch
Cc: berkerpeksag Parent Tickets: 5017


This happens running the test suite on python3 with MG v0.8 (The same error occurs in a few more tests). I don't have an easy guess as to how to fix this.

_ test_basic_storage_copy_locally _
Traceback (most recent call last):

File "/srv/", line 284, in test_basic_storage_copy_locally

our_file.write('Testing this file')

File "/srv/", line 35, in write

super(FileObjectAwareFile, self).write(data)

TypeError: 'str' does not support the buffer interface

Attachments (1)

0001-Fix-string-related-tests-for-Python3.patch (4.7 KB ) - added by spaetz 9 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by spaetz, 9 years ago

Keywords: patch added
Priority: majorminor

The tests are fixed by the patch that I sent to the mailing list and that I attach here.

comment:2 by berkerpeksag, 9 years ago

Owner: set to berkerpeksag
Status: newin_progress

Patch looks good. I will review it more closely and commit. Thanks!

comment:3 by ShawnRisk, 8 years ago

Owner: berkerpeksag removed
Status: in_progressreview

comment:4 by Boris Bobrov, 8 years ago

E     File "/home/breton/src/mediagoblin/mediagoblin/tests/", line 72                                                                                                          
E       our_file.write('Our file'.encode('utf-8')))                                                                                                                                             
E                                                 ^                                                                                                                                             
E   SyntaxError: invalid syntax

I'll try to fix this now

comment:5 by Boris Bobrov, 8 years ago

I'm getting now

_____________________________________________________________________________ TestWorkbench.test_destroy_workbench _____________________________________________________________________________
Traceback (most recent call last):
  File "/home/breton/src/mediagoblin/mediagoblin/tests/", line 55, in test_destroy_workbench
TypeError: must be str, not bytes

Need to figure out how to fix it

comment:6 by Boris Bobrov, 8 years ago

Status: reviewaccepted

comment:7 by Christopher Allan Webber, 8 years ago

Resolution: fixed
Status: acceptedclosed

I fixed this.

Note: See TracTickets for help on using tickets.