jakbin/filebrowser

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 .

filebrowser -d './' is working without any problems. It's just the default no path version that is buggy.

pip3 install filebrowser
filebrowser
-> Open the page
Screenshot (11)

Nothing is visible
-> Create a folder
Screenshot (13)

We have created one. But it is also invisible
Screenshot (14)

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.2

from 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

if pl == 'Windows':

'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.