Skip to content

benchmark output failure in python3 #3

@anarcat

Description

@anarcat

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions