-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
python-msgpack test fails when building on my machine due to encoding #50231
Comments
For reference on my server:
|
Looks like I can make the test pass by setting |
Nixpkgs manual:
|
Perhaps relevant, another python package has this: nixpkgs/pkgs/applications/misc/buku/default.nix Lines 30 to 32 in 5453997
Added here with comment "Another issue was due to locale issues". @infinisil Do you remember if this was necessary only on your machine, or also for Hydra? |
@FRidh I don't get what the issue is though: Why should this issue arise when |
Maybe it's a sandboxing thing that changes things about stdout encoding? I tried
but it fails just as much as leaving |
@FRidh Also the package in question already has this: nixpkgs/pkgs/development/python-modules/u-msgpack-python/default.nix Lines 18 to 20 in 5453997
since your original commit in bec4794#diff-7530dfc8d434ca1b15be565c346a4a98R18 |
This patch correspondingly makes it work for me, but I don't like it because I don't understand why it's necessary: Author: Niklas Hambüchen <mail@nh2.me>
Date: Sun Nov 11 14:39:48 2018 +0100
u-msgpack-python: Workaround for #50231 encoding issue
diff --git a/pkgs/development/python-modules/u-msgpack-python/default.nix b/pkgs/development/python-modules/u-msgpack-python/default.nix
index bab0bc28850..4a88c99ac4d 100644
--- a/pkgs/development/python-modules/u-msgpack-python/default.nix
+++ b/pkgs/development/python-modules/u-msgpack-python/default.nix
@@ -20,6 +20,9 @@ buildPythonPackage rec {
buildInputs = [ glibcLocales ];
checkPhase = ''
+ # See https://github.com/NixOS/nixpkgs/issues/50231
+ export PYTHONIOENCODING=utf-8
+
${python.interpreter} -m unittest discover
'';
|
Hmm, compiling futher, I'm getting this with more python packages:
|
Perhaps what's happening is that this issue arises because some dependent package wasn't built with the sandbox on (sneaking in an impurity), and enabling the sandbox for these Python packages is already too late? To test this hypothesis, I'm now recompiling everything up from glibc with the sandbox on, and will report when that's done. |
DIdn't work :( still getting the same error. #32656 also suggests the sandbox as the issue, and at some point the problem just went away for them. So odd ... |
OK, here I have a thing for people to try.
fails for me, but leaving away Can anybody try whether they can reproduce that? |
@srhb tried the above for me but could not reproduce it. But I fooled myself: That is because for And I think my issue here in general was that I fooled myself another time: I was recompiling my system with a glibc that had 1 patch added that I wrote myself (for
So I accidentally removed all nixpkgs-specific patches from
Still confirming whether this is the solution with a rebuild, but I'm quite sure that'll be it. |
Intended to avoid contributor confusion as in NixOS#50231.
Yes, looks like that was it. No bug, my mistake. I made PR #50291 so that others are less likely to make the same mistake. |
Issue description
When I recompile
python3Packages.msgpack
(based on 18.03) on my NixOS 18.03 server, as opposed to fetching it from the binary cache, I get:This is due to some terminal encoding weirdness.
The line that fails is this printing of the name of the test currently being run:
https://github.com/vsergeev/u-msgpack-python/blob/38c712520092128caa795762bb2c2fdf30275a06/test_umsgpack.py#L346-L347
It happens when the printout contains the letter
é
:https://github.com/vsergeev/u-msgpack-python/blob/38c712520092128caa795762bb2c2fdf30275a06/test_umsgpack.py#L84
Interestingly, the issue happens only on
stdout
, not onstderr
: If I insert prints like this:then the
out
print succeeds but theerr
one crashes:Note how it succeeds on stderr but fails on stdout even though the encoding is apparently the same.
Why does this happen when I build on my server but not on Hydra?
Might this be some configuration of the outer terminal is this run from?
The text was updated successfully, but these errors were encountered: