Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
api-client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
api-client
Commits
65beae09
Commit
65beae09
authored
5 years ago
by
Erwan Rouchet
Committed by
Bastien Abadie
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Properly prevent sending XML files opened in text mode
parent
ce528f8c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#28222
canceled
5 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/client.py
+3
-3
3 additions, 3 deletions
arkindex/client.py
with
3 additions
and
3 deletions
arkindex/client.py
+
3
−
3
View file @
65beae09
...
@@ -8,7 +8,7 @@ import yaml
...
@@ -8,7 +8,7 @@ import yaml
from
arkindex.auth
import
TokenSessionAuthentication
from
arkindex.auth
import
TokenSessionAuthentication
from
arkindex.pagination
import
ResponsePaginator
from
arkindex.pagination
import
ResponsePaginator
from
arkindex.encoders
import
XMLEncoder
from
arkindex.encoders
import
XMLEncoder
from
io
import
FileIO
from
io
import
IOBase
,
BufferedIOBase
from
time
import
sleep
from
time
import
sleep
from
urllib.parse
import
urlsplit
,
urlunsplit
from
urllib.parse
import
urlsplit
,
urlunsplit
...
@@ -183,8 +183,8 @@ class ArkindexClient(apistar.Client):
...
@@ -183,8 +183,8 @@ class ArkindexClient(apistar.Client):
:param kwargs: Other arguments sent to :meth:`ArkindexClient.custom_request`.
:param kwargs: Other arguments sent to :meth:`ArkindexClient.custom_request`.
"""
"""
if
isinstance
(
body
,
FileIO
):
if
isinstance
(
body
,
IOBase
):
assert
body
.
mode
==
'
rb
'
,
'
File-like objects should be opened in binary mode
'
assert
isinstance
(
body
,
BufferedIOBase
)
,
'
File-like objects should be opened in binary mode
'
return
self
.
custom_request
(
return
self
.
custom_request
(
operation_id
,
operation_id
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment