-
Notifications
You must be signed in to change notification settings - Fork 27
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
Vroom fails when trying to print any non-ASCII content #28
Labels
Comments
Similar error for :throw '¬' The error there is:
|
Closed
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As noted in #25, Vroom currently fails when attempting to print a failure message containing non-ASCII content.
For example, running
LANG=de_DE.UTF-8 vroom examples/directives.vroom
currently fails because vim returnsE605: Ausnahme nicht aufgefangen: I broke something!
rather than the message we match against. That's simple to fix, but it suffices to demonstrate the problem:In this case, the message that it's failing to print is actually the message-maintainer text,
Übersetzt von Georg Dahn <gorgyd@yahoo.co.uk>
, meaning that any test failure breaks vroom.I've also seen a similar stacktrace in
Failures.__str__()
in the multiple-failures case.I spent a short while looking at this yesterday. The core problem is that, from what I can see, in Python 2.x (which I guess we're assuming?)
__str__()
must return a byte string in an unspecified encoding, which in some cases (i.e. above) becomesascii
. (See this blog post for more detail.)We're implementing
__str__()
to print a number of the objects (Failures
andLog
, for example), and I suspect these should implement__unicode__()
instead, and probably leave__str__()
effectively unimplemented. (This also means that we'd need to callunicode()
instead ofstr()
, and useu'%s' % x
rather than'%s' % x
.)The other
Failure
subclasses already implement a useful__unicode__()
, but they have the same problem if you attempt to call__str__()
; we probably want to block that as well.The text was updated successfully, but these errors were encountered: