AttributeError: 'str' object has no attribute 'name' при попытке вывести куки

def cookies_from_file(filename):
with open(filename) as file:
    cookies_data = file.read().replace('\n','').split(';')
cookies_dic = {}
allowed_cookies = {'ltuid', 'ltoken'}
for x in cookies_data:
    key = x.split('=')[0]
    value = x.split('=')[1]
    cookies_dic[key]=value
return {
    x.name: x.value
    for x in cookies_data
    if x.name in allowed_cookies and x.value is not None
}

Ответы (0 шт):