wimleers / fileconveyor

File Conveyor is a daemon written in Python to detect, process and sync files. In particular, it's designed to sync files to CDNs. Amazon S3 and Rackspace Cloud Files, as well as any Origin Pull or (S)FTP Push CDN, are supported. Originally written for my bachelor thesis at Hasselt University in Belgium.
https://wimleers.com/fileconveyor
The Unlicense
340 stars 95 forks source link

Error: ''cStringIO.StringO' object has no attribute 'content_type''. #109

Closed satheshf12000 closed 11 years ago

satheshf12000 commented 12 years ago

I'm getting the following error for every file that it is trying to transport when I start the arbitrator.py script:

2012-03-25 22:34:03,532 - Arbitrator.Transporter - ERROR - The transporter 'mosso' has failed while transporting the file '/tmp/fileconveyor/home/gallery/public_html/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/help/images/admin/content/types/add-content-type-link_1331802684.png' (action: 1). Error: ''cStringIO.StringO' object has no attribute 'content_type''.

Config.xml seems to be fine. Don't know what am I doing wrong. I'm not familiar with python at all.

Any help is really appreciated guys.

Thank you.

JoyceBabu commented 12 years ago

I am also getting the same error message.

chrisivens commented 12 years ago

I found that in django-storages/backends/mosso.py there was a property being set on a file the is causing it.

class CloudStorageDirectory(File):
    """
    A File-like object that creates a directory at cloudfiles
    """

    def __init__(self, name):
        super(CloudStorageDirectory, self).__init__(StringIO(), name=name)
        self.file.content_type = 'application/directory'
        self.size = 0

    def __str__(self):
        return 'directory'

    def __nonzero__(self):
        return True

    def open(self, mode=None):
        self.seek(0)

    def close(self):
        pass

It's the self.file.content_type = 'application/directory' line. I simply set it to self.content_type = 'application/directory' but that's probably not right but it prevents the error.

wimleers commented 11 years ago

This is a duplicate of #102, fixed in #118.