Python Forum

Full Version: '>' not supported between instances of 'str' and 'int'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Guys,

I am trying to upload an image to my server using Python:

Function:

def upload_image(image_location, image_name_only):
    ftp_client = ftplib.FTP('site.com')
    ftp_client.connect('user', 'pass')
    file = open(image_location, 'rb')
    ftp_client.storbinary('STOR /home/admin/web/site.com/public_html/images/screenshots/' + image_name_only, file) 
    file.close()                         
    ftp_client.quit()
Function Usage:

upload_image("screenshots\failed\4-site.com-1557162721.5269995.png", "4-site.com-1557162721.5269995.png")
Currently the error is: '>' not supported between instances of 'str' and 'int'

From what i have been reading the error is caused because i'm comparing a string to an int, but i don't compare strings anywhere in the code, can anyone see anything abvious i have missed?

cheers guys

Graham
Is this the full code?

If not could you please include the full code
You need to include the full stacktrace as well.