[pypy-issue] Issue #3121: pathlib.Path objects are not accepted by os.chdir (pypy/pypy)

Carmen Bianca Bakker issues-reply at bitbucket.org
Fri Nov 22 11:17:18 EST 2019

New issue 3121: pathlib.Path objects are not accepted by os.chdir

Carmen Bianca Bakker:

Piece of code for demonstration:

$ pypy3
Python 3.6.1 (6f7180acecf3, Jul 27 2019, 12:44:44)
[PyPy 7.1.1-beta0 with GCC 9.1.1 20190605 (Red Hat 9.1.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import os
>>>> import pathlib
>>>> os.chdir(pathlib.Path("."))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'PosixPath' does not support the buffer interface

I’ve tried a couple other functions in `os` and `os.path`, but they all seem to work just fine with `pathlib.Path` objects. I’ve tried:

* `os.path.join`
* `os.fspath`
* `os.path.commonpath`
* `os.path.dirname`
* `os.path.isdir`

Running PyPy 3 provided by Fedora 31.

More information about the pypy-issue mailing list