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

benchmark output failure in python3 #3

Open
anarcat opened this issue Nov 21, 2019 · 0 comments
Open

benchmark output failure in python3 #3

anarcat opened this issue Nov 21, 2019 · 0 comments

Comments

@anarcat
Copy link

anarcat commented Nov 21, 2019

It seems python3 doesn't like that codecs hack:

$ python3 benchmark.py 
b'===========================  ==========  ===========\nTable formatter                time, \xce\xbcs    rel. time\n===========================  ==========  ===========\ncsv to StringIO                    14.7          1.0\njoin with tabs and newlines        20.3          1.4\nasciitable (0.8.0)                338.4         23.0\ntabulate (0.8.3)                  725.3         49.3\nterminaltables (3.1.0)            806.5         54.8\nPrettyTable (0.7.2)              1364.5         92.7\ntexttable (1.6.2)                2044.0        138.8\n===========================  ==========  ==========='

if i just remove it, the output looks okay again:

diff --git i/benchmark.py w/benchmark.py
index 05254c1..42d62f8 100644
--- i/benchmark.py
+++ w/benchmark.py
@@ -108,11 +108,7 @@ def benchmark(n):
                               [u"Table formatter", u"time, μs", u"rel. time"],
                               u"rst", floatfmt=".1f")
 
-    import platform
-    if platform.platform().startswith("Windows"):
-        print(table)
-    else:
-        print(codecs.encode(table, "utf-8"))
+    print(table)
 
 
 if __name__ == "__main__":

why was that done in the first place?

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