[Scons-dev] Python3 problem under Solaris
Rob Boehne
robb at datalogics.com
Tue Nov 26 13:00:26 EST 2019
It turns out to be a little more complicated than just adding the ‘encoding’ keyword argument, but still a trivial change.
I manually tested on Sparc Solaris 11.3 with Python 3.7 and Python 2.7 using my real-world complex build.
https://github.com/SCons/scons/pull/3481
Thanks!
From: Scons-dev <scons-dev-bounces at scons.org> on behalf of Bill Deegan <bill at baddogconsulting.com>
Reply-To: SCons developer list <scons-dev at scons.org>
Date: Monday, November 25, 2019 at 5:23 PM
To: SCons developer list <scons-dev at scons.org>
Subject: Re: [Scons-dev] Python3 problem under Solaris
Rob,
If you can double check that works with python 2.7 then I'll make the change and it'll be in the next release.
Unless you'd like to submit a pull request
https://github.com/SCons/scons/wiki/GitWorkflows<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSCons%2Fscons%2Fwiki%2FGitWorkflows&data=02%7C01%7Crobb%40datalogics.com%7Cf911967827f74d1ae5e408d771fe6a73%7Cfc3d8cdfd6994f23ae232659c3da4749%7C0%7C0%7C637103209858580246&sdata=4IQqHxJkQV%2Fh4QnLOxlRR26B1I4aJDN%2FmZOTA2mqFOg%3D&reserved=0>
-Bill
On Mon, Nov 25, 2019 at 2:34 PM Rob Boehne <robb at datalogics.com<mailto:robb at datalogics.com>> wrote:
I’m porting to SPARC Solaris a project that uses Scons in Python3 – (we use it widely on Sparc & Intel Solaris with python 2.7) and I’m seeing what appears to be a Python3 porting problem when an Environment object is created:
(python-env-lhasa) robb at lhasa:/devlocal/robb/apdfl-18box/pdfl18_all/DevTests (sparc_stuff)$ scons BUILD_64_BIT=true STAGE=Debug TESTS=smoke
scons: Reading SConscript files ...
Building for Debug
TypeError: cannot use a string pattern on a bytes-like object:
File "/devlocal/robb/apdfl-18box/pdfl18_all/DevTests/SConstruct", line 538:
OS_LEVEL='')
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Environment.py", line 992:
apply_tools(self, tools, toolpath)
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Environment.py", line 107:
env.Tool(tool)
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Environment.py", line 1799:
tool(self)
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Tool/__init__.py", line 303:
self.generate(env, *args, **kw)
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Tool/default.py", line 40:
for t in SCons.Tool.tool_list(env['PLATFORM'], env):
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Tool/__init__.py", line 1288:
cxx_compiler = FindTool(cxx_compilers, env) or cxx_compilers[0]
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Tool/__init__.py", line 1174:
if t.exists(env):
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Tool/suncxx.py", line 139:
path, cxx, shcxx, version = get_cppc(env)
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Tool/suncxx.py", line 115:
path, version = get_package_info(package, pkginfo, pkgchk)
File "/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Tool/suncxx.py", line 79:
version_match = version_re.search(pkginfo_contents)
(python-env-lhasa) robb at lhasa:/devlocal/robb/apdfl-18box/pdfl18_all/DevTests (sparc_stuff)$
I corrected this by specifying encoding=’utf-8’ to the two subprocess.Popen() calls in SCons/Tool/suncxx.py
And I *think* that should be fine for Python 2.7 as well.
I haven’t done any SCons development in a long while, but here is a diff. It should be fairly obvious if this is the right fix.
(python-env-lhasa) robb at lhasa:/devlocal/robb/apdfl-18box/python-env-lhasa/lib/python3.7/site-packages/scons/SCons/Tool (develop-18)$ diff -u suncxx.py~ suncxx.py
--- suncxx.py~ Mon Nov 25 11:45:14 2019
+++ suncxx.py Mon Nov 25 16:27:09 2019
@@ -69,6 +69,7 @@
try:
p = subprocess.Popen([pkginfo, '-l', package_name],
+ encoding='utf-8',
stdout=subprocess.PIPE,
stderr=DEVNULL)
except EnvironmentError:
@@ -83,6 +84,7 @@
if pathname is None:
try:
p = subprocess.Popen([pkgchk, '-l', package_name],
+ encoding='utf-8',
stdout=subprocess.PIPE,
stderr=DEVNULL)
except EnvironmentError:
Thanks,
Rob Boehne
[cid:image002.png at 01D3D0E3.DCFE6710]
Rob Boehne
Senior Software Architect | Datalogics, Inc.
+1.312.853.8351<tel:(312)%20853-8351> | robb at datalogics.com<mailto:robb at datalogics.com>
datalogics.com<https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.datalogics.com%2F&data=02%7C01%7Crobb%40datalogics.com%7Cf911967827f74d1ae5e408d771fe6a73%7Cfc3d8cdfd6994f23ae232659c3da4749%7C0%7C0%7C637103209858590240&sdata=0oAKYnnCcf%2BFA%2FBoAoBSaENJ1K46TAUMvasQXOt2C28%3D&reserved=0> | blogs.datalogics.com<https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblogs.datalogics.com%2F&data=02%7C01%7Crobb%40datalogics.com%7Cf911967827f74d1ae5e408d771fe6a73%7Cfc3d8cdfd6994f23ae232659c3da4749%7C0%7C0%7C637103209858590240&sdata=r%2B6gtT7q%2BfqH%2FkWfhack9lUAR0EQVyAWuzJEn2j%2BuAU%3D&reserved=0>
Connect with us: Facebook<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2FDatalogicsInc&data=02%7C01%7Crobb%40datalogics.com%7Cf911967827f74d1ae5e408d771fe6a73%7Cfc3d8cdfd6994f23ae232659c3da4749%7C0%7C0%7C637103209858600236&sdata=NYegc0yIidP3AvJhV8yri75VeUlAEVYN3ApMO1cZtHg%3D&reserved=0> | Twitter<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FDatalogicsInc&data=02%7C01%7Crobb%40datalogics.com%7Cf911967827f74d1ae5e408d771fe6a73%7Cfc3d8cdfd6994f23ae232659c3da4749%7C0%7C0%7C637103209858600236&sdata=fO6cOKCwLLKqwcc7AtHi6UEscT%2Bt1HcpWzeI30eJtsI%3D&reserved=0> | LinkedIn<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fdatalogics%3FactionToken%3Dp%3Dp%253Dbiz-company-login%2526c%253D3217e65a-bdc2-4b38-8f9c-13c982e8c529%2526m%253Dcompany_feed%2526n%253D0%26t%3Da%253DisFolloweeOfPoster%25253Dfalse%252526distanceFromActor%25253D-1%252526actorType%25253D%252526likedByUser%25253Dfalse%252526targetId%25253D%252526recentCommentUrns%25253D%252526targetType%25253D%252526sponsoredFlag%25253DORGANIC%252526verbType%25253Dlinkedin%2525253Ashare%252526objectType%25253Dlinkedin%2525253Aarticle%252526totalShares%25253D0%252526activityId%25253Durn%2525253Ali%2525253Aactivity%2525253A6263731876121362433%252526recentLikerUrns%25253D%252526actorId%25253Durn%2525253Ali%2525253Acompany%2525253A14000%252526totalComments%25253D0%252526relevanceScore%25253D0.0%252526recentCommenterUrns%25253D%252526isPublic%25253Dtrue%252526time%25253D-1%252526totalLikes%25253D0%252526objectId%25253Durn%2525253Ali%2525253Aarticle%2525253A7793179909183391510%252526distanceFromNestedActor%25253D-1%2526s%253DORG&data=02%7C01%7Crobb%40datalogics.com%7Cf911967827f74d1ae5e408d771fe6a73%7Cfc3d8cdfd6994f23ae232659c3da4749%7C0%7C0%7C637103209858600236&sdata=UX88hkb8ZIbJT66zXr%2FFkrC9A6n57GPxOAxWU0JiQO0%3D&reserved=0> | YouTube<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fuser%2FDatalogics&data=02%7C01%7Crobb%40datalogics.com%7Cf911967827f74d1ae5e408d771fe6a73%7Cfc3d8cdfd6994f23ae232659c3da4749%7C0%7C0%7C637103209858610229&sdata=BJu61XFSeaDIVAavvo%2Bunf9NDVhF2exV1eon4tPls%2Fc%3D&reserved=0>
_______________________________________________
Scons-dev mailing list
Scons-dev at scons.org<mailto:Scons-dev at scons.org>
https://pairlist2.pair.net/mailman/listinfo/scons-dev<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist2.pair.net%2Fmailman%2Flistinfo%2Fscons-dev&data=02%7C01%7Crobb%40datalogics.com%7Cf911967827f74d1ae5e408d771fe6a73%7Cfc3d8cdfd6994f23ae232659c3da4749%7C0%7C0%7C637103209858610229&sdata=VwvmcCEXJ0KsFgRLqGFKqhav0ETlbNCkFE4nveeUcq4%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20191126/67e0ca7f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 124450 bytes
Desc: image001.png
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20191126/67e0ca7f/attachment-0001.png>
More information about the Scons-dev
mailing list