Skip to content

No detailed error log during ErrorLoadingExtension #378

Closed

Description

@FlorianWilhelm

Description of your problem

Just produce e.g. an import error in an extension. When running putup --dsproject ... the error will be:

ERROR: There was an error loading 'pyscaffoldext-dsproject'.
    Please make sure you have installed a version of the extension that is compatible
    with PyScaffold 4.0b3.post1.dev1+ge4a1a38. You can also try unininstalling it.

In order to get to the actual cause of the error putup -vv --dsproject ... should work but due to the fact that ErrorLoadingExtension is a RuntimeError and the fact that the plugins are loaded before the error level is set, thus

  if logger.level <= logging.DEBUG:
      # user surely wants to see the stacktrace
      traceback.print_exc()
  print(f"ERROR: {ex}")

in exceptions2exit does not work as intended.

To solve this one could replace the condition logger.level <= logging.DEBUG and do some partial parsing of sys.argv with https://docs.python.org/3/library/argparse.html#partial-parsing.

Versions and main components

  • PyScaffold Version: current master
  • Python Version: 3.8
  • Operating system: MacOS
  • How did you install PyScaffold: pip

Activity

  1. abravalheri commented on Jan 7, 2021

    @abravalheri
    Collaborator

    Hi @FlorianWilhelm thank you for reporting this bug. It looks like a tricky one... I will try to have a look at it during the weekend (no promises :P).

    Meanwhile, I think this might be solved by pyscaffold/pyscaffoldext-dsproject#10 ...

  2. added this to the v4.0 milestone on Jan 7, 2021
  3. FlorianWilhelm commented on Jan 9, 2021

    @FlorianWilhelm
    MemberAuthor

    This was fixed by @abravalheri. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions