Skip to content

PYTHONHUNTER="stdlib=False,Q(filename_contains='venv')" is invalid #89

Open

Description

@abitrolly

Running a script with PYTHONHUNTER="stdlib=False,Q(filename_contains='venv')" python a_script.py produces this error.

Failed to load hunter from PYTHONHUNTER environ variable "stdlib=False,Q(filename_contains='venv')": SyntaxError('positional argument follows keyword argument', ('<string>', 1, 47, "trace(stdlib=False,Q(filename_contains='venv'))"))
Failed to load hunter from PYTHONHUNTER environ variable "stdlib=False,Q(filename_contains='venv')": SyntaxError('positional argument follows keyword argument', ('<string>', 1, 47, "trace(stdlib=False,Q(filename_contains='venv'))"))

Activity

  1. ionelmc commented on Jan 17, 2021

    @ionelmc
    Owner

    Unfortunately hunter doesn't have a custom parser, it just uses python. Therefore you must obey python syntax - you can't give a positional argument after a keyword one. Try Q(filename_contains='venv'),stdlib=False instead.

  2. abitrolly commented on Jan 17, 2021

    @abitrolly
    ContributorAuthor

    Do you mean it uses some kind of Python eval to parse the string as function argument?

  3. ionelmc commented on Jan 17, 2021

    @ionelmc
    Owner

    Yeeep.

  4. ionelmc commented on Jan 17, 2021

    @ionelmc
    Owner

    Maybe in the future there will be a fancy parser but it's a big feature.

  5. abitrolly commented on Jan 17, 2021

    @abitrolly
    ContributorAuthor

    Strange that Python doesn't ship with some basic parser lib that allows to detect pair braces and stuff.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions