Torrent files with Macintosh (CR) EOL encoding cause errors

General support for problems installing or using Deluge
Post Reply
mr.lite.touch
New User
New User
Posts: 7
Joined: Sun Jun 02, 2019 3:30 am

Torrent files with Macintosh (CR) EOL encoding cause errors

Post by mr.lite.touch »

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:

Code: Select all

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.

Original (Macintosh CR EOL):
original_not_working.jpg
original_not_working.jpg (266.04 KiB) Viewed 630 times
Modified (Unix LF EOL):
modified_working.jpg
modified_working.jpg (266.26 KiB) Viewed 630 times
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Torrent files with Macintosh (CR) EOL encoding cause errors

Post by mhertz »

I seemingly cannot reproduce this though, well I mean if just being mac CR as only culprit. I changed a popular linux iso torrent from unix LF to mac CR with vim and worked fine in deluge. I then fired up my win10 VM and tested portable notepad++ specifically with your described EOL conversion in reverse(unix LF > mac CR), and still fine, so sounds like the EOL conversion fixes some other issue during rewrite that I don't know about sorry. Hmm, you said only change was that CR so dunno afterall.

If you change back to CR in notepad++ then can you reproduce?
Post Reply