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

Fix UnicodeDecodeError when postgres is not configured in english #4253

Merged
merged 3 commits into from Dec 4, 2018

Conversation

Projects
None yet
3 participants
@richvdh
Copy link
Member

richvdh commented Dec 3, 2018

This is actually a bit of a half-assed effort at fixing #4252. Having spent far too long staring at this and wondering what to do, I'm forced to the conclusion that the right answer is just to drop support for python 2, which appears to be completely broken when it comes to unicode in exception descriptions.

In the meantime, I hope this will make things slightly better.

Fix UnicodeDecodeError when postgres is not configured in english
This is a bit of a half-assed effort at fixing
#4252. Fundamentally the right
answer is to drop support for Python 2.

@richvdh richvdh force-pushed the rav/fix_postgres_unicode_issue branch from 8fe7c7a to 4ddcd4d Dec 3, 2018

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Dec 3, 2018

Codecov Report

Merging #4253 into develop will decrease coverage by <.01%.
The diff coverage is 53.84%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4253      +/-   ##
===========================================
- Coverage    73.55%   73.55%   -0.01%     
===========================================
  Files          299      299              
  Lines        29806    29820      +14     
  Branches      4872     4876       +4     
===========================================
+ Hits         21923    21933      +10     
  Misses        6456     6456              
- Partials      1427     1431       +4
Impacted Files Coverage Δ
synapse/util/stringutils.py 68.08% <53.84%> (-6.21%) ⬇️
synapse/util/metrics.py 81.69% <0%> (-4.23%) ⬇️
synapse/handlers/search.py 81.25% <0%> (ø) ⬆️
synapse/handlers/federation.py 61.72% <0%> (ø) ⬆️
synapse/appservice/scheduler.py 86.71% <0%> (+0.21%) ⬆️
synapse/handlers/device.py 81.45% <0%> (+0.8%) ⬆️
synapse/util/logcontext.py 89.03% <0%> (+1.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c033242...ee7ce0a. Read the comment docs.

@richvdh richvdh requested a review from matrix-org/synapse-core Dec 4, 2018

Update 4253.bugfix
fix typo
elif len(e.args) > 1:
return six.text_type(repr(e.args))

msg = e.args

This comment has been minimized.

@erikjohnston

erikjohnston Dec 4, 2018

Member

Do you mean msg = e.args[0]?

This comment has been minimized.

@richvdh

richvdh Dec 4, 2018

Member

sigh. yes. thank you.

@richvdh richvdh merged commit ecc2318 into develop Dec 4, 2018

5 checks passed

ci/circleci: sytestpy2merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgresmerged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgresmerged Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@richvdh richvdh deleted the rav/fix_postgres_unicode_issue branch Dec 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment