Lukasa / requests-ftp

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

response codes are of the type string #10

Open chiffa opened 9 years ago

chiffa commented 9 years ago

Which fails a code verification that is common in requests of the type

if r.status_code == 226: myprocess

Lukasa commented 9 years ago

Sounds like a problem. =) If you open a pull request with the fix, I'll happily merge it. =)

adrienbrunet commented 8 years ago

Yop, got the same issue here. Response is returning '226-File' as a status code.

"/blabla/python3.4/site-packages/requests_ftp/ftp.py", line 116, in build_response
    response.status_code = int(code.split()[0])
ValueError: invalid literal for int() with base 10: '226-File'

Will it be valid to add a response.status_code = int(code.split()[0].split('-')[0])

Is the "-File' info important here? This library is a bit far from perfection at the moment but really helpful, thanks for that mates. Hopes this helps..

Lukasa commented 8 years ago

@adrienbrunet This library is definitely far from perfection: it was mostly intended as a joke when I originally wrote it! I'm definitely open to finding someone else to take over maintenance of it and to turn it into something more useful, so if you feel like proposing some pull requests and getting this library up and running into something better, I'll happily consider taking on a maintainer.

adrienbrunet commented 8 years ago

yep, I got that reading the Readme file. I just want to make clear it wasnt a critic, just a fact. I'm eager to help. I havn't found ftp support with python-requests elsewhere... Have I missed something? Or this library is the only one doing that? I already have trouble maintaining django-angular with Jacob Rief, and I know almost nothnig about ftp haha. If I can help, that would be a pleasure but I'm not convinced I'd be a good choice as a maintainer. =)

Lukasa commented 8 years ago

yep, I got that reading the Readme file. I just want to make clear it wasnt a critic, just a fact.

Oh, I know. =) No need to apologise!

Have I missed something?

Not as far as I know.

Regardless, if you'd like to propose a pull request with your fix and a test that validates that this case is fixed, I'll happily merge it.

adrienbrunet commented 8 years ago

Sure men, count on me.