Closed singuliere closed 5 years ago
@dupainaulevain Thanks for reporting this - can you make sure this is tracked in one of our Jira tickets, as part of our tech debt?
I've made the same confusion here between @singuliere and @dupainaulevain - sorry : )
@UmanShahzad I'll address this to you instead then - can you make sure this is tracked in one of our Jira tickets, as part of our tech debt?
@antoviaque cc @singuliere @dupainaulevain https://tasks.opencraft.com/browse/BB-1015
@UmanShahzad Thank you!
Point of clarification: The description says that the test "fails to fail," which suggests that the desired fix is for the test to fail properly, but under "what is expected" it shows all tests passing. What specific outcome should I be aiming for here?
The bug description is not good indeed. The problem to be fixed is that the tests fail to fail when there is a unicode problem.
The descirption was updated, sorry about that.
I'm not sure whether this ought to be fixed. Inside python's logging module, the error occurs as part of the StreamHandler, and when the exception occurs, it is passed to a method called "handleError" which opens with the following docstring:
"""
Handle errors which occur during an emit() call.
This method should be called from handlers when an exception is
encountered during an emit() call. If raiseExceptions is false,
exceptions get silently ignored. This is what is mostly wanted
for a logging system - most users will not care about errors in
the logging system, they are more interested in application errors.
You could, however, replace this with a custom handler if you wish.
The record which was being processed is passed in to this method.
"""
and then goes on to print the exception to stderr.
So the tests pass because the logging system expressly indicates that its errors should be recorded, but should not propagate. We can, of course, override this behavior, as described in the docstring above. I'm just not sure if that's useful. We could also clean up the output with the following workarounds:
Postscript: This took some effort to diagnose, because the same locale issue that caused this error also causes pdb to fail when trying to printing out variables. I had to (1) replace the string literal with one containing ascii unicode escapes ('\xab\u03c4\u03b1\u0411\u042c\u2113\u03c3\xbb'
instead of '«ταБЬℓσ»'
) to allow me to even step onto the line with that string in the debugger, and (2) assiduously avoid inspecting any variables that would try to show me the message string.
Note: I was not able to check out the above mentioned commit hash, but the problem could be duplicated on the current head of https://github.com/singuliere/opencraft/@docker-devstack (f0104d9043).
To do so I ran make devstack.shell
(not make devstack.shell shell
), and the checked for the current locale with env
, only saw the LANG
variable (set to en_US.utf-8 or something similar) and ran export LANG=
with no value.
Excellent sleuth work :-) The commit hash was probably discarded because is no longer part of a branch. I'll make sure to keep a dedicated branch around. I'll go ahead and close this issue: I agree it does not need fixing.
When there is no locale, the test shows a stack trace but does not fail as it should.
Steps to reproduce
What is expected:
The tests fail because the en_US.UTF-8 locale is not present
What happens instead
The tests succeed although they show a stack trace about the missing locale