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

FakeIOModule.open argument renaming: file_name to file #471

Merged
merged 1 commit into from
Mar 13, 2019

Conversation

kmerenkov
Copy link
Contributor

@kmerenkov kmerenkov commented Mar 13, 2019

Changed argument name in FakeIOModule.open from file_name to file.
It makes pyfakefs compatible with the library atomicwrites that uses kwargs to pass arguments to io.open function.
See https://github.com/untitaker/python-atomicwrites/blob/890e7aed4a1fd3b3724dc64503757617996c3978/atomicwrites/__init__.py#L180

In python documentation argument is also named file:
py3: https://docs.python.org/3/library/functions.html#open
py2: https://docs.python.org/2.7/library/io.html#io.open

Changed attribute name in `FakeIOModule.open` from `file_name` to `file`.
It makes pyfakefs compatible with the library atomicwrites that uses `kwargs` to pass attributes to `io.open` function.
See https://github.com/untitaker/python-atomicwrites/blob/890e7aed4a1fd3b3724dc64503757617996c3978/atomicwrites/__init__.py#L180

In python documentation argument is also named `file`:
py3: https://docs.python.org/3/library/functions.html#open
py2: https://docs.python.org/2.7/library/io.html#io.open
@mrbean-bremen
Copy link
Member

Thanks - this makes sense!

@mrbean-bremen mrbean-bremen merged commit 3465cc1 into pytest-dev:master Mar 13, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants