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
b83644f3
Commit
b83644f3
authored
5 years ago
by
Erwan Rouchet
Committed by
Bastien Abadie
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Ensure file-like objects are opened in binary mode for XML uploads
parent
a072d8a5
Branches
remove-setup-py
No related tags found
No related merge requests found
Pipeline
#28170
passed
5 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.rst
+1
-1
1 addition, 1 deletion
README.rst
arkindex/client.py
+6
-1
6 additions, 1 deletion
arkindex/client.py
with
7 additions
and
2 deletions
README.rst
+
1
−
1
View file @
b83644f3
...
...
@@ -201,7 +201,7 @@ Import transcriptions for a page from files in PAGE XML format
.. code:: python
cli.send_xml('ImportTranskribusTranscriptions', id='PAGE_ID', body=open('file.xml'))
cli.send_xml('ImportTranskribusTranscriptions', id='PAGE_ID', body=open('file.xml'
, 'rb'
))
Download full logs for each Ponos task in a workflow
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
...
This diff is collapsed.
Click to expand it.
arkindex/client.py
+
6
−
1
View file @
b83644f3
...
...
@@ -8,6 +8,7 @@ import yaml
from
arkindex.auth
import
TokenSessionAuthentication
from
arkindex.pagination
import
ResponsePaginator
from
arkindex.encoders
import
XMLEncoder
from
io
import
FileIO
from
time
import
sleep
from
urllib.parse
import
urlsplit
,
urlunsplit
...
...
@@ -178,9 +179,13 @@ class ArkindexClient(apistar.Client):
:param str operation_id: An OpenAPI operation ID.
:param body: The XML body.
:type body: str
or bytes
:type body: str
, bytes or a file-like object opened in binary mode
:param kwargs: Other arguments sent to :meth:`ArkindexClient.custom_request`.
"""
if
isinstance
(
body
,
FileIO
):
assert
body
.
mode
==
'
rb
'
,
'
File-like objects should be opened in binary mode
'
return
self
.
custom_request
(
operation_id
,
content
=
body
,
...
...
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