pylzma

Python Compressed file ended before the end-of-stream marker was reached. But file is not Corrupted

Python Compressed file ended before the end-of-stream marker was reached. But file is not Corrupted Question: i made a simple request code that downloads a file from a Server r = requests.get("https:…/index_en.txt.lzma") index_en= open(‘C:…index_en.txt.lzma’,’wb’) index_en.write(r.content) index_en.close when i now extract the file manually in the directorry with 7zip everything is fine and the file decrippts …

Total answers: 1

python error:IsADirectoryError: [Errno 21] Is a directory

python error:IsADirectoryError: [Errno 21] Is a directory Question: I am trying to decompress a list of .xz file and save them in a single folder,my code is show below import shutil path = "/content/drive/MyDrive/dataset_demo/Posts/" output_path = "/content/sample_data/output/" os.chdir(path) for file_com in os.listdir(path): if file_com.endswith(‘.xz’): with lzma.open(file_com,’rb’) as input: with open(output_path,’wb’) as output: shutil.copyfileobj(input, output) it …

Total answers: 1