Skip to content

Commit

Permalink
Fix uploading files in Python 2 (#229)
Browse files Browse the repository at this point in the history
Fix uploading files in Python 2
  • Loading branch information
szymon-kuklewicz authored Apr 20, 2020
1 parent a4990a8 commit badf988
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion neptune/internal/storage/datastream.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import os
import stat
import tarfile
import six

from future.builtins import object

Expand All @@ -32,7 +33,11 @@ def __init__(self, data, start, end):

def get_data(self):
if isinstance(self.data, str):
return io.StringIO(self.data)
# pylint: disable=undefined-variable
if six.PY3:
return io.StringIO(self.data)
else:
return io.StringIO(unicode(self.data))
else:
return io.BytesIO(self.data)

Expand Down
2 changes: 1 addition & 1 deletion tests/neptune/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
# limitations under the License.
#

import ntpath
import os.path
import sys
import unittest
from random import randint
import ntpath

import pandas as pd
from mock import MagicMock, patch
Expand Down

0 comments on commit badf988

Please sign in to comment.