Opened 20 months ago

#3548 new bug

Torrent files with Macintosh (CR) EOL encoding cause errors

Reported by: nopoz Owned by:
Priority: major Milestone: needs verified
Component: Core Version: 2.1.0
Keywords: Cc:

Description

Using Deluge 2.1.1, but also had this issue on 2.0.5 as well. OS is Alpine Linux (Docker)

I use a torrent site where some torrent files are encoded with Macintosh (CR) EOL format. If I add them to Deluge I get the add dialog box, but they don't show up in the list after the dialog box closes.

If I check the deluge log, I see this error from trying to add the torrent:

02:38:26 [ERROR   ][deluge.core.rpcserver         :1512] type <class 'deluge.error.AddTorrentError'> not handled
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/deluge/core/rpcserver.py", line 168, in sendData
    self.transfer_message(data)
  File "/usr/lib/python3.10/site-packages/deluge/transfer.py", line 53, in transfer_message
    body = zlib.compress(rencode.dumps(data))
  File "rencode/rencode.pyx", line 336, in rencode._rencode.dumps
  File "rencode/rencode.pyx", line 316, in rencode._rencode.encode
  File "rencode/rencode.pyx", line 249, in rencode._rencode.encode_list
  File "rencode/rencode.pyx", line 316, in rencode._rencode.encode
  File "rencode/rencode.pyx", line 249, in rencode._rencode.encode_list
  File "rencode/rencode.pyx", line 322, in rencode._rencode.encode
Exception: type <class 'deluge.error.AddTorrentError'> not handled
02:40:21 [ERROR   ][deluge.core.rpcserver         :1512] type <class 'deluge.error.AddTorrentError'> not handled
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/deluge/core/rpcserver.py", line 168, in sendData

I can see the encoding using Notepad++ in Windows on the bottom right hand bar. If I open this torrent file in Notepad++ then go to "Edit -> EOL Conversion", select "Unix (LF)" and save the file as a new copy, then I can successfully add this modified torrent file to Deluge. The only difference in this conversion are the line's end-of-line characters change from "CR" in the original mac encoding version, to "LF" in the Unix encoded one. It may be challenging for me to add an example torrent file because they are from a private site and it contains my private passkey for the tracker. I tried changing the passkey value in a text editor, but this seemed to break the file completely - it wouldn't open in Deluge at all.

Sorry for the double posting in the forum, I didn't realize I had permissions to post bugs here.

Attachments (2)

original_not_working.jpg (235.7 KB) - added by nopoz 20 months ago.
Original File With CR EOLs
modified_working.jpg (238.0 KB) - added by nopoz 20 months ago.
Modified File With LF EOLs

Download all attachments as: .zip

Change History (2)

Changed 20 months ago by nopoz

Original File With CR EOLs

Changed 20 months ago by nopoz

Modified File With LF EOLs

Note: See TracTickets for help on using tickets.