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

use pathlib in tools/gh_api.py #12806

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PhanatosZou
Copy link
Contributor

This is related to #12515
This is my first contribution here so please guide me if I'm doing anything wrong.
@Carreau, please review this PR.
Thank you.

@PhanatosZou
Copy link
Contributor Author

Kindly ask if anyone know what's wrong here? Seems like it fails the test with Python 3.8. Any advice on improvement will be appreciated. Thanks!

@MrMino
Copy link
Member

MrMino commented Apr 3, 2021

The CI failure looks unrelated. The failure is here: https://travis-ci.com/github/ipython/ipython/jobs/479778266#L773

@@ -276,8 +276,7 @@ def post_download(project, filename, name=None, description=""):
"""Upload a file to the GitHub downloads area"""
if name is None:
name = Path(filename).name
with open(filename, 'rb') as f:
filedata = f.read()
filedata = Path(filename).read_bytes()
Copy link
Member

Choose a reason for hiding this comment

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

You could improve this method further by making sure it creates Path only once - currently it does twice.

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