[Scons-users] Fwd: Action object does not handle functions with unicode constants

Jason Kenny dragon512 at live.com
Sat Jun 23 00:06:17 EDT 2018


I think I have seen the issue when using depend with Value Node. If the dependent is a binary Scons trys to read in the file as if it was text… which fails badly with binaries.

Jason

From: Scons-users <scons-users-bounces at scons.org> On Behalf Of Bill Deegan
Sent: Friday, June 22, 2018 10:25 PM
To: SCons users mailing list <scons-users at scons.org>
Subject: Re: [Scons-users] Fwd: Action object does not handle functions with unicode constants

I don't think it's a known issue.
I have a patch if you'd like to try it.

You can use my branch https://github.com/bdbaddog/scons/tree/fix_action_functions_with_unicode_constants_py2<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbdbaddog%2Fscons%2Ftree%2Ffix_action_functions_with_unicode_constants_py2&data=02%7C01%7C%7Cdca36925d7ff44130bc208d5d8b9dcde%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636653215137713606&sdata=424TeRbz1Mz16%2F%2BBE7qblN4BZHOACqXQ82A5Y6g0pDQ%3D&reserved=0>
Or patch your tree with src/engine/SCons/Util.py from that branch.

It should resolve your issue.

Let me know if it doesn't.

-Bill

On Fri, Jun 22, 2018 at 2:17 AM, Eugene Leskinen <karbazol at gmail.com<mailto:karbazol at gmail.com>> wrote:
Does it look like a known issue?

чт, 21 июн. 2018 г. в 15:45, Bill Deegan <bill at baddogconsulting.com<mailto:bill at baddogconsulting.com>>:
Never mind.. I pulled up the wrong file.

On Thu, Jun 21, 2018 at 8:44 AM, Bill Deegan <bill at baddogconsulting.com<mailto:bill at baddogconsulting.com>> wrote:
you're example has:
from lowesbuilder import *

Will it work without that?
Can you trim it down a bit?

-Bill

On Thu, Jun 21, 2018 at 7:45 AM, Eugene Leskinen <karbazol at gmail.com<mailto:karbazol at gmail.com>> wrote:
Hi All,

I wanted to create an Action object from Python function and got the following error:

scons: Reading SConscript files ...
TypeError: can only join an iterable of bytes (item 3 has type 'unicode'):
  File "D:\personal\scons_bugs\action_unicode\SConstruct", line 23:
    build_it
  File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py", line 515:
    return _do_create_action(act, kw)
  File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py", line 485:
    return action_type(act, kw)
  File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py", line 1127:
    self.funccontents = _callable_contents(execfunction)
  File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py", line 169:
    return _function_contents(obj)
  File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py", line 301:
    contents = [_code_contents(func.__code__, func.__doc__)]
  File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py", line 264:
    contents.extend(bytearray(',', 'utf-8').join(z))

I have faced the issue with scons of version 3.0.0 and 3.0.1.
Scons of version 2.5.1 correctly handles such functions.
To re-produce the issue I have created a Sconstruct file (attached).
Use command 'scons hello.txt' to re-produce the issue.
Use command 'scons hello.txt WORK=1' to work around the issue.

Is it already known issue?
Should I submit it to github?

--
Regards,
Eugene Leskinen


--
Regards,
Eugene Leskinen

_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist4.pair.net%2Fmailman%2Flistinfo%2Fscons-users&data=02%7C01%7C%7Cdca36925d7ff44130bc208d5d8b9dcde%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636653215137713606&sdata=F78c915VACJ1%2BVtwk7J1ZSSeakm3EUEYYyj0V0%2F0XgI%3D&reserved=0>


_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist4.pair.net%2Fmailman%2Flistinfo%2Fscons-users&data=02%7C01%7C%7Cdca36925d7ff44130bc208d5d8b9dcde%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636653215137713606&sdata=F78c915VACJ1%2BVtwk7J1ZSSeakm3EUEYYyj0V0%2F0XgI%3D&reserved=0>


--
Regards,
Eugene Leskinen

_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist4.pair.net%2Fmailman%2Flistinfo%2Fscons-users&data=02%7C01%7C%7Cdca36925d7ff44130bc208d5d8b9dcde%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636653215137713606&sdata=F78c915VACJ1%2BVtwk7J1ZSSeakm3EUEYYyj0V0%2F0XgI%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180623/bdce66ad/attachment-0001.html>


More information about the Scons-users mailing list