Title: v2.7.0 breaks when trying to get pathed files · Issue #1416 · python-gitlab/python-gitlab · GitHub
Open Graph Title: v2.7.0 breaks when trying to get pathed files · Issue #1416 · python-gitlab/python-gitlab
X Title: v2.7.0 breaks when trying to get pathed files · Issue #1416 · python-gitlab/python-gitlab
Description: Description of the problem, including code/CLI snippet when trying to from gitlab import Gitlab project=Gitlab(GITLAB_SRC).projects.get(GITLAB_PROJECT_ID) project.files.get(file_path=PATH_TO_FILE, ref=GITLAB_REF) where PATH_TO_FILE is in...
Open Graph Description: Description of the problem, including code/CLI snippet when trying to from gitlab import Gitlab project=Gitlab(GITLAB_SRC).projects.get(GITLAB_PROJECT_ID) project.files.get(file_path=PATH_TO_FILE, ...
X Description: Description of the problem, including code/CLI snippet when trying to from gitlab import Gitlab project=Gitlab(GITLAB_SRC).projects.get(GITLAB_PROJECT_ID) project.files.get(file_path=PATH_TO_FILE, ...
Opengraph URL: https://github.com/python-gitlab/python-gitlab/issues/1416
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"v2.7.0 breaks when trying to get pathed files","articleBody":"## Description of the problem, including code/CLI snippet\r\n\r\nwhen trying to \r\n\r\n```python\r\nfrom gitlab import Gitlab\r\nproject=Gitlab(GITLAB_SRC).projects.get(GITLAB_PROJECT_ID)\r\nproject.files.get(file_path=PATH_TO_FILE, ref=GITLAB_REF)\r\n```\r\n\r\nwhere `PATH_TO_FILE` is in the form of `{directory}/{filename}`, client returns not found error. (see github action: https://github.com/xgui3783/python-gitlab-exmaple/actions/runs/786113706)\r\n\r\nI suspect this is due to double escaping the `/` character from:\r\n- `GetMixin.get` (https://github.com/python-gitlab/python-gitlab/blob/8933113/gitlab/mixins.py#L104) and \r\n- `ProjectFileManager.get` (https://github.com/python-gitlab/python-gitlab/blob/89331131b3337308bacb0c4013e80a4809f3952c/gitlab/v4/objects/files.py#L97)\r\n\r\n## Expected Behavior\r\n\r\nreturn file descriptor\r\n\r\n## Actual Behavior\r\n\r\nnot found error\r\n\r\n## Specifications\r\n\r\n - python-gitlab version: v2.7.0\r\n - API version you are using (v3/v4): v4\r\n - Gitlab server version (or gitlab.com): gitlab.com\r\n","author":{"url":"https://github.com/xgui3783","@type":"Person","name":"xgui3783"},"datePublished":"2021-04-26T16:02:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/1416/python-gitlab/issues/1416"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fd4a13cb-5e9b-c089-338b-8c471f1c9f67 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B234:840BE:76B250:A4795C:6971E99E |
| html-safe-nonce | 3a86164e2f3a0ee84494f78d5077545e367e4397c433c0f37df547d41e381e71 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjM0Ojg0MEJFOjc2QjI1MDpBNDc5NUM6Njk3MUU5OUUiLCJ2aXNpdG9yX2lkIjoiNDc1NzI4NzY3NDk3ODYyNTk1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bdea4731eec506bf2ae38b9b67fdb02f22f36eb1088fd7166818b948cc7741a4 |
| hovercard-subject-tag | issue:867870934 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-gitlab/python-gitlab/1416/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bdcfdd0db3632ef9fbd92fb4d62aa62024149786dc4956fa4e0b2de2c93b1926/python-gitlab/python-gitlab/issues/1416 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bdcfdd0db3632ef9fbd92fb4d62aa62024149786dc4956fa4e0b2de2c93b1926/python-gitlab/python-gitlab/issues/1416 |
| og:image:alt | Description of the problem, including code/CLI snippet when trying to from gitlab import Gitlab project=Gitlab(GITLAB_SRC).projects.get(GITLAB_PROJECT_ID) project.files.get(file_path=PATH_TO_FILE, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xgui3783 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 683712716975b3393656edf09255a1d488d0e68ab7b9ac97e40ecf40036f696c |
| turbo-cache-control | no-preview |
| go-import | github.com/python-gitlab/python-gitlab git https://github.com/python-gitlab/python-gitlab.git |
| octolytics-dimension-user_id | 28886265 |
| octolytics-dimension-user_login | python-gitlab |
| octolytics-dimension-repository_id | 8077625 |
| octolytics-dimension-repository_nwo | python-gitlab/python-gitlab |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 8077625 |
| octolytics-dimension-repository_network_root_nwo | python-gitlab/python-gitlab |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ed99da4e2de688dd1056894c1eccd4c82c6bbbfe |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width