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

MAINT: py3k: remove os.fspath and os.PathLike backports #17473

Merged
merged 2 commits into from
Oct 10, 2020

Conversation

zer0link
Copy link
Contributor

@zer0link zer0link commented Oct 6, 2020

Related to #15986 .
Chain exceptions in "py3k.py" corresponding to exceptions on line 173 as mentioned in this comment.

@mattip
Copy link
Member

mattip commented Oct 7, 2020

Could you show an example of how this exception now looks? It should be easy to call this code with an object that trips it.

@eric-wieser
Copy link
Member

This entire function is completely unreachable - we should just remove it.

@zer0link
Copy link
Contributor Author

zer0link commented Oct 7, 2020

The error stack basically looks the same as before:

  File "test_py3k.py", line 6, in <module>
    test_obj = os_fspath({'test':'test'})
TypeError: expected str, bytes or os.PathLike object, not dict```

@zer0link
Copy link
Contributor Author

zer0link commented Oct 7, 2020

This entire function is completely unreachable - we should just remove it.

Should I remove the function instead?

@eric-wieser
Copy link
Member

The condition if sys.version_info[:2] >= (3, 6): is always true since we don't support python 3.5, so please do - everything in that else can go.

@zer0link
Copy link
Contributor Author

zer0link commented Oct 7, 2020

The condition if sys.version_info[:2] >= (3, 6): is always true since we don't support python 3.5, so please do - everything in that else can go.

Updated based on comment

@zer0link
Copy link
Contributor Author

zer0link commented Oct 8, 2020

Hi, I am having difficulties trying to run the failing tests locally,
is there a document I can refer?

@rossbar
Copy link
Contributor

rossbar commented Oct 8, 2020

is there a document I can refer?

You may find this doc useful: https://numpy.org/doc/stable/dev/development_environment.html#running-tests

@eric-wieser
Copy link
Member

The failures are unrelated, let's try rerunning

@eric-wieser eric-wieser closed this Oct 8, 2020
@eric-wieser eric-wieser reopened this Oct 8, 2020
@eric-wieser eric-wieser changed the title MAINT: Chain exception in py3k.py MAINT: py3k: remove os.fspath and os.PathLike backports Oct 10, 2020
@eric-wieser eric-wieser merged commit 4afd82d into numpy:master Oct 10, 2020
@eric-wieser
Copy link
Member

Thanks @zer0link!

Comment on lines +136 to +137
os_fspath = os.fspath
os_PathLike = os.PathLike
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're looking to make another contribution, it would be great if we could find all the places that use np.compat.os_PathLike and replace them with os.PathLike.

@zer0link
Copy link
Contributor Author

Thanks @eric-wieser , was trying to debug the issue for some time now

@zer0link zer0link deleted the chain-exception branch November 6, 2020 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants