Open-MSS / MSS

A QT application, a OGC web map server, a collaboration server to plan atmospheric research flights.
https://open-mss.github.io
Apache License 2.0
62 stars 79 forks source link

In TableView --> Performance Settings Dialog, pressing Load and not selecting any file gives TypeError: expected str, bytes or os.PathLike object, not list #561

Closed ReimarBauer closed 4 years ago

ReimarBauer commented 4 years ago

Original report by Aryan (Bitbucket: [Aryan Gupta](https://bitbucket.org/Aryan Gupta), ).


To duplicate the error, open TableView, and click on Performance Settings. This opens a dialog box . Click the Load button which opens another dialog box to select file.If you press cancel, it throws up the following error : TypeError: expected str, bytes or os.PathLike object, not list.

ReimarBauer commented 4 years ago

Original comment by Joern Ungermann (Bitbucket: joernu76, GitHub: joernu76).


I cannot easily replicate that with develop or stable.

Could you please say, which git revision exhibits the problem and attach the full log/terminal output? Also the output of conda list to see which packages are installed.

ReimarBauer commented 4 years ago

Original comment by Aryan (Bitbucket: [Aryan Gupta](https://bitbucket.org/Aryan Gupta), ).


Issue Replication :

Open MSS → Open TableView → Click on Performance Settings (Bottom left) . This will open the Performance Settings Dialog. Click on Load in the dialog. It opens up the File Choosing Directory.

Directory opened for me is /home/aryan/.config/mss

Try choosing a file. Or do not choose any config file. Press cancel (or the cross at the top of Dialog box). It will throw the following error :

Traceback (most recent call last):
  File "/home/aryan/Desktop/GSoC/mss/mslib/msui/performance_settings.py", line 95, in load_performance
    performance = config_loader(config_file=filename)
  File "/home/aryan/Desktop/GSoC/mss/mslib/utils.py", line 115, in config_loader
    _dirname, _name = os.path.split(config_file)
  File "/home/aryan/anaconda3/envs/mssdev/lib/python3.7/posixpath.py", line 107, in split
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not list
CRITICAL: MSS Version: 1.9.3.
CRITICAL: Python Version: 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0]
CRITICAL: Platform: Linux-4.15.0-111-generic-x86_64-with-debian-buster-sid (('64bit', ''))
CRITICAL: Fatal error: Traceback (most recent call last):
  File "/home/aryan/Desktop/GSoC/mss/mslib/msui/performance_settings.py", line 95, in load_performance
    performance = config_loader(config_file=filename)
  File "/home/aryan/Desktop/GSoC/mss/mslib/utils.py", line 115, in config_loader
    _dirname, _name = os.path.split(config_file)
  File "/home/aryan/anaconda3/envs/mssdev/lib/python3.7/posixpath.py", line 107, in split
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not list

ReimarBauer commented 4 years ago

Original comment by Aryan (Bitbucket: [Aryan Gupta](https://bitbucket.org/Aryan Gupta), ).


Here is the output of conda list :

# packages in environment at /home/aryan/anaconda3/envs/mssdev:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
alabaster                 0.7.12                   py37_0  
apipkg                    1.5                      py37_0  
appdirs                   1.4.3            py37h28b3542_0  
argcomplete               1.10.2                     py_0  
argon2_cffi               19.1.0           py37h7b6447c_0  
asn1crypto                1.3.0                    py37_0  
attrs                     19.3.0                     py_0  
babel                     2.8.0                      py_0  
basemap                   1.2.0            py37h705c2d8_0  
bcrypt                    3.1.7            py37h7b6447c_0  
blas                      1.0                         mkl  
bzip2                     1.0.8                h7b6447c_0  
ca-certificates           2020.1.1                      0  
certifi                   2020.4.5.1               py37_0  
cffi                      1.14.0           py37h2e261b9_0  
cftime                    1.0.4.2          py37hdd07704_0  
chameleon                 3.6.2                      py_0  
chardet                   3.0.4                 py37_1003  
click                     7.0                      py37_0  
coverage                  5.0              py37h7b6447c_0  
cryptography              2.8              py37h1ba5d50_0  
curl                      7.67.0               hbc83047_0  
cycler                    0.10.0                   py37_0  
dbus                      1.13.12              h746ee38_0  
defusedxml                0.6.0                      py_0  
docutils                  0.16                     py37_0  
entrypoints               0.3                      py37_0  
execnet                   1.7.1                      py_0  
expat                     2.2.6                he6710b0_0  
fastkml                   0.11                       py_1    conda-forge
flake8                    3.7.9                    py37_0  
flask                     1.1.1                      py_0  
flask-httpauth            3.3.0                      py_0    conda-forge
flask-socketio            4.2.1                      py_0  
flask-sqlalchemy          2.4.1                      py_0  
fontconfig                2.13.0               h9420a91_0  
freetype                  2.9.1                h8a8886c_1  
fs                        2.4.11                   py37_0    conda-forge
fs.sshfs                  0.12.2                   py37_0    conda-forge
fs.webdavfs               0.3.7                    py37_0    conda-forge
fs_filepicker             0.3.7                    py37_3    conda-forge
furl                      2.1.0                      py_0  
future                    0.18.2                   py37_0  
geos                      3.6.2                heeff764_2  
git                       2.23.0          pl526hacde149_0  
gitdb2                    2.0.6                      py_0  
gitpython                 3.0.5                      py_0  
glib                      2.63.1               h5a9c865_0  
gst-plugins-base          1.14.0               hbbd80ab_1  
gstreamer                 1.14.0               hb453b48_1  
hdf4                      4.2.13               h3ca952b_2  
hdf5                      1.10.4               hb1b8bf9_0  
humanfriendly             6.1                      py37_0  
icu                       58.2                 h9c2bf20_1  
idna                      2.8                      py37_0  
imagesize                 1.2.0                      py_0  
importlib_metadata        1.5.0                    py37_0  
intel-openmp              2020.0                      166  
isodate                   0.6.0                      py_1  
itsdangerous              1.1.0                    py37_0  
jinja2                    2.11.1                     py_0  
jpeg                      9b                   h024ee3a_2  
jplephem                  2.13               pyhb958827_0    conda-forge
kiwisolver                1.1.0            py37he6710b0_0  
krb5                      1.16.4               h173b8e3_0  
ld_impl_linux-64          2.33.1               h53a641e_7  
libcurl                   7.67.0               h20c2e04_0  
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 9.1.0                hdf63c60_0  
libgfortran-ng            7.3.0                hdf63c60_0  
libnetcdf                 4.6.1                h11d0813_2  
libpng                    1.6.37               hbc83047_0  
libpq                     11.2                 h20c2e04_0  
libsodium                 1.0.16               h1bed415_0  
libssh2                   1.8.2                h1ba5d50_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
libtiff                   4.1.0                h2733197_0  
libuuid                   1.0.3                h1bed415_2  
libxcb                    1.13                 h1bed415_1  
libxml2                   2.9.9                hea5a465_1  
libxslt                   1.1.33               h7d1a2b0_0  
lxml                      4.5.0            py37hefd8a0e_0  
markupsafe                1.1.1            py37h7b6447c_0  
matplotlib                3.0.2            py37h5429711_0  
mccabe                    0.6.1                    py37_1  
mkl                       2020.0                      166  
mkl-service               2.3.0            py37he904b0f_0  
mkl_fft                   1.0.15           py37ha843d7b_0  
mkl_random                1.1.0            py37hd6b4f25_0  
mock                      4.0.1                      py_0  
more-itertools            8.2.0                      py_0  
multidict                 4.7.3            py37h7b6447c_0  
ncurses                   6.2                  he6710b0_0  
netcdf4                   1.4.2            py37h808af73_0  
numpy                     1.18.1           py37h4f9e942_0  
numpy-base                1.18.1           py37hde5b4d6_1  
olefile                   0.46                     py37_0  
openssl                   1.1.1g               h7b6447c_0  
orderedmultidict          1.0.1                    py37_0  
owslib                    0.18.0                     py_0  
packaging                 20.1                       py_0  
paramiko                  2.7.1                      py_0  
passlib                   1.7.2                      py_0  
pcre                      8.43                 he6710b0_0  
pep8                      1.7.1                    py37_0  
perl                      5.26.2               h14c3975_0  
pillow                    5.4.1            py37h34e0f95_0  
pint                      0.11                       py_0    conda-forge
pip                       20.0.2                   py37_1  
pluggy                    0.13.1                   py37_0  
proj4                     5.2.0                he6710b0_1  
property-cached           1.6.3                      py_0    conda-forge
psycopg2                  2.8.4            py37h1ba5d50_0  
py                        1.8.1                      py_0  
pycodestyle               2.5.0                    py37_0  
pycparser                 2.19                     py37_0  
pyflakes                  2.1.1                    py37_0  
pygeoif                   0.7                        py_1    conda-forge
pygments                  2.5.2                      py_0  
pynacl                    1.3.0            py37h7b6447c_0  
pyopenssl                 19.1.0                   py37_0  
pyparsing                 2.4.6                      py_0  
pyproj                    1.9.6            py37h14380d9_0  
pyqt                      5.9.2            py37h05f1152_2  
pyshp                     2.1.0                      py_0  
pysocks                   1.7.1                    py37_0  
pytest                    5.3.5                    py37_0  
pytest-cache              1.0                      py37_1  
pytest-cov                2.8.1                      py_0  
pytest-flake8             1.0.4                    py37_0    conda-forge
pytest-pep8               1.0.6                    py37_1  
python                    3.7.6                h0371630_2  
python-dateutil           2.8.1                      py_0  
python-engineio           3.9.3                      py_0  
python-socketio           4.3.1                      py_0  
pytz                      2019.3                     py_0  
qt                        5.9.7                h5867ecd_1  
readline                  7.0                  h7b6447c_5  
requests                  2.22.0                   py37_1  
scipy                     1.4.1            py37h0b6359f_0  
setuptools                45.2.0                   py37_0  
sgp4                      2.3                pyh5ca1d4c_0    conda-forge
sip                       4.19.8           py37hf484d3e_0  
six                       1.14.0                   py37_0  
skyfield                  1.17                       py_2    conda-forge
smmap2                    2.0.5                    py37_0  
snowballstemmer           2.0.0                      py_0  
sphinx                    2.4.0                      py_0  
sphinx_rtd_theme          0.4.3                      py_0  
sphinxcontrib-applehelp   1.0.1                      py_0  
sphinxcontrib-devhelp     1.0.1                      py_0  
sphinxcontrib-htmlhelp    1.0.2                      py_0  
sphinxcontrib-jsmath      1.0.1                      py_0  
sphinxcontrib-qthelp      1.0.2                      py_0  
sphinxcontrib-serializinghtml 1.1.3                      py_0  
sqlalchemy                1.3.13           py37h7b6447c_0  
sqlite                    3.31.1               h7b6447c_0  
tk                        8.6.8                hbc83047_0  
tornado                   6.0.3            py37h7b6447c_3  
unicodecsv                0.14.1                   py37_0  
urllib3                   1.25.8                   py37_0  
validate_email            1.3                        py_3    conda-forge
wcwidth                   0.1.8                      py_0  
webdavclient2             0.1.1                      py_0    conda-forge
werkzeug                  1.0.0                      py_0  
wheel                     0.34.2                   py37_0  
xz                        5.2.4                h14c3975_4  
zipp                      2.2.0                      py_0  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.3.7                h0b5b093_0  

ReimarBauer commented 4 years ago

Original comment by Reimar Bauer (Bitbucket: ReimarBauer, GitHub: ReimarBauer).


hmm, on this traceback we have used os. instead of fs.

ReimarBauer commented 4 years ago

Original comment by Reimar Bauer (Bitbucket: ReimarBauer, GitHub: ReimarBauer).


We should look on just this line.

Can you provide the config_file name and than we can try

import os

_dirname, _name = os.path.split(config_file)

btw. which operating system do you use?

ReimarBauer commented 4 years ago

Original comment by Aryan (Bitbucket: [Aryan Gupta](https://bitbucket.org/Aryan Gupta), ).


The config_file name is “mss_settings.json”.

I am using Ubuntu 18.04.

ReimarBauer commented 4 years ago

Original comment by Joern Ungermann (Bitbucket: joernu76, GitHub: joernu76).


Can you please add a

logging.info("config_file: '%s'", config_file)

just before the point where it fails in file /home/aryan/Desktop/GSoC/mss/mslib/utils.py i.e. in between lines 114/115 and show us the output upon failure?

I’d like to know what kind of data structure it tries to open there. Maybe, for some reason an empty list is returned?

If you press cancel, the Dialogue should return None and the failing code should thus not be executed. Did you change your file picker type away from the default to “fs”?

You didn’t mention with what version of mss this problem occurs.

ReimarBauer commented 4 years ago

Original comment by Joern Ungermann (Bitbucket: joernu76, GitHub: joernu76).


Okay found it.

This only happens in your branch. You broke it.

ReimarBauer commented 4 years ago

Original comment by Joern Ungermann (Bitbucket: joernu76, GitHub: joernu76).


I move the discussion to your merge request.

ReimarBauer commented 4 years ago

Original comment by Joern Ungermann (Bitbucket: joernu76, GitHub: joernu76).


Doesn't affect either develop or stable.

ReimarBauer commented 4 years ago

Original comment by Reimar Bauer (Bitbucket: ReimarBauer, GitHub: ReimarBauer).


from the scope of stable or develop branch this is an invalid issue

ReimarBauer commented 4 years ago

Original comment by Joern Ungermann (Bitbucket: joernu76, GitHub: joernu76).


Fixes Issue #561 : added separate functions for opening multiple files

ReimarBauer commented 4 years ago

Original comment by Reimar Bauer (Bitbucket: ReimarBauer, GitHub: ReimarBauer).


removed the milestone