N-Coder / studip-fuse

Python FUSE drive for courses and files available through the Stud.IP University Access Portal
GNU General Public License v3.0
20 stars 2 forks source link

'ascii' codec can't encode character '\xe4' in 'Universit\xe4t Passau' on Python 3.5.3 #16

Closed N-Coder closed 5 years ago

N-Coder commented 5 years ago
Starting Studip-Fuse 3.1 83a639f with FUSE 2.9 (libfuse.so.2) running via CPython 3.5.3 on Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
Mounting at / (uid=0, gid=0, pid=0, python pid=29063)
Initializing asyncio event loop...
Opening StudIP session...
Logging in via oauth...
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/__init__.py", line 983, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in position 92: ordinal not in range(128)
Call stack:
  File "/usr/lib/python3.5/threading.py", line 882, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/home/finksim/src/studip-fuse/studip_fuse/launcher/aioimpl/asyncio/main_loop.py", line 31, in start
    root_rp = stack.enter_context(session_context_manager(args, loop, future))
  File "/usr/lib/python3.5/contextlib.py", line 307, in enter_context
    result = _cm_type.__enter__(cm)
  File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/finksim/src/studip-fuse/studip_fuse/launcher/aioimpl/asyncio/main_loop.py", line 145, in session_context
    yield loop.run_until_complete(task)
  File "/usr/lib/python3.5/asyncio/base_events.py", line 454, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 421, in run_forever
    self._run_once()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
    self._callback(*self._args)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 315, in _wakeup
    self._step()
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/home/finksim/src/studip-fuse/studip_fuse/launcher/aioimpl/asyncio/main_loop.py", line 133, in enter
    log.info("Logged in as %s on %s", args.user, await session.get_instance_name())
Message: 'Logged in as %s on %s'
Arguments: ('fink13', 'Universit\xe4t Passau Stud.IP v4.2.1.2 running at https://studip.uni-passau.de/studip/api.php/')
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/__init__.py", line 983, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in position 32: ordinal not in range(128)
Call stack:
  File "/usr/lib/python3.5/threading.py", line 882, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/home/finksim/src/studip-fuse/studip_fuse/launcher/aioimpl/asyncio/main_loop.py", line 31, in start
    root_rp = stack.enter_context(session_context_manager(args, loop, future))
  File "/usr/lib/python3.5/contextlib.py", line 307, in enter_context
    result = _cm_type.__enter__(cm)
  File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/finksim/src/studip-fuse/studip_fuse/launcher/aioimpl/asyncio/main_loop.py", line 145, in session_context
    yield loop.run_until_complete(task)
  File "/usr/lib/python3.5/asyncio/base_events.py", line 454, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 421, in run_forever
    self._run_once()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
    self._callback(*self._args)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 315, in _wakeup
    self._step()
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/home/finksim/src/studip-fuse/studip_fuse/launcher/aioimpl/asyncio/main_loop.py", line 133, in enter
    log.info("Logged in as %s on %s", args.user, await session.get_instance_name())
Message: 'Logged in as %s on %s'
Arguments: ('fink13', 'Universit\xe4t Passau Stud.IP v4.2.1.2 running at https://studip.uni-passau.de/studip/api.php/')
Loop and session ready, sending result back to main thread
N-Coder commented 5 years ago

This is also present in 3.6 when locale doesn't support UTF-8: https://vstinner.github.io/posix-locale.html

N-Coder commented 5 years ago

fixed by 3bd66d0279b2fd6114948f8e2a185dd20d3d14b9