sympy / sympy-bot-old

SymPy pull request helper
http://reviews.sympy.org/
Other
24 stars 16 forks source link

Handle stdout encoding different from utf8. #130

Closed jrioux closed 12 years ago

jrioux commented 12 years ago

This is especially important when pretty printing tests fail and we have non-ascii characters in the log. With this patch we avoid an UnicodeEncodeError that prevents the review from being uploaded.

For example I needed this patch to upload the result at https://github.com/sympy/sympy/issues/1517#issuecomment-8093378

asmeurer commented 12 years ago

I get

Traceback (most recent call last):
  File "./sympy-bot", line 686, in <module>
    main()
  File "./sympy-bot", line 248, in main
    dispatch_reviews(options, urls, username=username, password=password, token=token)
  File "./sympy-bot", line 441, in dispatch_reviews
    mergeinfo = merge_branch(repo_path, config.master_commit)
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy-bot/utils/testrunner.py", line 97, in merge_branch
    result["log"] = merge_log + "\nLIST OF CONFLICTS\n" + conflicts
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 280: ordinal not in range(128)
jrioux commented 12 years ago

This probably needs more work, but I could not reproduce the problem.

asmeurer commented 12 years ago

Maybe it has to do with the fact that the PR could not be merged.

jrioux commented 12 years ago

I reproduced your problem by testing against PR 1507. I now have fixed this.

jrioux commented 12 years ago

This is ready to go.

jrioux commented 12 years ago

Why does the bot wait until all the PR's are tested to post the comments on each PR? It used to be that comments were posted when testing was completed on a PR and before moving on to the next PR. As far as I can see, the behavior changed with the set of patches in #115.

smichr commented 12 years ago

Thanks! This is in.

asmeurer commented 12 years ago

Yeah, I agree that that should be changed. There's probably no good reason for it; that's likely just the easiest way that the logic flowed in the code.