Discussion:
[Scons-users] Fwd: Action object does not handle functions with unicode constants
Eugene Leskinen
2018-06-21 11:45:17 UTC
Permalink
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
Bill Deegan
2018-06-21 12:44:17 UTC
Permalink
you're example has:
from lowesbuilder import *

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

-Bill
Post by Eugene Leskinen
Hi All,
I wanted to create an Action object from Python function and got the
scons: Reading SConscript files ...
build_it
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _do_create_action(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return action_type(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
self.funccontents = _callable_contents(execfunction)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _function_contents(obj)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
contents = [_code_contents(func.__code__, func.__doc__)]
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2018-06-21 12:45:32 UTC
Permalink
Never mind.. I pulled up the wrong file.
Post by Bill Deegan
from lowesbuilder import *
Will it work without that?
Can you trim it down a bit?
-Bill
Post by Eugene Leskinen
Hi All,
I wanted to create an Action object from Python function and got the
scons: Reading SConscript files ...
build_it
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _do_create_action(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return action_type(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
self.funccontents = _callable_contents(execfunction)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _function_contents(obj)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
contents = [_code_contents(func.__code__, func.__doc__)]
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
Eugene Leskinen
2018-06-22 06:17:52 UTC
Permalink
Does it look like a known issue?
Post by Bill Deegan
Never mind.. I pulled up the wrong file.
Post by Bill Deegan
from lowesbuilder import *
Will it work without that?
Can you trim it down a bit?
-Bill
Post by Eugene Leskinen
Hi All,
I wanted to create an Action object from Python function and got the
scons: Reading SConscript files ...
build_it
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _do_create_action(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return action_type(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
self.funccontents = _callable_contents(execfunction)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _function_contents(obj)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
contents = [_code_contents(func.__code__, func.__doc__)]
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
--
Regards,
Eugene Leskinen
Bill Deegan
2018-06-23 03:24:52 UTC
Permalink
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
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
Post by Eugene Leskinen
Does it look like a known issue?
Post by Bill Deegan
Never mind.. I pulled up the wrong file.
Post by Bill Deegan
from lowesbuilder import *
Will it work without that?
Can you trim it down a bit?
-Bill
Post by Eugene Leskinen
Hi All,
I wanted to create an Action object from Python function and got the
scons: Reading SConscript files ...
build_it
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _do_create_action(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return action_type(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
self.funccontents = _callable_contents(execfunction)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _function_contents(obj)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
contents = [_code_contents(func.__code__, func.__doc__)]
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
--
Regards,
Eugene Leskinen
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Jason Kenny
2018-06-23 04:06:17 UTC
Permalink
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-***@scons.org> On Behalf Of Bill Deegan
Sent: Friday, June 22, 2018 10:25 PM
To: SCons users mailing list <scons-***@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 <***@gmail.com<mailto:***@gmail.com>> wrote:
Does it look like a known issue?

чт, 21 ОюМ. 2018 г. в 15:45, Bill Deegan <***@baddogconsulting.com<mailto:***@baddogconsulting.com>>:
Never mind.. I pulled up the wrong file.

On Thu, Jun 21, 2018 at 8:44 AM, Bill Deegan <***@baddogconsulting.com<mailto:***@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 <***@gmail.com<mailto:***@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-***@scons.org<mailto:Scons-***@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-***@scons.org<mailto:Scons-***@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-***@scons.org<mailto:Scons-***@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>
Eugene Leskinen
2018-06-23 07:48:01 UTC
Permalink
Hi Bill,

The fix works for me. Thank you.
Post by Bill Deegan
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
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
Post by Eugene Leskinen
Does it look like a known issue?
Post by Bill Deegan
Never mind.. I pulled up the wrong file.
Post by Bill Deegan
from lowesbuilder import *
Will it work without that?
Can you trim it down a bit?
-Bill
Post by Eugene Leskinen
Hi All,
I wanted to create an Action object from Python function and got the
scons: Reading SConscript files ...
build_it
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _do_create_action(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return action_type(act, kw)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
self.funccontents = _callable_contents(execfunction)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
return _function_contents(obj)
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
contents = [_code_contents(func.__code__, func.__doc__)]
File "c:\python2764\lib\site-packages\scons-3.0.1\SCons\Action.py",
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
--
Regards,
Eugene Leskinen
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
--
Regards,
Eugene Leskinen
Loading...