B
B
BlackHole2016-08-09 23:06:50
Python
BlackHole, 2016-08-09 23:06:50

How to avoid an error when archiving through patoolib?

There was a problem when using the patoolib library, in particular data archiving. I searched the Internet for a solution to the problem, unfortunately without success. Here are two code options:
62876a54b2cf49079e5beae2203eb0d5.png
Both work: option 1 - duplicates the archived file, option 2 - raises an exception and creates an archive with the necessary files inside. Here are the results of the execution:
7508582b3bce486683ace1a90c304493.png
Content of the archives themselves:
Option 1
96a5c1eecbef4289a843c4484bc0fdd5.png
Option 2
4826b365d4f94021a028fbf09cb97dd9.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BlackHole, 2016-08-10
@BlackHole

that's the point (I specifically wrote the archive through ".zip" archiving, so that IDLE showed a warning, if you take the same ".tar" this warning is missing and duplication also occurs), that I don't know how to get away from this duplication. Tried different combinations of paths to avoid it, but only option 2 doesn't duplicate 01.txt and throws an exception.
Code:
Result
If you take the path not including the file, then the entire folder is added to the archive in addition to the specified file:
f28a8b2734084c4898dd1556723ae24b.pngf5f83cd05f164a06a3e4f8cfcb76482d.png3c9ff6f513f84c5c84f33106d7d614e3.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question