ewerybody / uptpy Goto Github PK
View Code? Open in Web Editor NEWCompact Python FTP Uploader
License: GNU General Public License v3.0
Compact Python FTP Uploader
License: GNU General Public License v3.0
One of the downsides of the manifest file thing is:
If its listed in there its considered to be actually there!
If something that was uploaded by us, enlisted in the manifest is somehow removed on the target we'll still think it's there because we never do another remote scan.
We could mitigate such deletions (and changes that alter the size) with a post upload check.
This would still make the upload available asap AND fix these issues a moment later.
Oh my. So I once thought (early 2022 when I built this) I have issues with some non ASCII file names.
So now I added a test that puts 🤗
into a name and Voilà it worked! I thought it's all good until I performed a scan on some other FTP space than the test area.
Turns out you can set the encoding on the ftplib
FTP object and these emojis and stuff work no problem!
But when you have an é
in a name:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xeb in position 868: invalid continuation byte
But all good1! These can be remidied changing the encoding to latin-1
. Yes? :D
Yes. But then emojies no longer work! 😫
https://stackoverflow.com/q/77089678/469322
Honestly I don't know how we would solve this completely now.
A 1st step: Less directory listing!
I already modified our mkdirs
function no so that it no longer looks up the parent dir of each part of the directory to be created to check for already existing.
Now It just fires the mkd
and catches ftplib.error_perm
with error code 550
. This code is not specifically for "already exists" but close enough. And its faster as well!
Listing for each part of the path is rather expensive.
So under normal circumstances we no longer do directory listing at all on the FTP! 🙌
But we can! Maybe we should drop the option entirely. But then we'd still need a unittest that verifies that update
still works with weird file names.
For kicks I just created a file named tëstfilé🤗.txt
to trip off ANY encoding :D
When uploading it with WinSCP it turned into tëstfilé??.txt
on the server and when copying back tëstfilé%3F%3F.txt
so not event THEY have it solved!
I added uppy
to a HUGO site on May 23, 2022 but didn't think of creating the actual project yet :|
DARN. Now meanwhile there is an uppy on pypi since Jan 9, 2023 Github here
Let's give it another name then. What about
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.