File "web2py \ gluon \ serializers.py" I did not change. He was the default
I changed the code to your. Does not work. <type 'exceptions.AttributeError'> 'NoneType' object has no attribute 'encode'Версияweb2py™Version 2.9.9-stable+timestamp.2014.09.08.13.16.54 PythonPython 2.7.6: C:\Python27\python.exe (prefix: C:\Python27)Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call last): File "C:\Users\�����\Documents\MEGAsync\Web2pyProject\Ad\web2py\gluon\restricted.py", line 221, in restricted exec ccode in environment File "C:\Users\�����\Documents\MEGAsync\Web2pyProject\Ad\web2py\applications\ads_app_beta\views\generic.rss", line 10, in <module> from gluon.serializers import rss}}{{=XML(rss(response._vars))}} File "C:\Users\�����\Documents\MEGAsync\Web2pyProject\Ad\web2py\gluon\serializers.py", line 168, in rss link=str(feed.get('link', '').encode('utf-8', 'replace')), AttributeError: 'NoneType' object has no attribute 'encode' Error snapshot [image: help] <http://127.0.0.1:8000/admin/default/ticket/ads_app_beta/127.0.0.1.2014-09-08.23-44-01.87a9ad04-cd15-4fa6-ba1e-ed35b5c5908d#> <type 'exceptions.AttributeError'>('NoneType' object has no attribute 'encode') понедельник, 8 сентября 2014 г., 23:17:02 UTC+6 пользователь Massimo Di Pierro написал: > > Looks very wrong > > link=str(feed.get('link', None).encode('utf-8', 'replace')), > > *should be* > > link=str(feed.get('link', '').encode('utf-8', 'replace')), > > On Sunday, 7 September 2014 12:01:10 UTC-5, Капылов Данил wrote: >> >> <type 'exceptions.AttributeError'> 'NoneType' object has no attribute >> 'encode' >> *Version * >> web2py™Version 2.9.8-stable+timestamp.2014.09.07.04.13.28PythonPython >> 2.7.5+: /usr/local/bin/uwsgi (prefix: /usr)Traceback >> >> 1. >> 2. >> 3. >> 4. >> 5. >> 6. >> 7. >> 8. >> 9. >> >> Traceback (most recent call last): >> File "/home/Danilka88/web2py/gluon/restricted.py", line 221, in restricted >> exec ccode in environment >> File "/home/Danilka88/web2py/applications/agro/views/generic.rss", line >> 10, in <module> >> from gluon.serializers import rss}}{{=XML(rss(response._vars))}} >> File "/home/Danilka88/web2py/gluon/serializers.py", line 168, in rss >> link=str(feed.get('link', None).encode('utf-8', 'replace')), >> AttributeError: 'NoneType' object has no attribute 'encode' >> >> >> def rss(feed): >> if not 'entries' in feed and 'items' in feed: >> feed['entries'] = feed['items'] >> now = datetime.datetime.now() >> rss = rss2.RSS2(title=str(feed.get('title', '(notitle)').encode('utf-8', >> 'replace')), >> link=str(feed.get('link', None).encode('utf-8', >> 'replace')), >> >> description=str(feed.get('description', >> '').encode('utf-8', 'replace')), >> lastBuildDate=feed.get('created_on', now), >> items=[rss2.RSSItem( >> title=str(entry.get('title', >> '(notitle)').encode('utf-8', 'replace')), >> >> >> >> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.