Skip to content

Commit 4bdecee

Browse files
committed
docs: Fix the monkeypatching of blockdiag
blockdiag has a longstanding bug whereby it tries to access an attribute on an 'io.BufferedReader' that doesn't exist. We had previously fixed this in change Ibd32d30aacae65702d0ccbdb8a02b1667ec4e8ee, which undid the damage blockdiag was doing. However, this worked because the monkey patching blockdiag does happens when the 'blockdiag.utils.compat' module is loaded [1], which was happening implicitly with our import of 'blockdiag.imagedraw.textfolder' [2]. However, that module no longer imports the 'compat' [3] module so this doesn't work. Fix the issue by just importing the 'compat' module manually, triggering the monkey patching...which we can then undo. [1] https://github.com/blockdiag/blockdiag/blob/2.0.0/src/blockdiag/utils/compat.py#L19-L26 [2] https://github.com/blockdiag/blockdiag/blob/1.5.4/src/blockdiag/imagedraw/textfolder.py#L18 [3] https://github.com/blockdiag/blockdiag/tree/2.0.0/src/blockdiag/imagedraw/textfolder.py Change-Id: Idacfff98842fde38fb39791090f2da3310b441b5 Signed-off-by: Stephen Finucane <[email protected]>
1 parent c163151 commit 4bdecee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def monkey_patch_blockdiag():
197197
from codecs import getreader
198198

199199
from blockdiag.imagedraw import textfolder
200+
from blockdiag.utils import compat # noqa
200201

201202
# oh, blockdiag. Let's undo the mess you made.
202203
codecs.getreader = getreader

0 commit comments

Comments
 (0)