[Scons-users] env.Substfile() on files encoded with non UTF-8 (UTF-16).

Dmitry Igrishin dmitigr at gmail.com
Tue Dec 12 01:31:46 EST 2017


2017-12-12 5:40 GMT+03:00 Bill Deegan <bill at baddogconsulting.com>:

> I don't have a clean fix for you, but you might try changing
> get_text_contents() in SCons/Node/FS.py to be the same as get_contents()
> (Comment out current get_text_contents) in class File(..), and then
> get_text_contents=get_contents
>
> See if that solves the problem for u?
>
Changing sources of the SCons is undesirable for us. What if monkeypatch
SCons.Node.FS.File in the custom Tool definition like that:

  import sys
  import re
  from SCons.Builder import Builder
  from SCons.Environment import *

  SCons.Node.FS.File.get_text_contents = SCons.Node.FS.File.get_contents

  # ...

Is it safe to monkeypatch SCons like above?

PS. I've tested it and it seems to works.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171212/1a22984b/attachment.html>


More information about the Scons-users mailing list