Skip to content

Revert "Merge branch 'fix-import-python-3-5' into 'develop'"

Agate requested to merge revert-6b0e0222 into develop

This reverts merge request !1129 (merged). reopens #1147 (closed) and #1148 (closed)

Unfortunately, this breaks on higher versions of Python with

Starting import of new files…
Traceback (most recent call last):
  File "manage.py", line 27, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/venv/lib/python3.7/site-packages/django/core/management/base.py", line 328, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/venv/lib/python3.7/site-packages/django/core/management/base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "/venv/lib/python3.7/site-packages/django/core/management/commands/shell.py", line 92, in handle
    exec(sys.stdin.read())
  File "<string>", line 28, in <module>
  File "/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 168, in call_command
    return command.execute(*args, **defaults)
  File "/venv/lib/python3.7/site-packages/django/core/management/base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "/app/funkwhale_api/music/management/commands/import_files.py", line 307, in handle
    for i, entries in enumerate(batch(crawler, options["batch_size"])):
  File "/app/funkwhale_api/music/management/commands/import_files.py", line 58, in batch
    current.append(next(iterable))
  File "/app/funkwhale_api/music/management/commands/import_files.py", line 46, in crawl_dir
    yield from dir_scanner(scanner, extensions, recursive, ignored)
  File "/app/funkwhale_api/music/management/commands/import_files.py", line 35, in dir_scanner
    entry, extensions, recursive=recursive, ignored=ignored
  File "/app/funkwhale_api/music/management/commands/import_files.py", line 27, in dir_scanner
    for entry in scanner:
TypeError: 'posix.DirEntry' object is not iterable
Edited by Agate

Merge request reports