-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix s3 cloud compatibility on Local Windows #2698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix s3 cloud compatibility on Local Windows #2698
Conversation
- this change needed whever the current os platform is Windows. In this case the os.path.pathnorm() will not work properly since it treats storage as it is placed in the current system. - without this change, browsing deep path in FileAdmin view such as /admin/fileadmins3/b/xx/yy/zz will response 404 code.
|
Thanks! I still think you don't need |
Yes you are right if it runs on Linux then no need for this PR at all 🥇 But let me clarify this again why the Another reason, for storages other than S3 such as Azure storage, it is capable to be run on both Windows and Linux. i.e the host could be on Linux while the storage is on Windows!! In this case, the
I don't know what do you mean by |
I think this replies to most of my questions! Is there a way to set up Azurite for this scenario and add that test? |
I am working on this, but the current test is not using Azurite, let me see if i can change it to Azurite just like the |
|
Hi 👋 Am I right in thinking that S3FileAdmin always works with posix paths, and that AzureFileAdmin is the only one that needs to be able to understand it might be using Windows for the remote filesystem? If you pass If so then I think |
Yes, u r right
Yes it will
OK then can you tell me how the following example can work on Windows host without on_windows being passed to BaseFileAdmin? if we run this code on Windows host, then BaseFileAdmin will work executed twice (once with on_windws=False to browse S3, and the other one with on_windows=True to browse the local directory that is placed on Windows). maybe you are just get confused with the naming!! if we renamed the parameter into |
|
Looking a bit closer, I think it's a mistake for BaseFileAdmin to know anything about the OS it's on; that's what the *Storage classes seem to be for (LocalFileStorage, AzureStorage, S3Storage). I think:
|
|
Totally agree with you , and now to let this happend we need to move What i suggest is to create a if you confirm the idea , i will start the implmentation right away and add push a new commit |
|
i hope now it is ready for test and approve |
this change needed whever the current os platform is Windows. In this case the os.path.pathnorm() will not work properly since it treats storage as it is placed in the current system.
without this change, browsing deep path in FileAdmin view such as /admin/fileadmins3/b/xx/yy/zz will response 404 code.