bug in os.path.join
In ‘utils.py’,
Line 22 curdir = os.path.join(basedir, dir)
Line 42 outfile = open(os.path.join(dest, name), 'wb')
When I unzip a file which has a path in it,

The case fails. “OSError: [Errno 13] Permission denied: '/ram'” That’s because the method ‘os.path.join’ does not work as we expect. For example:
>>> basedir = '/home/ute/ta_kiss_files/example/BTS9_1011_CCNTrace'
>>> dir = '/ram'
>>> curdir = os.path.join(basedir, dir)
>>> print curdir
/ram
After I change the utils.py as below,
Line 22 curdir = os.path.join(basedir, dir)
Change to curdir = basedir + '/' + dir
Line 42 outfile = open(os.path.join(dest, name), 'wb')
Change to outfile = open(dest + '/' + name, 'wb')
Case passes, because,
>>> curdir = basedir + '/' + dir
>>> print curdir
/home/ute/ta_kiss_files/example/BTS9_1011_CCNTrace///ram
>>>
That is what we expect.
@QuellaLiu Thanks, could you please submit PR with your suggested changes?
os.path.join() does work as expected, it is supposed to break the concatenation at the first absolute path. From the docs:
If a component is an absolute path, all previous components are thrown away and joining continues from the absolute path component.
Doing it manually - with basedir + '/' + dir is very dangerous, may easily produce invalid paths (that's why that module and function exist on the first place :)
I suspect it's a combination of the construct in the particulars zip, plus this code in utils.py:56
elif '/' in name:
path = name[0:name.rindex('/')]
dirs.add(path)
Can you please attach the zip file you're seeing the bug for, plus the exact arguments you're calling the keywords/methods with? Thank you.
I submitted a PR several days ago, but can't add any reviewer. I don't know what's the next step. Who will merge the change?
my PR: https://github.com/LiuQiE/robotframework-archivelibrary/pull/1
@LiuQiE you need to submit your PR to this repo.
Sorry! I submitted a PR to this repo just now.
I can see the PR is merged. When will you put the latest version in https://pypi.python.org/pypi/robotframework-archivelibrary ? Thank you very much!
Hi, Bulkan, could you please update https://pypi.python.org/pypi/robotframework-archivelibrary as soon as possible? Thank you!
@tminakov can you please comment on this PR https://github.com/bulkan/robotframework-archivelibrary/pull/30 the change looks good and not manually creating paths, just want a third opinion on it.
any progress on https://pypi.python.org/pypi/robotframework-archivelibrary?