WebSphere的jython编码的一个坑

was5.1版本,用"name=" in line这类判断字符串包含的方式时,系统会提示报错

TypeError: string member test needs char left operand

原来python早期代码,in左边必须是单个的字符,而was5.1的jython是用了python的早期版本,所以不支持更高级的语法,was8.5中也存在这问题

  • Yeah, its fairly old I believe. Its the implementation of jython that comes with WebSphere 8.5.5. Even though its the very latest release of WebSphere, it still comes with a ten year old python! – Seer Oct 3 '13 at 9:15
  •  
    I looked into this some more. WebSphere comes with Jython 2.1 (just type sys.version to verify). Look at SourceForge and behold, it was released in September 2002, thus why we have to deal with stupid issues from over a decade ago: sourceforge.net/projects/jython/files/jython – ArtOfWarfare Jun 3 '14 at 15:05

被这傻逼问题闹的怀疑自己到底会不会写python了……

参考页面:https://stackoverflow.com/questions/19140003/python-jython-if-substring-in-string-always-results-in-typeerror-string-member

猜你喜欢

转载自www.cnblogs.com/slqt/p/9056149.html