WinError 206 for releases with a lot of files using method2

Issue #184 new
Former user created an issue

A lot of PS3 releases do not work simply because the command line is too long. This can be fixed by actually using commented code in main.py:1915 instead. Do note the missing -n in args, also using UTF-8 should be a good idea.

OLD

        if len(self.store_all_files):
#           global working_temp_dir
#           out = os.path.abspath(os.path.join(working_temp_dir, "all_files.txt"))
#           args += ["-n@%s" % out]
#           with open(out, 'w') as all_files:
#               for afile in self.store_all_files:
#                   all_files.write(afile + os.linesep)
            for afile in self.store_all_files:
                args.append(afile)

NEW

        if len(self.store_all_files):
            ### FIX: FileNotFoundError: [WinError 206] The filename or extension is too long ###
            # on windows there are certain limits, using listfiles should fix this
            # 32767 using CreateProcess
            #  8192 using CMD.EXE
            #  2048 using ShellExecute/Ex
            # https://devblogs.microsoft.com/oldnewthing/?p=41553
            out = os.path.abspath(os.path.join(working_temp_dir, "all_files.txt"))
            args += ["@%s" % out]
            with open(out, 'w', encoding='UTF-8') as all_files:
                for afile in self.store_all_files:
                    all_files.write(afile + os.linesep)

This works with the above modification and fails without it. Guitar_Hero_Warriors_of_Rock_USA_JB_PS3-MOVE Good RAR version detected: 2011-03-02 4.00 mt16

Comments (0)

  1. Log in to comment