CLI in-place import impossible with virtualenv with python3.5
Steps to reproduce
Hi ! try CLI --in-place import with python3.5 after activate virtualenv :
python api/manage.py import_files c80fbef3-e78b-4a54-bdd9-70f5fa8f5eeb "/var/www/funkwhale/import/" --recursive --noinput --in-place
What happens?
2020-06-02 06:28:17,414 funkwhale_api.config INFO Loaded env file at /var/www/funkwhale/code/config/.env
2020-06-02 06:28:17,414 funkwhale_api.config INFO Running with no plugins
Checking imported paths against settings.MUSIC_DIRECTORY_PATH
For details, please refer to import reference 'cli-2020-06-02T10:28:19.204537+00:00' or URL https://funkwhale.mydom.com/library/c80fbef3-e78b-4a54-bdd9-70f5fa8f5eeb/upload?import=cli-2020-06-02T10%3A28%3A19.204537%2B00%3A00
Traceback (most recent call last):
File "api/manage.py", line 27, in execute_from_command_line(sys.argv)
File "/var/www/funkwhale/code/virtualenv/lib/python3.5/site-packages/django/core/management/init.py", line 381, in execute_from_command_line utility.execute()
File "/var/www/funkwhale/code/virtualenv/lib/python3.5/site-packages/django/core/management/init.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/www/funkwhale/code/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 323, in run_from_argv self.execute(*args, **cmd_options)
File "/var/www/funkwhale/code/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 364, in execute output = self.handle(*args, **options)
File "/var/www/funkwhale/code/api/funkwhale_api/music/management/commands/import_files.py", line 217, in handle for i, entries in enumerate(batch(crawler, options["batch_size"]))
File "/var/www/funkwhale/code/api/funkwhale_api/music/management/commands/import_files.py", line 34, in batch current.append(next(iterable))
File "/var/www/funkwhale/code/api/funkwhale_api/music/management/commands/import_files.py", line 18, in crawl_dir with os.scandir(dir) as scanner:
AttributeError: exit
What is expected?
in-place CLI import works successful
Context
Funkwhale version(s) affected: 0.21 Non-Docker YunoHost 3.8 (GNU/Linux Debian Stretch) with nginx and virtualenv with python3.5
I think it's due to outdated python (v3.5 in my Yunohost Stretch), I've tried to modify some python script and errors type like "as" instead "=" are appeared (I'm not python developper but it seems due to python version because in python3.6 "=" is replaced by "as", it's just an example).
So I'm not qualified for find and adapt all python scripts, Then I've compiled python3.6 from sources with success but I don't know how rebuild the virtualenv with python3.6 ? Someone could help me ?
I'm waiting for YunoHost 4 (built on Buster with updated python)... But for the moment...
Thanks Ragards