MarketSquare / robotframework-archivelibrary

https://github.com/MarketSquare/robotframework-archivelibrary
22 stars 24 forks source link

unzip keyword change #3

Closed poojitha-addanki closed 9 years ago

poojitha-addanki commented 10 years ago

extraction of the zip files creating the directory structure.

bulkan commented 10 years ago

@poojitha-addanki thanks for the merge request but I am unsure in what you're attempting to fix. Could please clarify and provide tests ?

Also it seems there are indentation issues which has broken the existing tests -> https://travis-ci.org/bulkan/robotframework-archivelibrary/jobs/32827302

bbossola commented 9 years ago

The library fails when receives an archive where the folders are not created in the expected sequence, like this one:

$> unzip -l test-with-subfolders.zip 
Archive:  test-with-subfolders.zip
  Length      Date    Time    Name

        0  2014-12-05 16:26   main/zoo/
        0  2014-12-05 16:26   main/foo/
        0  2014-12-05 16:26   main/
     1542  2014-12-05 16:27   main/zoo/testcase-zoo.txt
     1542  2014-12-05 16:27   main/foo/testcase-foo.txt

     3084                     5 files

Note that such file is valid:

$> zip -T test-with-subfolders.zip 
test of test-with-subfolders.zip OK

This is what happens:

Extract Zip File With Unordered Create                                | FAIL |
OSError: [Errno 2] No such file or directory: '/tmp/zipout/main/zoo/'
bulkan commented 9 years ago

@bbossola is that related to this PR ?

bbossola commented 9 years ago

Yes, I think the OP is experiencing this problem: his zip file is not correctly ordered, hence the need to change your library in order to pre-create folders.

The proposed solution is actually overkill, as you correctly pointed out it also breaks the tests, but the issue per se is valid and I guess it can be solved way more easily with some use of the equivalent mkdirs in Python or sorting of the entries before processing

Hope this helps On Dec 6, 2014 6:28 AM, "Bulkan Evcimen" notifications@github.com wrote:

bulkan commented 9 years ago

@bbossola do you mind submitting a PR ?

bbossola commented 9 years ago

done

On 7 December 2014 at 22:36, Bulkan Evcimen notifications@github.com wrote:

@bbossola https://github.com/bbossola do you mind submitting a PR ?

— Reply to this email directly or view it on GitHub https://github.com/bulkan/robotframework-archivelibrary/pull/3#issuecomment-65958978 .