SRR-creation issue with Python 3

Issue #38 new
Former user created an issue

I'm using pyrescene to make a srr of Usenet-downloads in case I have to recreate them to use PAR2-files on them.

K:\On_The_Edge_Of_Blade_Runner_Preserv_co_cc>C:\python33\python.exe c:\pyrescene
\bin\srr "On The Edge Of…Blade Runner.sfv" -c -p -z c:\pyrescene\rar -s *.
nfo -s *.srs
************************************************************
WARNING: SRR files for compressed RARs are like SRS files:
         you can never be sure they will reconstruct!
************************************************************
SRR file successfully created.

K:\On_The_Edge_Of_Blade_Runner_Preserv_co_cc>

The "creation" went through without a hitch, but the srr only contains the srr, but no info about the rar-parts.

The filename of the parts contains a unicode-character, U+2026 (horizontal ellipsis). After replacing the ellipsis with three normal dots in the rars' filename, the srr-creation works properly.

I kept the ellipsis in the sfv-filename, and when trying to extract the sfv from the properly created srr, this error is shown:

C:\Users\User\Desktop>C:\python33\python.exe c:\pyrescene\bin\srr "On The Edge O
f…Blade Runner.srr" -x
Traceback (most recent call last):
  File "c:\pyrescene\rescene\srr.py", line 464, in main
    parser.exit(manage_srr(options, infolder, infiles, working_dir))
  File "c:\pyrescene\rescene\srr.py", line 228, in manage_srr
    print("%s: %s" % (efile, result))
  File "C:\python33\lib\encodings\cp850.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2026' in position
15: character maps to <undefined>
Unexpected Error: 'charmap' codec can't encode character '\u2026' in position 15
: character maps to <undefined>

Reproduced with a fresh download of the pyrescene-repository using Python 3.3.4

Comments (4)

  1. Gfy repo owner

    When I try to create with Python 2, I get:

    'ascii' codec can't decode byte 0x85 in position 14: ordinal not in range(128)
    

    When creating with Python32, there is indeed no RAR meta data.

    The .sfv extraction issue is the same with Python 2.7.

    rescene.php cli says 'File successfully extracted', but it is empty. The .NET version crashes as follows: (invalid characters in path)

    Unexpected Error:
    System.ArgumentException: Ongeldige tekens in pad.
       bij System.IO.Path.CheckInvalidPathChars(String path)
       bij System.IO.Path.Combine(String path1, String path2)
       bij ReScene.Program.ExtractFiles(FileInfo srrFileInfo, DirectoryInfo outFolder, Boolean savePath)
       bij ReScene.Program.Main(String[] args)
    

    There is good reason the scene limits their available characters. This won't be high on the priority list since you can work around it. There is a similar issue for actual music scene releases (issue #13), so that will get higher priority than this bug.

  2. vadmium

    Currently SFV files are assumed to use ASCII encoding. Otherwise, we would have to know what encoding was used for the ellipsis character (UTF-8, a Windows code page, etc?).

    Any lines in the SFV that cannot be decoded with ASCII are currently added to an internal list of errors, but the errors are usually ignored, or listed as comment lines. Perhaps they should be reported better.

    I reproduced the extraction error on Linux by setting PYTHONIOENCODING=ascii, so that the output messages and file system encoding are different. Pull Request #16 should fix this particular error.

  3. Gfy repo owner

    Some changes have been added in this regard: https://bitbucket.org/Gfy/pyrescene/commits/e2cb8df41b3a622cb623478aac0556395b094a3e

    It won't always work, but there is an improvement for Python 3.

    >srr.exe "On The Edge Of.Blade Runner.rar"
    Processing file: On The Edge Of\u2026Blade Runner.rar.
    SRR file successfully created.
    
    >srr.exe "On The Edge Of.Blade Runne.srr" -l
    Creating Application:
            pyReScene 0.6
    
    RAR files:
            On The Edge Of?Blade Runner.rar 5657398
    
    >cfv -C
    
    >srr.exe test.sfv
    Referenced file not found: On The Edge Of\x85Blade Runner.rar
    Referenced file not found: On The Edge Of\x85Blade Runner.rar
    SRR creation failed. Aborting.
    
  4. Log in to comment