New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydocstyle fails on "raise X from Y" #196

Nurdok opened this Issue Jul 2, 2016 · 2 comments


None yet
2 participants
Copy link

Nurdok commented Jul 2, 2016

The reason is that the "from" keyword triggers a "from X import Y" parsing, which fails.

raise RuntimeError() from None
C:\Users\rachum\code\testing_grounds>python  # this syntax is legal in Python 3
Traceback (most recent call last):
  File "", line 1, in <module>
    raise RuntimeError() from None

Traceback (most recent call last):
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\rachum\AppData\Local\Programs\Python\Python35-32\Scripts\pydocstyle.exe\", line 9, in <module>
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 1745, in main
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 1360, in run_pydocstyle
    errors.extend(check((filename,), select=checked_codes))
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 1297, in check
    for error in PEP257Checker().check_source(source, filename):
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 1398, in check_source
    module = parse(StringIO(source), filename)
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 276, in __call__
    return self.parse_module()
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 429, in parse_module
    children = list(self.parse_definitions(Module, all=True))
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 376, in parse_definitions
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 510, in parse_from_import_statement
    is_future_import = self._parse_from_import_source()
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 525, in _parse_from_import_source
  File "c:\users\rachum\appdata\local\programs\python\python35-32\lib\site-packages\", line 501, in check_current
    assert kind_valid and value_valid, msg
Unexpected token at line 2:

In file:

Got kind tk.ENDMARKER
Got value

This comment has been minimized.

Copy link

blueyed commented Sep 5, 2016

Should this be on the 1.1.0 milestone? (

Any progress / insights on this one?


This comment has been minimized.

Copy link

Nurdok commented Sep 5, 2016

This is solved in #200 and it will definitely be in the next release - still working on the PR though. Hopefully it will be done this week.

@Nurdok Nurdok added this to the pydocstyle 1.1.0 milestone Sep 5, 2016

@Nurdok Nurdok closed this in #200 Sep 11, 2016

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