Answer the question
In order to leave comments, you need to log in
How to get the correct ftp-server content when getting bugs?
There is a raised ftp-server using Golden FTP Server PRO (I have been using it for a long time), but there was a need to constantly transfer files to another PC. The idea arose to write a program in Python 3.4.1 that checks the contents of the folder on your PC and the contents of the ftp-server and, if there are inconsistencies, uploads it to the PC. However, there was a problem with displaying the contents of the ftp-server, the names written in Cyrillic are displayed in shorthand (tried "s.encode().decode()" using different encodings did not help, maybe the combination of encodings was not correct?). The ftplib Python module was used to work with ftp-server. This procedure was performed on the same PC/server. Screenshots of code and results below. Tell me how to get out of this situation.
Code
Result
Answer the question
In order to leave comments, you need to log in
The first google link gives the following:
ftp = ftplib.FTP(...)
ftp.__class__.encoding = sys.getfilesystemencoding()
There was also such a task, although ftp is different, but this solution helped:
Tested on windows 7.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question