Lukasa / requests-ftp

An FTP transport adapter for use with the Python Requests library.
Other
69 stars 25 forks source link

Missing StringIO import from ftp.py #14

Closed mocsar closed 9 years ago

mocsar commented 9 years ago

Import is missing from ftp.py: from StringIO import StringIO

aidanlister commented 9 years ago

I think actually it is meant to be BytesIO

But then you get: ValueError: invalid literal for int() with base 10: '226-Options:'

Lukasa commented 9 years ago

Can I see the full traceback, please?

mocsar commented 9 years ago

nlst works what uses BytesIO.

I get this if I use list:

Traceback (most recent call last): File "C:/Users/mocsar/projects/bg-py/bg-converter/src/main.py", line 68, in main() File "C:/Users/mocsar/projects/bg-py/bg-converter/src/main.py", line 57, in main new_files = lst() File "C:/Users/mocsar/projects/bg-py/bg-converter/src/main.py", line 19, in lst resp = s.list('ftp://{}/guglik/'.format(host)) File "C:\Python27\lib\site-packages\requests_ftp\ftp.py", line 25, in list return self.request('LIST', url, _kwargs) File "C:\Python27\lib\site-packages\requests\sessions.py", line 465, in request resp = self.send(prep, _send_kwargs) File "C:\Python27\lib\site-packages\requests\sessions.py", line 573, in send r = adapter.send(request, **kwargs) File "C:\Python27\lib\site-packages\requests_ftp\ftp.py", line 182, in send resp = self.func_table[request.method](path, request) File "C:\Python27\lib\site-packages\requests_ftp\ftp.py", line 234, in list data = StringIO() NameError: global name 'StringIO' is not defined

On Thu, Aug 13, 2015 at 3:48 PM, Cory Benfield notifications@github.com wrote:

Can I see the full traceback, please?

— Reply to this email directly or view it on GitHub https://github.com/Lukasa/requests-ftp/issues/14#issuecomment-130678068.

Lukasa commented 9 years ago

Hmm: are you using the most recent version?

Lukasa commented 9 years ago

Ah, I see, this is fixed in master, I just need to push a new release. Whoops!

Lukasa commented 9 years ago

Should be fixed in v0.3.1.