第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Python代碼AttributeError問(wèn)題:'NoneType'對(duì)象沒(méi)有屬性'title'

Python代碼AttributeError問(wèn)題:'NoneType'對(duì)象沒(méi)有屬性'title'

白板的微信 2021-04-09 18:14:17
我正在嘗試在下面運(yùn)行以下代碼,但該代碼始終失敗,并顯示標(biāo)題中的錯(cuò)誤:追溯(最近一次通話最近):文件“ /usr/local/lib/python2.7/dist-packages/cherrypy/_cprequest.py”,行670,在response response.body = self.handler()文件“ / usr /local/lib/python2.7/dist-packages/cherrypy/lib/encoding.py“,行217,在調(diào)用 self.body = self.oldhandler(* args,** kwargs)文件” / usr / local / lib /python2.7/dist-packages/cherrypy/_cpdispatch.py”,第61行,在調(diào)用中 返回self.callable(* self.args,** self.kwargs)文件“ web / 800-53-server.py”,家庭control_list.append(' %s-%d-%s'%(id,control,id,control,sc.title.title)中的第79行)AttributeError:'NoneType'對(duì)象沒(méi)有屬性'title'似乎出錯(cuò)的代碼塊如下:@cherrypy.exposedef family(self, id="AC", format="html"):    id = id.upper()    family_control_count =  {"AC": 25, "AU": 16, "AT": 5, "CM": 11, "CP": 13, "IA": 11, "IR": 10, "MA": 6, "MP": 8,        "PS": 8, "PE": 20, "PL": 9, "PM": 16, "RA": 6, "CA": 9, "SC": 44, "SI": 17, "SA": 22}    families = {"AC": "Access Control", "AU": "Audit and Accountability", "AT": "Awareness and Training", "CM": "Configuration Management",        "CP": "Contingency Planning", "IA": "Identification and Authentication", "IR": "Incident Response", "MA": "Maintenance",        "MP": "Media Protection", "PS": "Personnel Security", "PE": "Physical and Environmental Protection", "PL": "Planning",        "PM": "Program Management", "RA": "Risk Assessment", "CA": "Security Assessment and Authorization",        "SC": "System and Communications Protection", "SI": "System and Information Integrity", "SA": "System and Services Acquisition"}    control_list = []    for control in range(1,family_control_count[id]+1):        sc = SecControl("%s-%d" % (id, control))        control_list.append('<div><a href="/control?id=%s-%d">%s-%d</a> - %s</div>' % (id, control, id, control, sc.title.title))    return """<html>
查看完整描述

1 回答

?
一只名叫tom的貓

TA貢獻(xiàn)1906條經(jīng)驗(yàn) 獲得超3個(gè)贊

包GovReady(我假設(shè)這是基于import語(yǔ)句使用的)依賴(lài)xsltproc。您可能已將其安裝在mac OS上,但未安裝在其他計(jì)算機(jī)上。sudo apt install xsltproc由于它不是pip軟件包,因此需要根據(jù)您的Linux風(fēng)格進(jìn)行安裝或與之等效。


嘗試xsltproc --stringparam controlnumber 'AC-1' control2json.xsl ../data/800-53-controls.xml從您的800-53-server/lib目錄運(yùn)行。您正在調(diào)用的函數(shù)是該命令的包裝器。


安裝該程序后,我得到


{ "id": "AC-1",

  "title": "ACCESS CONTROL POLICY AND PROCEDURES",

...

}


查看完整回答
反對(duì) 回復(fù) 2021-04-20
  • 1 回答
  • 0 關(guān)注
  • 304 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)