jmason86 / MinXSS_Beacon_Decoder

Beacon decoder for the MinXSS CubeSat in space; MinXSS-2 launch on 2018-11-19
http://lasp.colorado.edu/home/minxss
GNU General Public License v3.0
11 stars 6 forks source link

Windows: upload filename #28

Closed K4KDR closed 5 years ago

K4KDR commented 5 years ago

After a successful test of the app (v2.0.2) on Windows-7 (64-bit), I noticed an anomaly in the log file related to the file name used by the upload process:

windows-logfile-filename-issue

... in the linux version, the proper file name of the current telemetry decode is used. In Windows, it simply says, "filename".

jmason86 commented 5 years ago

Well that's really weird. And I don't see any file on the server from that time either. Will have a deeper look soon.

K4KDR commented 5 years ago

Just a Windows FYI: after moving all the files to

C:\Users\{username}\MinXSS_Beacon_Decoder

... the application continued to work properly but the "filename" placeholder continues to be used when the upload is triggered (as seen in the LOG file).

A reminder that I'm on Python 3.7 if that changes anything about how file_upload.py parses the

file_to_send = {'filename': (filename, open(filename, 'rb'))}

line of code.

jmason86 commented 5 years ago

Just an update. I am working on this issue. I see the same problem in Windows 10, and I even made sure to be using the same exact version of python and requests that I use on macOS. It works on macOS (and Linux for you) but for some reason requests has different behavior on Windows. I've posed the question on stackoverflow and am hoping someone has a good answer else I may have to jury rig something.

jmason86 commented 5 years ago

Fixed! That stackoverflow question resulted in the answer. The problem was that the server can't handle backslashes in the filename. Never saw this before because macOS and Linux use forward slashes but Windows uses . Commit b91049fa824e43e5521aa98c51ecf19ec05be96c adds a couple lines of code to fileupload to force the use of forward slashes, which python is smart enough to understand on all platforms. I've tested this now on macOS and Windows 7 and Windows 10. Closing the issue!