Skip to content
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

code with async def fails with --verify #293

Closed
afq984 opened this issue Aug 17, 2016 · 4 comments
Closed

code with async def fails with --verify #293

afq984 opened this issue Aug 17, 2016 · 4 comments

Comments

@afq984
Copy link

afq984 commented Aug 17, 2016

yapf cannot --verify this code

# async.py


async def foo():
    pass

Notes:
I found this issue with the PyYapf plugin for sublime text, which uses --verify, which seems not to be a public api though

Application output/ Traceback

yapf --verify async.py
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/yapf/yapflib/verifier.py", line 43, in VerifyCode
    compile(textwrap.dedent(code).encode('UTF-8'), '<string>', 'exec')
  File "<string>", line 4
    async def foo():
                   ^
SyntaxError: unexpected EOF while parsing

During handling of the above exception, another exception occurred:

(omitted)

additional information:

python --version
Python 3.5.2
yapf --version
yapf 0.11.0
yapf --version
yapf 0.11.1

Neither of 0.11.0, 0.11.1 work

@bwendling
Copy link
Member

The --verify option is not meant for normal use, only when debugging yapf itself. Please don't use it. :-)

@afq984
Copy link
Author

afq984 commented Aug 17, 2016

Thanks for the information, reporting to PyYapf.

@bwendling
Copy link
Member

I created this pull request: jason-kane/PyYapf#25

@afq984
Copy link
Author

afq984 commented Aug 17, 2016

haha, thanks. was just about to submit it

underyx added a commit to underyx/coala-bears that referenced this issue Aug 31, 2016
Syntax verification is supposed to be a private feature in yapf, used for
debugging, but they're still defaulting its flag to True on the public
FormatFile function. We need to set it to False to disable syntax error
checking in yapf (which seems to be an unmaintained feature of it, since it
raises exceptions on async/await and py2 print syntax), see discussion at
google/yapf#293

Fixes coala#738
underyx added a commit to underyx/coala-bears that referenced this issue Aug 31, 2016
Syntax verification is supposed to be a private feature in yapf, used
for debugging, but they're still defaulting its flag to True on the
public FormatFile function. We need to set it to False to disable
syntax error checking in yapf (which seems to be an unmaintained
feature of it, since it raises exceptions on async/await and Python 2's
print statement), see discussion at
google/yapf#293

Fixes coala#738
underyx added a commit to underyx/coala-bears that referenced this issue Aug 31, 2016
Syntax verification is supposed to be a private feature in yapf, used
for debugging, but they're still defaulting its flag to True on the
public FormatFile function. We need to set it to False to disable
syntax error checking in yapf (which seems to be an unmaintained
feature of it, since it raises exceptions on async/await and Python 2's
print statement), see discussion at
google/yapf#293

Fixes coala#738
underyx added a commit to underyx/coala-bears that referenced this issue Aug 31, 2016
Syntax verification is supposed to be a private feature in yapf, used
for debugging, but they're still defaulting its flag to True on the
public FormatFile function. We need to set it to False to disable
syntax error checking in yapf (which seems to be an unmaintained
feature of it, since it raises exceptions on async/await and Python 2's
print statement), see discussion at
google/yapf#293

Fixes coala#738
underyx added a commit to underyx/coala-bears that referenced this issue Aug 31, 2016
Syntax verification is supposed to be a private feature in yapf, used
for debugging, but they're still defaulting its flag to True on the
public FormatFile function. We need to set it to False to disable
syntax error checking in yapf (which seems to be an unmaintained
feature of it, since it raises exceptions on async/await and Python 2's
print statement), see discussion at
google/yapf#293

Fixes coala#738
sils pushed a commit to coala/coala-bears that referenced this issue Sep 1, 2016
Syntax verification is supposed to be a private feature in yapf, used
for debugging, but they're still defaulting its flag to True on the
public FormatFile function. We need to set it to False to disable
syntax error checking in yapf (which seems to be an unmaintained
feature of it, since it raises exceptions on async/await and Python 2's
print statement), see discussion at
google/yapf#293

Fixes #738
gosom pushed a commit to gosom/coala-bears that referenced this issue Jul 15, 2017
Syntax verification is supposed to be a private feature in yapf, used
for debugging, but they're still defaulting its flag to True on the
public FormatFile function. We need to set it to False to disable
syntax error checking in yapf (which seems to be an unmaintained
feature of it, since it raises exceptions on async/await and Python 2's
print statement), see discussion at
google/yapf#293

Fixes coala#738
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants