nicoboss / nsz

NSZ - Homebrew compatible NSP/XCI compressor/decompressor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XCZ Source File Deleted before decompressing on the same output folder as original

maxmag-soft opened this issue · comments

python3 /home/$USER/nsz/nsz.py -D '/media/censoredfolder/CENSOREDGAME[v0].xcz' -w --level 22 --verify --output /media/censoredfolder

             NSZ v4.1   ,;:;;,
                       ;;;;;
               .=',    ;:;;:,
              /_', "=. ';:;:;
              @=:__,  \,;:;:'
                _(\.=  ;:;;'
               `"_(  _/="`
                `"'

/media/censoredfolder/CENSOREDGAME[v0].xcz
Extract TitleID/Version: CENSOREDGAME[v0].xcz => 000censorednumber 0
Delete duplicate: /media/censoredfolder/CENSOREDGAME[v0].xcz
Error while decompressing file: /media/censoredfolder/CENSOREDGAME[v0].xcz
Traceback (most recent call last):
  File "/home/maxmag/nsz/nsz/__init__.py", line 245, in main
    decompress(filePath, outFolder)
  File "/home/maxmag/nsz/nsz/__init__.py", line 67, in decompress
    NszDecompress(filePath, outputDir, statusReportInfo)
  File "/home/maxmag/nsz/nsz/NszDecompressor.py", line 18, in decompress
    __decompressXcz(filePath, outputDir, True, False, statusReportInfo, pleaseNoPrint)
  File "/home/maxmag/nsz/nsz/NszDecompressor.py", line 218, in __decompressXcz
    fileHashes = FileExistingChecks.ExtractHashes(filePath)
  File "/home/maxmag/nsz/nsz/FileExistingChecks.py", line 14, in ExtractHashes
    container.open(str(gamePath), 'rb')
  File "/home/maxmag/nsz/nsz/Fs/Xci.py", line 283, in open
    r = super(Xci, self).open(path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "/home/maxmag/nsz/nsz/Fs/File.py", line 210, in open
    self.f = open(path, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/media/censoredfolder/CENSOREDGAME[v0].xcz'

Summary of errors which occurred while processing files:
Error while processing /media/censoredfolder/CENSOREDGAME[v0].xcz
Traceback (most recent call last):
  File "/home/maxmag/nsz/nsz/__init__.py", line 245, in main
    decompress(filePath, outFolder)
  File "/home/maxmag/nsz/nsz/__init__.py", line 67, in decompress
    NszDecompress(filePath, outputDir, statusReportInfo)
  File "/home/maxmag/nsz/nsz/NszDecompressor.py", line 18, in decompress
    __decompressXcz(filePath, outputDir, True, False, statusReportInfo, pleaseNoPrint)
  File "/home/maxmag/nsz/nsz/NszDecompressor.py", line 218, in __decompressXcz
    fileHashes = FileExistingChecks.ExtractHashes(filePath)
  File "/home/maxmag/nsz/nsz/FileExistingChecks.py", line 14, in ExtractHashes
    container.open(str(gamePath), 'rb')
  File "/home/maxmag/nsz/nsz/Fs/Xci.py", line 283, in open
    r = super(Xci, self).open(path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "/home/maxmag/nsz/nsz/Fs/File.py", line 210, in open
    self.f = open(path, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/media/censoredfolder/CENSOREDGAME[v0].xcz'


Done!

What a stupid issue. I'm really sorry that this happened. I will soon look into this as this is quite a major logical flaw with the potential of data loss. Until this is fixed please don't use "-w", "--overwrite" or " --undupe" when decompressing to the same folder.

Oh! , thank you for the reply, I posted in a hurry, and I was going to look in the source code sometime in the next week to search and post a solution.

I am loving this software, thanks for your work!

This is fixed now. As you can see in 127d0f4 the mistake was caused by accidentally specifying the wrong target file extensions when calling the FileExistingChecks::CreateTargetDict function. Sorry that this happened. This will fix will be in the NSZ v4.1.1 which should be released in the next few days.

This issue should be fixed in the latest NSZ v4.2.0 release. Please let me know if you still experience this issue on the latest release.

I have aleary tried by getting the source code and ran, and the source file os not deleted anymore
This issue is fixed since 127d0f4
Thank you for you hard work!