I've been upgrading our Django/Python app to Python 3.9.7 and Django 3.2.7 (from Python 3.5 and Django 1.11.23).
Currently if I try to run python manage.py createsuperuser
I get the following error
Traceback (most recent call last):
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/selector_events.py", line 261, in _add_reader
key = self._selector.get_key(fd)
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/selectors.py", line 193, in get_key
raise KeyError("{!r} is not registered".format(fileobj)) from None
KeyError: '10 is not registered'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/myuser/Development/app/manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/myuser/.pyenv/versions/insta9/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/Users/myuser/.pyenv/versions/insta9/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/myuser/.pyenv/versions/insta9/lib/python3.9/site-packages/django/core/management/base.py", line 367, in run_from_argv
connections.close_all()
File "/Users/myuser/.pyenv/versions/insta9/lib/python3.9/site-packages/django/db/utils.py", line 213, in close_all
connection.close()
File "/Users/myuser/.pyenv/versions/insta9/lib/python3.9/site-packages/django/utils/asyncio.py", line 19, in inner
event_loop = asyncio.get_event_loop()
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/events.py", line 639, in get_event_loop
self.set_event_loop(self.new_event_loop())
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/events.py", line 659, in new_event_loop
return self._loop_factory()
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/unix_events.py", line 54, in __init__
super().__init__(selector)
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/selector_events.py", line 61, in __init__
self._make_self_pipe()
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/selector_events.py", line 112, in _make_self_pipe
self._add_reader(self._ssock.fileno(), self._read_from_self)
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/selector_events.py", line 263, in _add_reader
self._selector.register(fd, selectors.EVENT_READ,
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/selectors.py", line 523, in register
self._selector.control([kev], 0, 0)
TypeError: changelist must be an iterable of select.kevent objects
Exception ignored in: <function BaseEventLoop.__del__ at 0x103307310>
Traceback (most recent call last):
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_events.py", line 683, in __del__
self.close()
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/unix_events.py", line 63, in close
if self._signal_handlers:
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_signal_handlers'
Exception ignored in: <function BaseEventLoop.__del__ at 0x103307310>
Traceback (most recent call last):
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/base_events.py", line 683, in __del__
self.close()
File "/Users/myuser/.pyenv/versions/3.9.7/lib/python3.9/asyncio/unix_events.py", line 63, in close
if self._signal_handlers:
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_signal_handlers'
These are some of the versions I'm using in my requirements.txt
Django==3.2.7
django-braces==1.14.0
django-pipeline==2.0.6
django-storages==1.11.1
djangorestframework==3.12.4
django-localflavor==2.0
django-redis==5.0.0
django_guardian==2.4.0
django-debug-toolbar==3.2.2
django-grappelli==2.15.1
django-extensions==3.1.3
django-simple-history==3.0.0
django-cities-light==3.8.1
django-autoslug==1.9.8
django-constance==2.8.0
django-jsonify==0.3.0
django-bulk-update==2.2.0
django-sslserver==0.22
django-admin-easy==0.6.1
django-admin-rangefilter==0.8.1
django-model-utils==4.1.1
gunicorn==19.7.1
honcho==0.7.1
ipython==5.6.0
eventlet==0.32.0
selenium==2.53.2
This also seems to happen when I runserver, and then kill the server again. Any ideas what could be causing the issue?
Sometimes you don't need async functionality to run the application. In that case set allow async unsafe.
export DJANGO_ALLOW_ASYNC_UNSAFE=True
Related
I have pushed my repository through github. Myrepository can be found here: https://github.com/cody8522/fmv_app
I am receiving an error when deploying my app:
2022-05-27 14:10:40.585 Uncaught app exception
Traceback (most recent call last):
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/cache_utils.py", line 126, in get_or_create_cached_value
return_value = cache.read_value(value_key)
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/memo_decorator.py", line 408, in read_value
raise e
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/memo_decorator.py", line 401, in read_value
pickled_value = self._read_from_mem_cache(key)
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/memo_decorator.py", line 444, in _read_from_mem_cache
raise CacheKeyNotFoundError("Key not found in mem cache")
streamlit.caching.cache_errors.CacheKeyNotFoundError: Key not found in mem cache
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/scriptrunner/script_runner.py", line 443, in _run_script
exec(code, module.__dict__)
File "/app/fmv_app/web_app.py", line 39, in <module>
csv_load()
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/cache_utils.py", line 145, in wrapper
return get_or_create_cached_value()
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/cache_utils.py", line 135, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File "/app/fmv_app/web_app.py", line 25, in csv_load
df = df.merge(pd.read_csv('Venue Information.csv').rename(columns={'Venue':'Name'})[['Name','Adjusted Capacity']],on='Name').drop('Unnamed: 0',axis=1)
File "/home/appuser/venv/lib/python3.9/site-packages/pandas/core/frame.py", line 7284, in merge
return merge(
File "/home/appuser/venv/lib/python3.9/site-packages/pandas/core/reshape/merge.py", line 73, in merge
op = _MergeOperation(
File "/home/appuser/venv/lib/python3.9/site-packages/pandas/core/reshape/merge.py", line 627, in __init__
) = self._get_merge_keys()
File "/home/appuser/venv/lib/python3.9/site-packages/pandas/core/reshape/merge.py", line 996, in _get_merge_keys
left_keys.append(left._get_label_or_level_values(lk))
File "/home/appuser/venv/lib/python3.9/site-packages/pandas/core/generic.py", line 1692, in _get_label_or_level_values
raise KeyError(key)
KeyError: 'Name'
It seems like the KeyError is coming from line 25 of my code:
df = df.merge(pd.read_csv('Venue Information.csv').rename(columns={'Venue':'Name'})[['Name','Adjusted Capacity']],on='Name').drop('Unnamed: 0',axis=1)
The code works fine locally but I am just having this issue when trying to deploy the application. Please let us know if there are any suggestions of what might be causing this. Thank you!
I'm trying to use the Python Processing port by Abhik Pal and Manindra Mohrarna. It seems to work fine, but it gives lots of warnings and errors and it really bothers me.
WARNING: Traceback (most recent call last):
File "C:\Users\gabri\Documents\Programmazione\Python\p5Sketchbook\test.py", line 10, in <module>
run()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 155, in run
p5.sketch = Sketch(setup_method, draw_method, handlers, frame_rate)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 60, in __init__
app.Canvas.__init__(
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 211, in __init__
self.create_native()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 228, in create_native
self._app.backend_module.CanvasBackend(self, **self._backend_kwargs)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends\_glfw.py", line 298, in __init__
self._on_resize(self._id, size[0], size[1])
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends\_glfw.py", line 394, in _on_resize
self._vispy_canvas.events.resize(
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 453, in __call__
self._invoke_callback(cb, event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
_handle_exception(self.ignore_callback_errors,
<< caught exception here: >>
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 157, in on_resize
p5.renderer.reset_view()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\renderer2d.py", line 82, in reset_view
self.texture_prog['modelview'] = self.modelview_matrix.T.flatten()
TypeError: 'NoneType' object does not support item assignment
ERROR: Invoking <bound method Sketch.on_resize of <Sketch (Glfw) at 0x1fba232bfd0>> for ResizeEvent
Exception ignored on calling ctypes callback function: <function CanvasBackend._on_close at 0x000001FBA2375EA0>
Traceback (most recent call last):
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\glfw\__init__.py", line 660, in callback_wrapper
return func(*args, **kwargs)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends\_glfw.py", line 400, in _on_close
self._vispy_canvas.close()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 463, in close
self.events.close()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 453, in __call__
self._invoke_callback(cb, event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 148, in on_close
exit()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\_sitebuiltins.py", line 26, in __call__
raise SystemExit(code)
SystemExit: None
Traceback (most recent call last):
File "C:\Users\gabri\Documents\Programmazione\Python\p5Sketchbook\test.py", line 10, in <module>
run()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 167, in run
exit()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 250, in exit
p5.exit(*args, **kwargs)
AttributeError: module 'p5.core.p5' has no attribute 'exit'
Process returned 1 (0x1) execution time : 20.330 s
What does this mean? Why does it happen and is there a way to fix this?
I'm following this tutorial to experiment Channels with Django. I'm working on Windows 10 HOME, Django 2.1.4 and Python 3.7.1
The goal of this tutorial is to build a chat app.
After downloading chromeDriver and adding it in the PATH, I run this command in my prompt :
py manage.py test chat.tests
Which returns this error message :
EETraceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
======================================================================
ERROR: test_when_chat_message_posted_then_not_seen_by_anyone_in_different_room (chat.tests.ChatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\test\testcases.py", line 202, in __call__
self._pre_setup()
File "C:\Users\kevin\Envs\myproject\lib\site-packages\channels\testing\live.py", line 52, in _pre_setup
self._server_process.start()
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\reduction.py", line 61, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'DaphneProcess.__init__.<locals>.<lambda>'
======================================================================
ERROR: test_when_chat_message_posted_then_seen_by_everyone_in_same_room (chat.tests.ChatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\test\testcases.py", line 202, in __call__
self._pre_setup()
File "C:\Users\kevin\Envs\myproject\lib\site-packages\channels\testing\live.py", line 52, in _pre_setup
self._server_process.start()
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\reduction.py", line 61, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'DaphneProcess.__init__.<locals>.<lambda>'
----------------------------------------------------------------------
Ran 0 tests in 4.689s
FAILED (errors=2)
Destroying test database for alias 'default'...
The same question (https://stackoverflow.com/questions/50016048....) provide a solution, but it doesn't work for me.
When I modify the file reduction.py to replace import pickle by import dill as pickle, I'm getting this new message error :
DevTools listening on ws://127.0.0.1:25037/devtools/browser/b4c722e4-c7f2-49fb-939b-7372e9688eea
C:\Users\kevin\Envs\myproject\lib\site-packages\daphne\server.py:13: UserWarning: Something has already installed a non-asyncio Twisted reactor. Attempting to uninstall it; you can fix this warning by importing daphne.server early in your codebase or finding the package that imports Twisted and importing it later on.
UserWarning,
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
File "C:\Users\kevin\Envs\myproject\lib\site-packages\dill\_dill.py", line 304, in load
obj = pik.load()
File "C:\Users\kevin\Envs\myproject\lib\site-packages\dill\_dill.py", line 465, in find_class
return StockUnpickler.find_class(self, module, name)
File "C:\Users\kevin\Envs\myproject\lib\site-packages\channels\auth.py", line 12, in <module>
from django.contrib.auth.models import AnonymousUser
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\contrib\auth\models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\contrib\auth\base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\db\models\base.py", line 87, in __new__
app_config = apps.get_containing_app_config(module)
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\apps\registry.py", line 249, in get_containing_app_config
self.check_apps_ready()
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\apps\registry.py", line 132, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
Please, someone could bring me help ?
Below is the traceback:
Traceback (most recent call last):
File "/usr/bin/../lib/google-cloud-sdk/bin/bootstrapping/bq.py", line 86, in <module>
exceptions.HandleError(e, 'bq')
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/exceptions.py", line 526, in HandleError
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/exceptions.py", line 137, in reraise
"""Adds tb or the most recent traceback to exc_value and reraises."""
File "/usr/bin/../lib/google-cloud-sdk/bin/bootstrapping/bq.py", line 84, in <module>
main()
File "/usr/bin/../lib/google-cloud-sdk/bin/bootstrapping/bq.py", line 29, in main
version = bootstrapping.ReadFileContents('platform/bq', 'VERSION')
File "/usr/lib/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 288, in ReadFileContents
return files.ReadFileContents(os.path.join(SDK_ROOT, *path_parts)).strip()
AttributeError: 'module' object has no attribute 'ReadFileContents'
I have this code inside one of my routes in a small Bottle project:
#route('/method/')
def method():
import urllib.request
from bottle import response
response.content_type = 'text/xml'
opener = urllib.request.build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
r=opener.open('http://www.example.com/')
content = str(r.read())
soup = BeautifulSoup(content)
return soup.title
I have read similar questions. I've tried everything, but I'm always getting the same error. I don't even know if it's related with bottle.
I have used virtualenv to create an isolated environment with Python3. The version of BeautifulSoup is 4:
from bs4 import BeautifulSoup
I'm always getting the same, giant stacktraces of:
127.0.0.1 - - [24/Jan/2015 14:50:42] "GET /extract_web_information/ HTTP/1.1" 200 0
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 179, in finish_response
for data in self.result:
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/util.py", line 30, in __next__
data = self.filelike.read(self.blksize)
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 183, in finish_response
self.close()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 38, in close
SimpleHandler.close(self)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 321, in close
self.result.close()
TypeError: 'NoneType' object is not callable
127.0.0.1 - - [24/Jan/2015 14:50:42] "GET /extract_web_information/ HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 55533)
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 179, in finish_response
for data in self.result:
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/util.py", line 30, in __next__
data = self.filelike.read(self.blksize)
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 183, in finish_response
self.close()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 38, in close
SimpleHandler.close(self)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 321, in close
self.result.close()
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 141, in run
self.handle_error()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 368, in handle_error
self.finish_response()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 180, in finish_response
self.write(data)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 274, in write
self.send_headers()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 344, in client_is_modern
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 305, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 331, in process_request
self.finish_request(request, client_address)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 344, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 669, in __init__
self.handle()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 133, in handle
handler.run(self.server.get_app())
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 144, in run
self.close()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
127.0.0.1 - - [24/Jan/2015 14:50:42] "GET /extract_web_information/ HTTP/1.1" 200 0
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 179, in finish_response
for data in self.result:
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/util.py", line 30, in __next__
data = self.filelike.read(self.blksize)
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 183, in finish_response
self.close()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 38, in close
SimpleHandler.close(self)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 321, in close
self.result.close()
TypeError: 'NoneType' object is not callable
127.0.0.1 - - [24/Jan/2015 14:50:42] "GET /extract_web_information/ HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 55536)
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 179, in finish_response
for data in self.result:
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/util.py", line 30, in __next__
data = self.filelike.read(self.blksize)
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 183, in finish_response
self.close()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 38, in close
SimpleHandler.close(self)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 321, in close
self.result.close()
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 141, in run
self.handle_error()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 368, in handle_error
self.finish_response()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 180, in finish_response
self.write(data)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 274, in write
self.send_headers()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 344, in client_is_modern
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 305, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 331, in process_request
self.finish_request(request, client_address)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 344, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 669, in __init__
self.handle()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 133, in handle
handler.run(self.server.get_app())
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 144, in run
self.close()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
127.0.0.1 - - [24/Jan/2015 14:50:42] "GET /extract_web_information/ HTTP/1.1" 200 0
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 179, in finish_response
for data in self.result:
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/util.py", line 30, in __next__
data = self.filelike.read(self.blksize)
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 183, in finish_response
self.close()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 38, in close
SimpleHandler.close(self)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 321, in close
self.result.close()
TypeError: 'NoneType' object is not callable
127.0.0.1 - - [24/Jan/2015 14:50:42] "GET /extract_web_information/ HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 55539)
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 179, in finish_response
for data in self.result:
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/util.py", line 30, in __next__
data = self.filelike.read(self.blksize)
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 183, in finish_response
self.close()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 38, in close
SimpleHandler.close(self)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 321, in close
self.result.close()
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 141, in run
self.handle_error()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 368, in handle_error
self.finish_response()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 180, in finish_response
self.write(data)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 274, in write
self.send_headers()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 344, in client_is_modern
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 305, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 331, in process_request
self.finish_request(request, client_address)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 344, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socketserver.py", line 669, in __init__
self.handle()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 133, in handle
handler.run(self.server.get_app())
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 144, in run
self.close()
File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
How I'm running the server
source bin/activate
python myserver.py
After that, GET request from a browser
I have tested that the request is correctly made.
Thanks a lot,
Perhaps there is no <title>. To illustrate this, try replacing your code
return soup.title
with:
return soup.title or "no title found."