Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] Switch project import to requests-toolbelt#1004

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes fromall 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: 6 additions & 2 deletionsgitlab/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,7 @@
import warnings

import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder

import gitlab.config
from gitlab.const import * # noqa
Expand DownExpand Up@@ -500,9 +501,12 @@ def http_request(

# We need to deal with json vs. data when uploading files
if files:
data = post_data
my_data = post_data
json = None
del opts["headers"]["Content-type"]
my_data["file"] = files["file"]
files = None
data = MultipartEncoder(my_data)
opts["headers"]["Content-type"] = data.content_type
else:
json = post_data
data = None
Expand Down
4 changes: 2 additions & 2 deletionsgitlab/v4/objects.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4792,8 +4792,8 @@ def import_project(
Returns:
dict: A representation of the import status.
"""
files = {"file": ("file.tar.gz", file)}
data = {"path": path, "overwrite": overwrite}
files = {"file": ("file.tar.gz", file, 'application/octet-stream')}
data = {"path": path, "overwrite":str(overwrite)}
if override_params:
for k, v in override_params.items():
data["override_params[%s]" % k] = v
Expand Down
1 change: 1 addition & 0 deletionsrequirements.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
requests>=2.22.0
requests-toolbelt>=0.9.1
2 changes: 1 addition & 1 deletionsetup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,7 @@ def get_version():
license="LGPLv3",
url="https://github.com/python-gitlab/python-gitlab",
packages=find_packages(),
install_requires=["requests>=2.22.0"],
install_requires=["requests>=2.22.0", "requests-toolbelt>=0.9.1"],
python_requires=">=3.6.0",
entry_points={"console_scripts": ["gitlab = gitlab.cli:main"]},
classifiers=[
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp