Files are invisible if no path is passed
Closed this issue · 11 comments
Describe the bug
If the filebrowser is called as a main from terminal without a path variable, python main.py
, default path is the script folder. User can create a file or a directory. But, none of these are visible. Files are visible if a path variable is passed, python main.py -d './'
.
How to reproduce
Run the app as main: python main.py
Expected behavior
It should either throw an error NO PATH IS GIVEN ABORTING
or it should display the files.
Please , send screenshot .
Any error in terminal ??
No errors.
* Serving Flask app 'filebrowser.app' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:8080 (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 237-550-731
127.0.0.1 - - [29/May/2022 16:40:52] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [29/May/2022 16:40:52] "GET /static/css/file1.css HTTP/1.1" 200 -
127.0.0.1 - - [29/May/2022 16:40:52] "GET /static/js/jquery.min.js HTTP/1.1" 200 -
127.0.0.1 - - [29/May/2022 16:40:52] "GET /static/css/file.css HTTP/1.1" 200 -
127.0.0.1 - - [29/May/2022 16:40:52] "GET /static/js/main.js HTTP/1.1" 200 -
127.0.0.1 - - [29/May/2022 16:40:52] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [29/May/2022 16:40:52] "GET /static/fonts/MaterialIcons-Regular.570eb838.woff2 HTTP/1.1" 200 -
127.0.0.1 - - [29/May/2022 16:40:52] "POST /load-data HTTP/1.1" 201 -
127.0.0.1 - - [29/May/2022 16:42:56] "POST /new-folder HTTP/1.1" 200 -
127.0.0.1 - - [29/May/2022 16:42:56] "POST /load-data HTTP/1.1" 201 -
Which Python version are you running ?
Run this in Python console
from pathlib import Path
Path.cwd()
And what is output ?
python --version
-> Python 3.10.2
from pathlib import Path
Path.cwd()
-> WindowsPath('C:/Users/USERNAME/AppData/Local/Programs/Python/Python310')
python --version
-> Python 3.10.2from pathlib import Path Path.cwd()
->
WindowsPath('C:/Users/USERNAME/AppData/Local/Programs/Python/Python310')
Run Python console where you are running filebrowser command ?
I have not test this on Windows . So I can't find what is problem ?
You need to debug the filebrowser application .
@hakan-demirli update filebrower to version 1.1.2
pip install filebrowser==1.1.2
filebrowser/filebrowser/funcs.py
Line 38 in 148e05d
'pl' is undefined. You should do something like this:
import sys
...
if sys.platform == "win32":
...
The problem is also gone. I am closing the issue.
@hakan-demirli fixed