Re: Python3 problem under Solaris
Bill Deegan <bill-cJFiu+DHMVC5azolltMz9laTQe2KTcn/@public.gmane.org> Mon, 25 Nov 2019 15:17:36 -0800
| Newsgroups | gmane.comp.programming.tools.scons.devel |
|---|---|
| Message-ID | <CAEyG4CEsJvpRApSpqVUZBWBGuY3-Fm8HjvGeYqNy0MdOUPsBNw@mail.gmail.com> |
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 -Bill On Mon, Nov 25, 2019 at 2:34 PM Rob Boehne <[email protected]> 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@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@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@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 > > > > [image: cid:image002.png-u/z1+d7XzLbC/[email protected]] > > *Rob Boehne* > > Senior Software Architect | Datalogics, Inc. > > +1.312.853.8351 <(312)%20853-8351> | [email protected] > > datalogics.com <http://www.datalogics.com/> | blogs.datalogics.com > > Connect with us: Facebook <https://www.facebook.com/DatalogicsInc> | > Twitter <https://twitter.com/DatalogicsInc> | LinkedIn > <https://www.linkedin.com/company/datalogics?actionToken=p=p%3Dbiz-company-login%26c%3D3217e65a-bdc2-4b38-8f9c-13c982e8c529%26m%3Dcompany_feed%26n%3D0&t=a%3DisFolloweeOfPoster%253Dfalse%2526distanceFromActor%253D-1%2526actorType%253D%2526likedByUser%253Dfalse%2526targetId%253D%2526recentCommentUrns%253D%2526targetType%253D%2526sponsoredFlag%253DORGANIC%2526verbType%253Dlinkedin%25253Ashare%2526objectType%253Dlinkedin%25253Aarticle%2526totalShares%253D0%2526activityId%253Durn%25253Ali%25253Aactivity%25253A6263731876121362433%2526recentLikerUrns%253D%2526actorId%253Durn%25253Ali%25253Acompany%25253A14000%2526totalComments%253D0%2526relevanceScore%253D0.0%2526recentCommenterUrns%253D%2526isPublic%253Dtrue%2526time%253D-1%2526totalLikes%253D0%2526objectId%253Durn%25253Ali%25253Aarticle%25253A7793179909183391510%2526distanceFromNestedActor%253D-1%26s%3DORG> > | YouTube <https://www.youtube.com/user/Datalogics> > > > > > _______________________________________________ > Scons-dev mailing list > [email protected] > https://pairlist2.pair.net/mailman/listinfo/scons-dev > _______________________________________________ Scons-dev mailing list [email protected] https://pairlist2.pair.net/mailman/listinfo/scons-dev
image001.png
(image/png, 121.5 KB) - not displayed