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

shutil.rmtree() raises in fake filesystem with Python 3.7 #346

Closed
mrbean-bremen opened this issue Jan 26, 2018 · 0 comments
Closed

shutil.rmtree() raises in fake filesystem with Python 3.7 #346

mrbean-bremen opened this issue Jan 26, 2018 · 0 comments
Labels

Comments

@mrbean-bremen
Copy link
Member

This came up in the latest Travis.CI build: all shutil.rmtree() tests fail like this:

ERROR: test_rmtree (tests.fake_filesystem_shutil_test.FakeShutilModuleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jmcgeheeiv/pyfakefs/tests/fake_filesystem_shutil_test.py", line 69, in test_rmtree
    shutil.rmtree(directory)
  File "/home/travis/virtualenv/python3.7-dev/lib/python3.7/shutil.py", line 485, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/home/travis/virtualenv/python3.7-dev/lib/python3.7/shutil.py", line 400, in _rmtree_safe_fd
    with os.scandir(topfd) as scandir_it:
  File "/home/travis/build/jmcgeheeiv/pyfakefs/pyfakefs/fake_filesystem.py", line 3574, in scandir
    return scandir(self.filesystem, path)
  File "/home/travis/build/jmcgeheeiv/pyfakefs/pyfakefs/fake_scandir.py", line 156, in scandir
    return ScanDirIter(filesystem, path)
  File "/home/travis/build/jmcgeheeiv/pyfakefs/pyfakefs/fake_scandir.py", line 104, in __init__
    self.path = self.filesystem.ResolvePath(path)
  File "/home/travis/build/jmcgeheeiv/pyfakefs/pyfakefs/deprecator.py", line 50, in _new_func
    return func(*args, **kwargs)
  File "/home/travis/build/jmcgeheeiv/pyfakefs/pyfakefs/deprecator.py", line 67, in _old_function
    return func(*args, **kwargs)
  File "/home/travis/build/jmcgeheeiv/pyfakefs/pyfakefs/fake_filesystem.py", line 1865, in resolve_path
    file_path = os.fspath(file_path)
TypeError: expected str, bytes or os.PathLike object, not int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant