New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoneType object is not callable #373

Closed
shakna-israel opened this Issue Mar 22, 2015 · 8 comments

Comments

Projects
None yet
2 participants
@shakna-israel

shakna-israel commented Mar 22, 2015

I'm not sure if this is my own stupidity, related to #283, or something I've ended up doing myself by accident.

I'm working on developing a mkdocs theme, and mkdocs build and mkdocs build --clean both run without any issues.

However, if I try and mkdocs serve then I get hit by an error.

Traceback (most recent call last):
  File "/home/pi/.virtualenvs/face/bin/mkdocs", line 9, in <module>
    load_entry_point('mkdocs==0.11.1', 'console_scripts', 'mkdocs')()
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/mkdocs/main.py", line 60, in run_main
    main(cmd, args=sys.argv[2:], options=dict(opts))
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/mkdocs/main.py", line 33, in main
    serve(config, options=options)
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/mkdocs/serve.py", line 96, in serve
    observer.start()
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/api.py", line 255, in start
    emitter.start()
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/utils/__init__.py", line 111, in start
    self.on_thread_start()
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/polling.py", line 77, in on_thread_start
    self._snapshot = self._take_snapshot()
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/polling.py", line 74, in <lambda>
    self.watch.path, self.watch.is_recursive, stat=stat, listdir=listdir)
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/utils/dirsnapshot.py", line 207, in __init__
    st = stat(path)
OSError: [Errno 2] No such file or directory: '/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/mkdocs/themes/face'
Exception in thread Thread-3 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/api.py", line 146, in run
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/polling.py", line 91, in queue_events
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/polling.py", line 74, in <lambda>
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

My mkdocs.yml file is simple, and I don't think it is the actual cause, but it might be in my own inept way:

site_name: Face Theme
theme_dir: face
theme: face
use_directory_urls: true
repo_url: https://bitbucket.org/shakna-israel/face
dev_addr: 0.0.0.0:8000
@d0ugal

This comment has been minimized.

Member

d0ugal commented Mar 22, 2015

Yup, that looks like a bug and not your fault. I'll need to take a look further to see what is up.

@shakna-israel

This comment has been minimized.

shakna-israel commented Mar 23, 2015

Sorry, should have included a few other things:

Python is 2.7.3
Pip is 6.0.8

And pip freeze gives:

argh==0.26.1
ghp-import==0.4.1
Jinja2==2.7.3
Markdown==2.4.1
MarkupSafe==0.23
mkdocs==0.11.1
pathtools==0.1.2
PyYAML==3.11
watchdog==0.8.3

This is all running on a Raspberry Pi B+, running Raspbian Debian 7.8 (wheezy)

@d0ugal

This comment has been minimized.

Member

d0ugal commented Mar 23, 2015

Thanks - travelling at the moment but should get to this in a few days.

@shakna-israel

This comment has been minimized.

shakna-israel commented Mar 29, 2015

I think something funky is happening when mkdocs tries to split the host and port at the colon(serve.py, Line 107).

With some experimentation I got this:

File "/home/pi/.virtualenvs/necro/local/lib/python2.7/site-packages/mkdocs/serve.py", line 104, in serve
    host, port = config['dev_addr'].split(':', 1)
AttributeError: 'bool' object has no attribute 'split'

Unfortunately, I need mkdocs to serve out to a IP, and not the localhost, so looks like I'll be stuck building and serving for a while... Because I have no idea why split isn't working.

@d0ugal

This comment has been minimized.

Member

d0ugal commented Mar 29, 2015

How did you resolve your previous error?

@d0ugal

This comment has been minimized.

Member

d0ugal commented Mar 29, 2015

I can't see any way that dev_addr would become a boolean, have you changed the code at all? Can I see your latest config?

@shakna-israel

This comment has been minimized.

shakna-israel commented Mar 29, 2015

Seems that using mkvirtualenv meant that mkdocs looked for the "face" theme directory inside mkdocs own theme folder:

OSError: [Errno 2] No such file or directory: '/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/mkdocs/themes/face'

So I tried to isolate if that was the main error, by dropping the theme lines from my config, and specifying dev_addr from the commandline instead:

site_name: Face Theme
use_directory_urls: true
repo_url: https://bitbucket.org/shakna-israel/face

So, to run, I ran this command:

mkdocs serve --dev-addr 192.168.1.2:8000

And instead got this traceback:

Traceback (most recent call last):
  File "/home/pi/.virtualenvs/face/bin/mkdocs", line 9, in <module>
    load_entry_point('mkdocs==0.11.1', 'console_scripts', 'mkdocs')()
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/mkdocs/main.py", line 60, in run_main
    main(cmd, args=sys.argv[2:], options=dict(opts))
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/mkdocs/main.py", line 33, in main
    serve(config, options=options)
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/mkdocs/serve.py", line 104, in serve
    host, port = config['dev_addr'].split(':', 1)
AttributeError: 'bool' object has no attribute 'split'
Exception in thread Thread-3 (most likely raised during interpreter shutdown):Exception in thread Thread-4 (most likely raised during interpreter shutdown):Exception in thread Thread-1 (most likely raised during interpreter shutdown):Exception in thread Thread-2 (most likely raised during interpreter shutdown):



Traceback (most recent call last):Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner

  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/api.py", line 146, in run
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/api.py", line 146, in run

  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/api.py", line 200, in run
  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/api.py", line 146, in run  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/polling.py", line 82, in queue_events
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'Empty'

  File "/usr/lib/python2.7/threading.py", line 404, in wait  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/polling.py", line 82, in queue_events  File "/home/pi/.virtualenvs/face/local/lib/python2.7/site-packages/watchdog/observers/polling.py", line 82, in queue_events


  File "/usr/lib/python2.7/threading.py", line 404, in wait
  File "/usr/lib/python2.7/threading.py", line 404, in wait
  File "/usr/lib/python2.7/threading.py", line 259, in wait  File "/usr/lib/python2.7/threading.py", line 259, in wait

<type 'exceptions.TypeError'>: 'NoneType' object is not callable  File "/usr/lib/python2.7/threading.py", line 259, in wait
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

I believe split can return the boolean error if it's not working on a string.

@d0ugal

This comment has been minimized.

Member

d0ugal commented Mar 30, 2015

I see, interesting. Thanks. This is an odd one, but I have an idea - will look into it.

@d0ugal d0ugal added the Bug label Mar 30, 2015

@d0ugal d0ugal added this to the 0.12.0 milestone Mar 30, 2015

d0ugal added a commit to d0ugal/mkdocs that referenced this issue Apr 2, 2015

@d0ugal d0ugal closed this in #397 Apr 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment