Skip to content

Commit d9543c9

Browse files
committed
set path to / of only filename is given
1 parent 7c46442 commit d9543c9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

qiita_client/qiita_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,14 @@ def push_file_to_central(self, filepath):
841841
elif self._plugincoupling == 'https':
842842
logger.debug('Submitting file %s to qiita server.' % filepath)
843843

844+
# target path, i.e. without filename
845+
dirpath = os.path.dirname(filepath)
846+
if dirpath == "":
847+
dirpath = "/"
848+
844849
self.post(
845850
'/cloud/push_file_to_central/',
846-
files={os.path.dirname(filepath): open(filepath, 'rb')})
851+
files={dirpath: open(filepath, 'rb')})
847852

848853
return filepath
849854

0 commit comments

Comments
 (0)