Answer the question
In order to leave comments, you need to log in
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:
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:
Content of the archives themselves:
Option 1
Option 2
Answer the question
In order to leave comments, you need to log in
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:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question