Repository: python-gitlab/python-gitlab (Python)

Issue:
v2.7.0 breaks when trying to get pathed files
## Description of the problem, including code/CLI snippet

when trying to 

```python
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 the form of `{directory}/{filename}`, client returns not found error. (see github action: https://github.com/xgui3783/python-gitlab-exmaple/actions/runs/786113706)

I suspect this is due to double escaping the `/` character from:
-  `GetMixin.get` (https://github.com/python-gitlab/python-gitlab/blob/8933113/gitlab/mixins.py#L104) and 
- `ProjectFileManager.get` (https://github.com/python-gitlab/python-gitlab/blob/89331131b3337308bacb0c4013e80a4809f3952c/gitlab/v4/objects/files.py#L97)

## Expected Behavior

return file descriptor

## Actual Behavior

not found error

## Specifications

  - python-gitlab version: v2.7.0
  - API version you are using (v3/v4): v4
  - Gitlab server version (or gitlab.com): gitlab.com



Discussion:
This might be related to commit b4dac5ce33843cf52badeb9faf0f7f52f20a9a6a done by @em- 
I do notice that this will happen:

```
path/to/file
path%2fto%2ffile
path%252fto%252ffile
```

With this code:
```
    a = "path/to/file"
    print(a)
    a = a.replace("/", "%2f")
    print(a)
    a = urllib.parse.quote(a, safe="")
    print(a)
```
Yes, I think the `get()` override for ProjectFileManager (or at least the extra replace) is unnecessary now that the ID is already url-encoded. @JohnVillalovos are you already working on this? Otherwise I'll be pushing a fix tonight.
Related: https://github.com/python-gitlab/python-gitlab/issues/1356
> @JohnVillalovos are you already working on this? Otherwise I'll be pushing a fix tonight.

@nejch  No. Sorry I am doing my day-job at the moment. So I can't work on it 😢
> > @JohnVillalovos are you already working on this? Otherwise I'll be pushing a fix tonight.
> 
> @nejch No. Sorry I am doing my day-job at the moment. So I can't work on it cry

All good! Just wanted to check, because I'm already looking at this, didn't want us both to work on it at the same time ;)
Thanks for the quick fix! 👏👏👏



Patch:
diff --git a/gitlab/__version__.py b/gitlab/__version__.py
index 8128e31f0..a28b9bcce 100644
--- a/gitlab/__version__.py
+++ b/gitlab/__version__.py
@@ -3,4 +3,4 @@
 __email__ = "gauvainpocentek@gmail.com"
 __license__ = "LGPL3"
 __title__ = "python-gitlab"
-__version__ = "2.7.0"
+__version__ = "2.7.1"
diff --git a/gitlab/v4/objects/files.py b/gitlab/v4/objects/files.py
index 9fe692f5d..5d0401f5d 100644
--- a/gitlab/v4/objects/files.py
+++ b/gitlab/v4/objects/files.py
@@ -94,7 +94,6 @@ def get(self, file_path, ref, **kwargs):
         Returns:
             object: The generated RESTObject
         """
-        file_path = file_path.replace("/", "%2F")
         return GetMixin.get(self, file_path, ref=ref, **kwargs)
 
     @cli.register_custom_action(


Test patch:
diff --git a/gitlab/tests/objects/test_repositories.py b/gitlab/tests/objects/test_repositories.py
new file mode 100644
index 000000000..7c4d77d4f
--- /dev/null
+++ b/gitlab/tests/objects/test_repositories.py
@@ -0,0 +1,49 @@
+"""
+GitLab API:
+https://docs.gitlab.com/ee/api/repositories.html
+https://docs.gitlab.com/ee/api/repository_files.html
+"""
+from urllib.parse import quote
+
+import pytest
+import responses
+
+from gitlab.v4.objects import ProjectFile
+
+file_path = "app/models/key.rb"
+ref = "main"
+
+
+@pytest.fixture
+def resp_get_repository_file():
+    file_response = {
+        "file_name": "key.rb",
+        "file_path": file_path,
+        "size": 1476,
+        "encoding": "base64",
+        "content": "IyA9PSBTY2hlbWEgSW5mb3...",
+        "content_sha256": "4c294617b60715c1d218e61164a3abd4808a4284cbc30e6728a01ad9aada4481",
+        "ref": ref,
+        "blob_id": "79f7bbd25901e8334750839545a9bd021f0e4c83",
+        "commit_id": "d5a3ff139356ce33e37e73add446f16869741b50",
+        "last_commit_id": "570e7b2abdd848b95f2f578043fc23bd6f6fd24d",
+    }
+
+    # requests also encodes `.`
+    encoded_path = quote(file_path, safe="").replace(".", "%2E")
+
+    with responses.RequestsMock() as rsps:
+        rsps.add(
+            method=responses.GET,
+            url=f"http://localhost/api/v4/projects/1/repository/files/{encoded_path}",
+            json=file_response,
+            content_type="application/json",
+            status=200,
+        )
+        yield rsps
+
+
+def test_get_repository_file(project, resp_get_repository_file):
+    file = project.files.get(file_path, ref=ref)
+    assert isinstance(file, ProjectFile)
+    assert file.file_path == file_path