Skip to content

Commit c3eb372

Browse files
committed
fix the upload bug
1 parent f849371 commit c3eb372

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ml_logger/log_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,23 @@ def stream_download(self, path):
183183
# buf.seek(0)
184184
# return buf
185185

186-
def save_buffer(self, buffer, key):
186+
def save_buffer(self, buff, key):
187187
# proxy = os.environ.get('HTTP_PROXY')
188188
# c.setopt(c.PROXY, proxy)
189189
# logger.print('proxy:', proxy)
190-
if isinstance(buffer, BytesIO):
190+
if isinstance(buff, BytesIO):
191191
from requests_toolbelt import MultipartEncoder
192192
encoder = MultipartEncoder({'file': (key, buf), 'canary': true})
193193
self.session.post(self.url, data=encoder, headers={'Content-Type': encoder.content_type})
194-
elif isinstance(buffer, StringIO):
194+
elif isinstance(buff, StringIO):
195195
from pycurl import Curl
196196
c = Curl()
197197
c.setopt(c.URL, self.url)
198198
c.setopt(c.TIMEOUT, 3600)
199199
c.setopt(c.HTTPPOST, [
200200
('file', (
201201
c.FORM_BUFFER, source_path,
202-
c.FORM_BUFFERPTR, buffer.read(),
202+
c.FORM_BUFFERPTR, buff.read(),
203203
c.FORM_CONTENTTYPE, 'plain/text',
204204
)),
205205
])

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ line-length = 140
6868

6969
[tool.poetry]
7070
name = "ml-logger"
71-
version = "0.10.27"
71+
version = "0.10.28"
7272
description = ""
7373
authors = ["Ge Yang <[email protected]>"]
7474
keywords = ["ml_logger", "visualization", "logging", "debug", "debugging"]

0 commit comments

Comments
 (0)