Skip to content

Commit 01df4f4

Browse files
IvanLuLyfntninja
authored andcommitted
Fix a Bug While Upload directories in Windows
1 parent 605b213 commit 01df4f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ipfsapi/multipart.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,14 @@ def add_directory(short_path):
441441
mock_file.write(u'')
442442
# Add this directory to those that will be sent
443443
names.append(('files',
444-
(dir_base, mock_file, 'application/x-directory')))
444+
(dir_base.replace(os.sep, '/'), mock_file, 'application/x-directory')))
445445
# Remember that this directory has already been sent
446446
added_directories.add(dir_base)
447447

448448
def add_file(short_path, full_path):
449449
try:
450450
# Always add files in wildcard directories
451-
names.append(('files', (short_name,
451+
names.append(('files', (short_name.replace(os.sep, '/'),
452452
open(full_path, 'rb'),
453453
'application/octet-stream')))
454454
except OSError:

0 commit comments

Comments
 (0)