Kuoxsr / spindex

A personal tool to generate sounds.json from a folder structure
0 stars 0 forks source link

Regression in handle_command_line #14

Closed Kuoxsr closed 6 months ago

Kuoxsr commented 6 months ago

One of my makeshift debugging run conditions throws the following error:

Traceback (most recent call last):
  File "/usr/share/pycharm/plugins/python-ce/helpers/pydev/pydevd.py", line 1551, in _exec
    runpy._run_module_as_main(module_name, alter_argv=False)
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File ".../sound-pack-indexer/sound-pack-indexer.py", line 512, in <module>
    main()
  File ".../sound-pack-indexer/sound-pack-indexer.py", line 411, in main
    args = handle_command_line()
           ^^^^^^^^^^^^^^^^^^^^^
  File ".../sound-pack-indexer/sound-pack-indexer.py", line 113, in handle_command_line
    if tgt := validate_target(args.target):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../sound-pack-indexer/sound-pack-indexer.py", line 132, in validate_target
    if path.resolve() is None:
       ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'resolve'

Process finished with exit code 1

The debug environment is called "local-test-failure." It sets a working directory of test/failure/team and has no arguments. The issue is a regression that happened during commit bef0bb3. I carelessly rendered paths that could be None... d'Oh! This is why I need unit testing, ASAP!