1. 程式人生 > >WebSphere的jython編碼的一個坑

WebSphere的jython編碼的一個坑

系統 net dash iss member score res error: user

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

WebSphere的jython編碼的一個坑