Show More
@@ -33,7 +33,7 b' from rhodecode.lib import audit_logger, ' | |||
|
33 | 33 | from rhodecode.lib import repo_maintenance |
|
34 | 34 | from rhodecode.lib.auth import HasPermissionAnyApi, HasUserGroupPermissionAnyApi |
|
35 | 35 | from rhodecode.lib.celerylib.utils import get_task_id |
|
36 | from rhodecode.lib.utils2 import str2bool, time_to_datetime, safe_str, safe_int | |
|
36 | from rhodecode.lib.utils2 import str2bool, time_to_datetime, safe_str, safe_int, safe_unicode | |
|
37 | 37 | from rhodecode.lib.ext_json import json |
|
38 | 38 | from rhodecode.lib.exceptions import StatusChangeOnClosedPullRequestError |
|
39 | 39 | from rhodecode.lib.vcs import RepositoryError |
@@ -573,6 +573,7 b' def get_repo_file(request, apiuser, repo' | |||
|
573 | 573 | elif details == 'full': |
|
574 | 574 | extended_info = content = True |
|
575 | 575 | |
|
576 | file_path = safe_unicode(file_path) | |
|
576 | 577 | try: |
|
577 | 578 | # check if repo is not empty by any chance, skip quicker if it is. |
|
578 | 579 | _scm = repo.scm_instance() |
@@ -583,12 +584,12 b' def get_repo_file(request, apiuser, repo' | |||
|
583 | 584 | repo, commit_id, file_path, extended_info=extended_info, |
|
584 | 585 | content=content, max_file_bytes=max_file_bytes, cache=cache) |
|
585 | 586 | except NodeDoesNotExistError: |
|
586 | raise JSONRPCError('There is no file in repo: `{}` at path `{}` for commit: `{}`'.format( | |
|
587 | raise JSONRPCError(u'There is no file in repo: `{}` at path `{}` for commit: `{}`'.format( | |
|
587 | 588 | repo.repo_name, file_path, commit_id)) |
|
588 | 589 | except Exception: |
|
589 | log.exception("Exception occurred while trying to get repo %s file", | |
|
590 | log.exception(u"Exception occurred while trying to get repo %s file", | |
|
590 | 591 | repo.repo_name) |
|
591 | raise JSONRPCError('failed to get repo: `{}` file at path {}'.format( | |
|
592 | raise JSONRPCError(u'failed to get repo: `{}` file at path {}'.format( | |
|
592 | 593 | repo.repo_name, file_path)) |
|
593 | 594 | |
|
594 | 595 | return node |
General Comments 0
You need to be logged in to leave comments.
Login now