Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtcontrol "*" - 'ascii' codec can't encode character u'\u200b' #112

Open
ryanerwin opened this issue Jul 22, 2021 · 0 comments
Open

rtcontrol "*" - 'ascii' codec can't encode character u'\u200b' #112

ryanerwin opened this issue Jul 22, 2021 · 0 comments

Comments

@ryanerwin
Copy link

There were some other tickets filed for similar issues that imply this may be solved, but I'm still unable to get it working...

  • I have tried using the most recent stable pip2 install version
  • I have tried using the most recent git checkout version from github
  • I have tried changing the relevant instances of import os to from pyrocore.util import os

When I try to run: rtcontrol "*" I get:

UnicodeEncodeError: 'ascii' codec can't encode character u'\u200b' in position 32: ordinal not in range(128)

Here is the complete verbose/debug output.

`./bin/rtcontrol "*" -v --debug`
  File "/home/ryan/SourceInstall/pyrocore/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2852, inload_entry_point
    return ep.load()
  File "/home/ryan/SourceInstall/pyrocore/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, inload
    return self.resolve()
  File "/home/ryan/SourceInstall/pyrocore/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2449, inresolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/ryan/SourceInstall/pyrocore/src/pyrocore/scripts/rtcontrol.py", line 30, in <module>
    from pyrocore.util import os, fmt, osmagic, pymagic, matching, xmlrpc
  File "/home/ryan/SourceInstall/pyrocore/src/pyrocore/util/__init__.py", line 22, in <module>
    from pyrocore.util import os
ImportError: cannot import name os
 ~/SourceInstall/pyrocore   master ●  ./bin/rtcontrol "*" -v --debug
DEBUG    Options: alter_view=None, anneal=[], append_view=False, call=None, close=False, column_headers=False, config_dir=None, config_file=[], cron=False, cull=False, custom=None, debug=True, defines=[], delete=False, detach=False, dry_run=False, exec=None, fast_query='=', flush=False, from_view=None, hash_check=False, help_fields=False, ignore=None,interactive=False, json=False, modify_view=None, nul=False, output_format=None, output_template=None, prio=None, purge=False, quiet=False, reverse_sort=False, select=None, shell=False, sort_fields=[], spawn=[], start=False, stats=False, summary=False, tag=None, tee_view=False, throttle=None, to_view=None, verbose=True, view_only=False, yes=False
DEBUG    Loading '/home/ryan/.pyroscope/config.ini'...
DEBUG    Loading '/home/ryan/.pyroscope/config.py'...
DEBUG    Sorting order is: name, alias
DEBUG    Matcher is: name=*
DEBUG    CMD MAPPINGS ARE: {'log=': 'print=', 'log': 'print'}
DEBUG    XMLRPC raw request: "<?xml version='1.0'?>\n<methodCall>\n<methodName>system.client_version</methodName>\n<params>\n</params>\n</methodCall>\n"
DEBUG    system.client_version() took 0.001 secs
DEBUG    XMLRPC raw request: "<?xml version='1.0'?>\n<methodCall>\n<methodName>system.library_version</methodName>\n<params>\n</params>\n</methodCall>\n"
DEBUG    system.library_version() took 0.000 secs
DEBUG    MAPPING for (0, 8, 7) added: {'d.get_down_total': 'd.down.total', 'd.get_up_total': 'd.up.total', 'd.get_up_rate': 'd.up.rate', 'd.save_session': 'd.save_full_session', 'd.get_down_rate': 'd.down.rate', 'd.get_custom': 'd.custom', 'get_name': 'session.name', 'view_filter': 'view.filter', 'session_save': 'session.save', 't.get_url': 't.url', 'view_list': 'view.list', 'get_session': 'session.path', 'system.get_cwd': 'system.cwd', 'd.set_custom': 'd.custom.set', 'd.multicall': 'd.multicall2', 'get_directory': 'directory.default'}
DEBUG    CMD MAPPINGS ARE: {'view_list=': 'view.list=', 'd.get_down_total': 'd.down.total', 'd.get_up_total': 'd.up.total', 'get_name=': 'session.name=', 't.get_url=': 't.url=', 'log=': 'print=', 'session_save=': 'session.save=', 'd.get_up_rate': 'd.up.rate', 'd.save_session': 'd.save_full_session', 'd.get_down_rate': 'd.down.rate', 'd.get_custom': 'd.custom', 'd.multicall': 'd.multicall2', 'view_filter': 'view.filter', 'session_save': 'session.save', 't.get_url': 't.url', 'd.get_down_total=': 'd.down.total=', 'view_list': 'view.list', 'get_session': 'session.path', 'd.get_up_rate=': 'd.up.rate=', 'view_filter=': 'view.filter=', 'system.get_cwd': 'system.cwd', 'd.set_custom=': 'd.custom.set=', 'd.get_custom=': 'd.custom=', 'log': 'print', 'get_session=': 'session.path=', 'd.get_down_rate=': 'd.down.rate=', 'd.set_custom': 'd.custom.set', 'get_name': 'session.name', 'get_directory=': 'directory.default=', 'get_directory': 'directory.default', 'd.save_session=': 'd.save_full_session=', 'd.multicall=': 'd.multicall2=', 'system.get_cwd=': 'system.cwd=', 'd.get_up_total=': 'd.up.total='}
DEBUG    XMLRPC raw request: "<?xml version='1.0'?>\n<methodCall>\n<methodName>session.name</methodName>\n<params>\n</params>\n</methodCall>\n"
DEBUG    session.name() took 0.000 secs
DEBUG    XMLRPC raw request: "<?xml version='1.0'?>\n<methodCall>\n<methodName>system.time_usec</methodName>\n<params>\n</params>\n</methodCall>\n"
DEBUG    system.time_usec() took 0.000 secs
DEBUG    XMLRPC raw request: "<?xml version='1.0'?>\n<methodCall>\n<methodName>session.path</methodName>\n<params>\n</params>\n</methodCall>\n"
DEBUG    session.path() took 0.000 secs
DEBUG    XMLRPC raw request: "<?xml version='1.0'?>\n<methodCall>\n<methodName>directory.default</methodName>\n<params>\n</params>\n</methodCall>\n"
DEBUG    directory.default() took 0.000 secs
DEBUG    RtorrentEngine connected to ri9:4170 [rTorrent 0.9.8/0.13.8, up 1d 19h] via 'scgi://127.0.0.1:5000'
DEBUG    BEFORE MAPPING: (0, u'default', 'd.get_up_total=', 'd.get_down_rate=', 'd.get_tracker_size=', 'd.get_name=','d.get_ratio=', 'd.get_custom=m_alias', 'd.is_active=', 'd.get_custom=tm_loaded', 'd.get_base_path=', 'd.get_tied_to_file=', 'd.is_open=', 'd.is_multi_file=', 'd.get_down_total=', 'd.get_size_bytes=', 'd.get_custom=tm_completed', 'd.get_up_rate=', 'd.get_custom=tm_started', 'd.get_hash=', 'd.is_private=', 'd.get_complete=')
DEBUG    MAP d.get_up_total= ==> d.up.total=
DEBUG    MAP d.get_down_rate= ==> d.down.rate=
DEBUG    MAP d.get_down_total= ==> d.down.total=
DEBUG    MAP d.get_up_rate= ==> d.up.rate=
DEBUG    AFTER MAPPING: (0, u'default', 'd.up.total=', 'd.down.rate=', 'd.tracker_size=', 'd.name=', 'd.ratio=', 'd.custom=m_alias', 'd.is_active=', 'd.custom=tm_loaded', 'd.base_path=', 'd.tied_to_file=', 'd.is_open=', 'd.is_multi_file=', 'd.down.total=', 'd.size_bytes=', 'd.custom=tm_completed', 'd.up.rate=', 'd.custom=tm_started', 'd.hash=', 'd.is_private=', 'd.complete=')
DEBUG    MAP d.multicall ==> d.multicall2
DEBUG    XMLRPC raw request: "<?xml version='1.0'?>\n<methodCall>\n<methodName>d.multicall2</methodName>\n<params>\n<param>\n<value><int>0</int></value>\n</param>\n<param>\n<value><string>default</string></value>\n</param>\n<param>\n<value><string>d.up.total=</string></value>\n</param>\n<param>\n<value><string>d.down.rate=</string></value>\n</param>\n<param>\n<value><string>d.tracker_size=</string></value>\n</param>\n<param>\n<value><string>d.name=</string></value>\n</param>\n<param>\n<value><string>d.ratio=</string></value>\n</param>\n<param>\n<value><string>d.custom=m_alias</string></value>\n</param>\n<param>\n<value><string>d.is_active=</string></value>\n</param>\n<param>\n<value><string>d.custom=tm_loaded</string></value>\n</param>\n<param>\n<value><string>d.base_path=</string></value>\n</param>\n<param>\n<value><string>d.tied_to_file=</string></value>\n</param>\n<param>\n<value><string>d.is_open=</string></value>\n</param>\n<param>\n<value><string>d.is_multi_file=</string></value>\n</param>\n<param>\n<value><string>d.down.total=</string></value>\n</param>\n<param>\n<value><string>d.size_bytes=</string></value>\n</param>\n<param>\n<value><string>d.custom=tm_completed</string></value>\n</param>\n<param>\n<value><string>d.up.rate=</string></value>\n</param>\n<param>\n<value><string>d.custom=tm_started</string></value>\n</param>\n<param>\n<value><string>d.hash=</string></value>\n</param>\n<param>\n<value><string>d.is_private=</string></value>\n</param>\n<param>\n<value><string>d.complete=</string></value>\n</param>\n</params>\n</methodCall>\n"
DEBUG    d.multicall(0, u'default', 'd.up.total=', 'd.down.rate=', 'd.tracker_size=', 'd.name=', 'd.ratio=', 'd.custom=m_alias', 'd.is_active=', 'd.custom=tm_loaded', 'd.base_path=', 'd.tied_to_file=', 'd.is_open=', 'd.is_multi_file=','d.down.total=', 'd.size_bytes=', 'd.custom=tm_completed', 'd.up.rate=', 'd.custom=tm_started', 'd.hash=', 'd.is_private=', 'd.complete=') took 0.086 secs
DEBUG    Got 830 items with 20 attributes from 'ri9:4170' [out 1.4 KiB, in 707.2 KiB, took 22.933ms/85.852ms]
DEBUG    BEFORE MAPPING: ('AC13962501B6105552E9AB01ED131223B4B8273D', 0, 't.url=', 't.is_enabled=')
DEBUG    AFTER MAPPING: ('AC13962501B6105552E9AB01ED131223B4B8273D', 0, 't.url=', 't.is_enabled=')
DEBUG    XMLRPC raw request: "<?xml version='1.0'?>\n<methodCall>\n<methodName>t.multicall</methodName>\n<params>\n<param>\n<value><string>AC13962501B6105552E9AB01ED131223B4B8273D</string></value>\n</param>\n<param>\n<value><int>0</int></value>\n</param>\n<param>\n<value><string>t.url=</string></value>\n</param>\n<param>\n<value><string>t.is_enabled=</string></value>\n</param>\n</params>\n</methodCall>\n"
DEBUG    t.multicall('AC13962501B6105552E9AB01ED131223B4B8273D', 0, 't.url=', 't.is_enabled=') took 0.001 secs
INFO     Total time: 0.106 seconds.
Traceback (most recent call last):
  File "./bin/rtcontrol", line 11, in <module>
    load_entry_point('pyrocore', 'console_scripts', 'rtcontrol')()
  File "/home/ryan/SourceInstall/pyrocore/src/pyrocore/scripts/rtcontrol.py", line 824, in run
    RtorrentControl().run()
  File "/home/ryan/SourceInstall/pyrocore/src/pyrocore/scripts/base.py", line 268, in run
    self.mainloop()
  File "/home/ryan/SourceInstall/pyrocore/src/pyrocore/scripts/rtcontrol.py", line 634, in mainloop
    matches.sort(key=sort_key, reverse=self.options.reverse_sort)
  File "/home/ryan/SourceInstall/pyrocore/src/pyrocore/torrent/engine.py", line 251, in __get__
    return self.valtype(self._accessor(obj) if self._accessor else obj._fields[self.name])
  File "/home/ryan/SourceInstall/pyrocore/src/pyrocore/torrent/engine.py", line 478, in <lambda>
    matcher=matching.PatternFilter, accessor=lambda o: o._memoize("alias", getattr, o, "tracker"))
  File "/home/ryan/SourceInstall/pyrocore/src/pyrocore/torrent/rtorrent.py", line 130, in _memoize
    value = getter(*args, **kwargs)
  File "/home/ryan/SourceInstall/pyrocore/src/pyrocore/torrent/engine.py", line 251, in __get__
    return self.valtype(self._accessor(obj) if self._accessor else obj._fields[self.name])
UnicodeEncodeError: 'ascii' codec can't encode character u'\u200b' in position 32: ordinal not in range(128)

I think this also causes rtmv to fail...

rtmv "old name à 0206" "new name" -v
WARNING  Found 0 candidate versions
WARNING  Software version cannot be determined!
DEBUG    Options: config_dir=None, config_file=[], cron=False, debug=False, defines=[], dry_run=False, force_incomplete=False, quiet=False, verbose=True
DEBUG    Loading '/home/ryan/.pyroscope/config.ini'...
DEBUG    Loading '/home/ryan/.pyroscope/config.py'...
DEBUG    Loading rtorrent config from '/home/plex/.rtorrent.rc'
DEBUG    rtorrent.rc: scgi_port = 127.0.0.1:5000
DEBUG    RtorrentEngine connected to me:4170 [rTorrent 0.9.8/0.13.8, up 1d 18h] via 'scgi://127.0.0.1:5000'
DEBUG    Got 830 items with 9 attributes from 'ri9:4170' [out 767 bytes, in 385.0 KiB, took 9.977ms/42.231ms]
DEBUG    Item path "/media/old name à 0206" resolved to "/media/old name à 0206"
DEBUG    Found "old name à 0206" for "old name à 0206"
INFO     Moving to "new name"...
DEBUG    Symlinking "/media/old name à 0206"
INFO     Total time: 1.208 seconds.
Traceback (most recent call last):
  File "/usr/local/bin/rtmv", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python2.7/dist-packages/pyrocore/scripts/rtmv.py", line 235, in run
    RtorrentMove().run()
  File "/usr/local/lib/python2.7/dist-packages/pyrocore/scripts/base.py", line 260, in run
    self.mainloop()
  File "/usr/local/lib/python2.7/dist-packages/pyrocore/scripts/rtmv.py", line 217, in mainloop
    assert src1 == src2, 'Item path %r should match %r!' % (src1, src2)
AssertionError: Item path u'/media/old name \xe0 0206' should match u'/media/new name\xe0 0206'!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant