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

implement workaround for PyGithub/PyGithub#3179 #1790

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion jupyterlab_vre/component_containerizer/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import nbformat as nb
import requests
from github import Github
from github.GithubException import UnknownObjectException
from github.GithubException import UnknownObjectException, GithubException
from jinja2 import Environment, PackageLoader
from notebook.base.handlers import APIHandler
from tornado import web
Expand Down Expand Up @@ -491,6 +491,12 @@ def create_or_update_cell_in_repository(task_name, repository, files_info):
remote_hash = repository.get_contents(path=task_name + '/' + f_name).sha
except UnknownObjectException:
remote_hash = None
except GithubException as e:
# Workaround for https://github.com/PyGithub/PyGithub/issues/3179
if e.status == 404:
remote_hash = None
else:
raise e
logger.debug(f'local_hash: {local_hash}; remote_hash: {remote_hash}')
if remote_hash is None:
repository.create_file(
Expand Down
Loading