어제 스트라이프 패키지를 설치했는데 이제 앱이 실행되고 있지 않습니다. 문제가 어디 있는지 이해하려고합니다. PyShell
또는 HTLParser
또는 다른 것과 관련이 있습니다. 나는 GAE 태그뿐만 아니라 로그에서 추적이 문제에 대해 단서를 얻을 수 있다는 기대와 함께 게시하고있다 :이 AttributeError 문제를 해결하는 방법?
MLStripper instance has no attribute 'rawdata'
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 703, in __call__
handler.post(*groups)
File "/base/data/home/apps/ting-1/1.354723388329082800/ting.py", line 2070, in post
pitch_no_tags = strip_tags(pitch_original)
File "/base/data/home/apps/ting-1/1.354723388329082800/ting.py", line 128, in strip_tags
s.feed(html)
File "/base/python_runtime/python_dist/lib/python2.5/HTMLParser.py", line 107, in feed
self.rawdata = self.rawdata + data
AttributeError: MLStripper instance has no attribute 'rawdata'
이 MLStripper입니다 : MLStripper 어제까지 잘 작동했다
from HTMLParser import HTMLParser
class MLStripper(HTMLParser):
def __init__(self):
set()
self.fed = []
def handle_data(self, d):
self.fed.append(d)
def get_data(self):
return ''.join(self.fed)
def strip_tags(html):
s = MLStripper()
s.feed(html)
return s.get_data()
.
당신이 게시 된 코드를 하나 또는 두 가지 문제가 있습니다https://stackoverflow.com/questions/8152141/how-to-fix-this-attributeerror-with-htmlparser-py
https://stackoverflow.com/questions/8153300/how-to-fix-a-corrupted-pyshell-py
답변에 많은 감사드립니다. 그것은 위대한 작품. 내가 이해할 수 있도록 코드에 몇 가지 코멘트를 추가 하시겠습니까? 그리고 왜 이것이 지금까지 몇 달 동안 제대로 작동하지 않았다고 생각하니 갑자기 작동을 멈췄습니다. 다시 한번 감사드립니다. – Zeynel
@Zeynel. 원본 스크립트의 주요 변경 사항을 보여주기 위해 몇 가지 설명을 추가했습니다. 이전 스크립트가 작동하지 않는 이유는 시스템에서 최근에 변경된 내용을 모른 채로 말하기가 매우 어렵습니다. 그러나 어쨌든 수정 된 스크립트가 더 일반적이라고 생각합니다. – ekhumoro
좋습니다. 다시 한번 감사드립니다. – Zeynel