72dc9b82f97d

Update
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Mon, 26 Oct 2020 21:33:18 -0400
parents 3d27b0ac36f1
children b9d133e21680
branches/tags (none)
files README.markdown

Changes

--- a/README.markdown	Thu Oct 22 01:04:43 2020 -0400
+++ b/README.markdown	Mon Oct 26 21:33:18 2020 -0400
@@ -1528,3 +1528,21 @@
 Dropbox on this machine since Dropbox is a pile of garbage now.  Maybe it's time
 to shave that yak and set up some kind of `rsync` based syncing solution for the
 bulk of my files.
+
+## 2020-10-26
+
+Finally got around to merging some `hg-prompt` patches.  They add Python
+3 compatibility, but break Python 2 compatibility because it used `bytes(foo,
+'utf-8')` which breaks with an inscrutable error in Python 2:
+
+    Python 2.7.17 (default, Sep 30 2020, 13:38:04) 
+    [GCC 7.5.0] on linux2 
+    Type "help", "copyright", "credits" or "license" for more information. 
+    >>> bytes('foo', 'utf-8') 
+    Traceback (most recent call last): 
+    File "<stdin>", line 1, in <module> 
+    TypeError: str() takes at most 1 argument (2 given) 
+
+I'm calling `bytes`, not `str`, what the fuck are you talking about, Python?
+Eventually I found `bytes(foo.encode('utf-8'))` which will work in both.  I'm
+glad I don't use this language any more.