[GH-ISSUE #178] Проблема с кодировкой при наличии русских букв в пути загрузки #130

Closed
opened 2026-10-13 19:49:22 +00:00 by bsakaguchi · 6 comments
Owner

Originally created by @abaistov on GitHub (Jan 16, 2017).
Original GitHub issue: https://github.com/werwolfby/monitorrent/issues/178

ОС Ubuntu 16.01
Возникает следующая ошибка:

FAILED
Exception while execute
Traceback (most recent call last):
  File "/opt/transmission/Moni/monitorrent/plugins/trackers/lostfilm.py", line 575, in execute
    TopicSettings.from_topic(topic))
  File "/opt/transmission/Moni/monitorrent/engine.py", line 315, in add_torrent
    return self.engine.add_torrent(filename, torrent, old_hash, topic_settings)
  File "/opt/transmission/Moni/monitorrent/engine.py", line 86, in add_torrent
    elif self.clients_manager.add_torrent(torrent.raw_content, topic_settings):
  File "/opt/transmission/Moni/monitorrent/plugin_managers.py", line 217, in add_torrent
    return self.default_client.add_torrent(torrent, topic_settings)
  File "/opt/transmission/Moni/monitorrent/plugins/clients/transmission.py", line 109, in add_torrent
    client.add_torrent(base64.b64encode(torrent).decode('utf-8'), **torrent_settings_dict)
  File "/usr/local/lib/python2.7/dist-packages/transmissionrpc/client.py", line 414, in add_torrent
    (arg, val) = argument_value_convert('torrent-add', argument, value, self.rpc_version)
  File "/usr/local/lib/python2.7/dist-packages/transmissionrpc/utils.py", line 153, in argument_value_convert
    return (argument, TR_TYPE_MAP[info[0]](value))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 27-32: ordinal not in range(128)

Originally created by @abaistov on GitHub (Jan 16, 2017). Original GitHub issue: https://github.com/werwolfby/monitorrent/issues/178 ОС Ubuntu 16.01 Возникает следующая ошибка: ``` FAILED Exception while execute Traceback (most recent call last): File "/opt/transmission/Moni/monitorrent/plugins/trackers/lostfilm.py", line 575, in execute TopicSettings.from_topic(topic)) File "/opt/transmission/Moni/monitorrent/engine.py", line 315, in add_torrent return self.engine.add_torrent(filename, torrent, old_hash, topic_settings) File "/opt/transmission/Moni/monitorrent/engine.py", line 86, in add_torrent elif self.clients_manager.add_torrent(torrent.raw_content, topic_settings): File "/opt/transmission/Moni/monitorrent/plugin_managers.py", line 217, in add_torrent return self.default_client.add_torrent(torrent, topic_settings) File "/opt/transmission/Moni/monitorrent/plugins/clients/transmission.py", line 109, in add_torrent client.add_torrent(base64.b64encode(torrent).decode('utf-8'), **torrent_settings_dict) File "/usr/local/lib/python2.7/dist-packages/transmissionrpc/client.py", line 414, in add_torrent (arg, val) = argument_value_convert('torrent-add', argument, value, self.rpc_version) File "/usr/local/lib/python2.7/dist-packages/transmissionrpc/utils.py", line 153, in argument_value_convert return (argument, TR_TYPE_MAP[info[0]](value)) UnicodeEncodeError: 'ascii' codec can't encode characters in position 27-32: ordinal not in range(128) ```
bsakaguchi 2026-10-13 19:49:22 +00:00
Author
Owner

@werwolfby commented on GitHub (Jan 16, 2017):

Ну это ожидаемо, чёрт побери!
Вылечим.

<!-- gh-comment-id:272850998 --> @werwolfby commented on GitHub (Jan 16, 2017): Ну это ожидаемо, чёрт побери! Вылечим.
Author
Owner

@abaistov commented on GitHub (Jan 17, 2017):

на убунте проще использовать python 3.5 - в нем проблема отсутсвует.

<!-- gh-comment-id:273286727 --> @abaistov commented on GitHub (Jan 17, 2017): на убунте проще использовать python 3.5 - в нем проблема отсутсвует.
Author
Owner

@werwolfby commented on GitHub (Jan 17, 2017):

Да я уже к какой-то такой ишью писал, что мол на 3-й питон надо перейти, там таких проблем не будет

<!-- gh-comment-id:273287047 --> @werwolfby commented on GitHub (Jan 17, 2017): Да я уже к какой-то такой ишью писал, что мол на 3-й питон надо перейти, там таких проблем не будет
Author
Owner

@abaistov commented on GitHub (Jan 17, 2017):

в таком случае, не проще ли отказаться от 2 версии, чтобы не тратить на это время? вообщем, лично для меня проблемка более не актуальна :)

<!-- gh-comment-id:273287714 --> @abaistov commented on GitHub (Jan 17, 2017): в таком случае, не проще ли отказаться от 2 версии, чтобы не тратить на это время? вообщем, лично для меня проблемка более не актуальна :)
Author
Owner

@werwolfby commented on GitHub (Jan 17, 2017):

Возможно :) Я уже об этом задумываюсь :)

<!-- gh-comment-id:273287932 --> @werwolfby commented on GitHub (Jan 17, 2017): Возможно :) Я уже об этом задумываюсь :)
Author
Owner

@werwolfby commented on GitHub (Jan 29, 2017):

Фиксается переездом на 3-й питон.

<!-- gh-comment-id:275951076 --> @werwolfby commented on GitHub (Jan 29, 2017): Фиксается переездом на 3-й питон.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
werwolfby/monitorrent#130
No description provided.