Skip to content

[prerelease] ExceptionInfo.traceback[...].path changed from py.path to pathlib.Path #9423

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
The-Compiler opened this issue Dec 17, 2021 · 3 comments · Fixed by #9451
Closed
Assignees
Labels
type: regression indicates a problem that was introduced in a release which was working previously
Milestone

Comments

@The-Compiler
Copy link
Member

As for the ExceptionInfo.traceback[...].path one: The PR looks good, but it seems to me that we should retain and perhaps deprecate the path attribute properly, instead of (more or less silently) replacing it, despite it being public API)?

Originally posted by @The-Compiler in #9415 (reply in thread)

@The-Compiler The-Compiler added this to the 7.0 milestone Dec 17, 2021
@nicoddemus
Copy link
Member

nicoddemus commented Dec 17, 2021

Can we assess the impact of path of the change from py.path.local to pathlib.Path? If it doesn't break the world, just adding a good note about it in the changelog might be sufficient. I suspect this is rarely used, with a trivial fix, so it might save us time and effort if we can avoid a deprecation cycle.

@Zac-HD Zac-HD added the type: regression indicates a problem that was introduced in a release which was working previously label Dec 18, 2021
@The-Compiler
Copy link
Member Author

At least a quick search seems to suggest that this is only an issue for promise indeed - so perhaps we should go ahead and just add that to the changelog and deprecation docs instead then?

bluetech added a commit to bluetech/pytest that referenced this issue Dec 25, 2021
In 92ba96b we have changed the `path`
attribute to return a `pathlib.Path` instead of `py.path.local` without
a deprecation hoping it would be alright. But these types are somewhat
public, reachable through `ExceptionInfo.traceback`, and broke code in
practice. So restore them in the legacypath plugin and add `Path`
alternatives under a different name - `source_path`.

Fix pytest-dev#9423.
bluetech added a commit to bluetech/pytest that referenced this issue Dec 25, 2021
In 92ba96b we have changed the `path`
attribute to return a `pathlib.Path` instead of `py.path.local` without
a deprecation hoping it would be alright. But these types are somewhat
public, reachable through `ExceptionInfo.traceback`, and broke code in
practice. So restore them in the legacypath plugin and add `Path`
alternatives under a different name - `source_path`.

Fix pytest-dev#9423.
bluetech added a commit to bluetech/pytest that referenced this issue Dec 25, 2021
In 92ba96b we have changed the `path`
attribute to return a `pathlib.Path` instead of `py.path.local` without
a deprecation hoping it would be alright. But these types are somewhat
public, reachable through `ExceptionInfo.traceback`, and broke code in
practice. So restore them in the legacypath plugin and add `Path`
alternatives under a different name - `source_path`.

Fix pytest-dev#9423.
bluetech added a commit to bluetech/pytest that referenced this issue Dec 25, 2021
In 92ba96b we have changed the `path`
attribute to return a `pathlib.Path` instead of `py.path.local` without
a deprecation hoping it would be alright. But these types are somewhat
public, reachable through `ExceptionInfo.traceback`, and broke code in
practice. So restore them in the legacypath plugin and add `Path`
alternatives under a different name - `source_path`.

Fix pytest-dev#9423.
@bluetech
Copy link
Member

We've decided to accept this breaking change. Will send a PR to update the changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression indicates a problem that was introduced in a release which was working previously
Projects
None yet
4 participants