pidgin-py3-fixes.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # HG changeset patch
  2. # User Evangelos Foutras <evangelos@foutrelis.com>
  3. # Date 1520583640 -7200
  4. # Fri Mar 09 10:20:40 2018 +0200
  5. # Branch release-2.x.y
  6. # Node ID ac2e05444162f1dc0fd60e4d5c8b4cbe2969b695
  7. # Parent 02df346d26d00cb9a1420c11a59fccb35d92f04e
  8. Adjust purple-remote to work with Python 3
  9. Fixes the following error:
  10. Traceback (most recent call last):
  11. File "./libpurple/purple-remote", line 241, in <module>
  12. print("No existing libpurple instance detected.")
  13. File "/usr/lib/python3.6/codecs.py", line 377, in write
  14. self.stream.write(data)
  15. TypeError: write() argument must be str, not bytes
  16. diff -r 02df346d26d0 -r ac2e05444162 libpurple/purple-remote
  17. --- a/libpurple/purple-remote Thu Mar 08 22:51:37 2018 -0600
  18. +++ b/libpurple/purple-remote Fri Mar 09 10:20:40 2018 +0200
  19. @@ -13,8 +13,10 @@
  20. import xml.dom.minidom
  21. -sys.stdin = codecs.getwriter('utf-8')(sys.stdin);
  22. -sys.stdout = codecs.getwriter('utf-8')(sys.stdout);
  23. +if hasattr(sys.stdout, 'buffer'):
  24. + sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer)
  25. +else:
  26. + sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
  27. xml.dom.minidom.Element.all = xml.dom.minidom.Element.getElementsByTagName