Skip to content

Crash under PyPy 7.0.0 #780

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

Closed
dholth opened this issue Mar 25, 2019 · 9 comments
Closed

Crash under PyPy 7.0.0 #780

dholth opened this issue Mar 25, 2019 · 9 comments
Labels
C: packaging Installation and packaging of Black

Comments

@dholth
Copy link

dholth commented Mar 25, 2019

black v19.3v0, running on PyPy

Python 3.6.1 (dab365a46514, Feb 05 2019, 18:05:11)
[PyPy 7.0.0-alpha0 with GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]

error: cannot format x.py: 'PosixPath' does not support the buffer interface

The file appears to have been reformatted anyway.

PyPy 7.1 has the same issue.

@JelleZijlstra JelleZijlstra added the C: packaging Installation and packaging of Black label May 5, 2019
@JelleZijlstra JelleZijlstra changed the title 'PosixPath' does not support the buffer interface Crash under PyPy 7.0.0 May 5, 2019
@glyph
Copy link
Contributor

glyph commented May 17, 2019

Has this been filed against PyPy as well? This seems like divergent behavior which could be fixed there.

@dholth
Copy link
Author

dholth commented May 17, 2019

Good idea, I reported it there and they were able to reproduce the issue.

@hugovk
Copy link
Contributor

hugovk commented May 17, 2019

@JelleZijlstra
Copy link
Collaborator

So the problematic call looks like os.replace('x.py', pathlib.PosixPath('y.py')). To unblock users of Black, I'd accept a PR that makes our call to os.replace call str() on its arguments first.

@glyph
Copy link
Contributor

glyph commented Aug 4, 2019

Is this still a crasher?

@lietu
Copy link

lietu commented Aug 8, 2019

It just crashed for me, so I guess it is. On PyPy 7.1.1 (on Ubuntu 16.04, pyenv install pypy3.6-7.1.1)

@hugovk
Copy link
Contributor

hugovk commented Aug 9, 2019

I had a go testing Black with pypy3 on Travis CI:

And there's an error installing one of Black's dependencies:

  • Building wheel for typed-ast (setup.py) ... error

https://travis-ci.org/hugovk/black/jobs/567758215#L251

Unfortunately Typed AST doesn't support PyPy3. From Guido:

Yeah, it was never meant to run against PyPy. Once PyPy catches up with
Python 3.8 and we stop caring about 2.7 it should be possible to run mypy
under PyPy -- when run under Python 3.8 or later it uses the stdlib ast
module (which has grown APIs to request type comments and to support
earlier grammar versions (to some extent).

@paugier
Copy link

paugier commented Oct 29, 2019

These kinds of problems (error: cannot format x.py: 'PosixPath' does not support the buffer interface) have been fixed with PyPy3.6 7.2.0 (the first stable release of pypy3.6).

Now, the blocker for PyPy is the new typed-ast dependency (see #727 (comment)).

@JelleZijlstra
Copy link
Collaborator

Sounds like the original issue has been fixed in PyPy. #727 can track PyPy support in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: packaging Installation and packaging of Black
Projects
None yet
Development

No branches or pull requests

6 participants