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

UserWarning: Unable to parse file ./foobar.py due to not readable #1253

Closed
jedie opened this issue Jul 4, 2020 · 3 comments
Closed

UserWarning: Unable to parse file ./foobar.py due to not readable #1253

jedie opened this issue Jul 4, 2020 · 3 comments
Labels
bug Something isn't working question Further information is requested

Comments

@jedie
Copy link

jedie commented Jul 4, 2020

I get many of this warning with v5.0.0 (Currently the latest available versions)

@timothycrosley
Copy link
Member

Hi @jedie,

Thanks for reaching out! Looking at this: jedie/django-user-secrets@84cd1ca I think the reason is that you repleaced --apply with --atomic which do not intend to perform the same function. Apply is now the default so I believe this should be changed to poetry run isort .

@timothycrosley timothycrosley added the question Further information is requested label Jul 4, 2020
@globau
Copy link

globau commented Jul 5, 2020

I see this too when I use the --atomic switch:

  File "/usr/local/bin/isort", line 8, in <module>
    sys.exit(main())
  File "/opt/isort/lib/python3.7/site-packages/isort/main.py", line 702, in main
    for sort_attempt in attempt_iterator:
  File "/opt/isort/lib/python3.7/site-packages/isort/main.py", line 699, in <genexpr>
    for file_name in file_names
  File "/opt/isort/lib/python3.7/site-packages/isort/main.py", line 98, in sort_imports
    **kwargs,
  File "/opt/isort/lib/python3.7/site-packages/isort/api.py", line 282, in sort_file
    **config_kwargs,
  File "/opt/isort/lib/python3.7/site-packages/isort/api.py", line 138, in sort_stream
    compile(output_stream.read(), content_source, "exec", 0, 1)
io.UnsupportedOperation: not readable

@timothycrosley
Copy link
Member

timothycrosley commented Jul 5, 2020

@jedie as @globau mentioned this did highlight an error in atomic support in some contexts, which has been fixed in the latest 5.0.3 patch release.

Thanks!

~Timothy

@timothycrosley timothycrosley added the bug Something isn't working label Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants