What does this error mean and is it a Blender bug? While working on an addon we made a hook to our cmake script to add it to blender. (Faster development cycle) We run a fragment of Python via this incantation:

blender -b -P blender_install.py 


Here is the offending piece of code:

bpy.ops.wm.addon_disable(module=argv[1])
bpy.ops.wm.addon_remove(module=argv[1])


(The point is to uninstall the addon if another version was around.)

Blender gets quite creative:

Error: Traceback (most recent call last):
  File "/usr/share/blender/2.79/scripts/startup/bl_operators/wm.py", line 2155, in execute
    context.area.tag_redraw()
AttributeError: 'NoneType' object has no attribute 'tag_redraw'

location: /usr/share/blender/2.79/scripts/modules/bpy/ops.py:189

Traceback (most recent call last):
  File "/usr/share/blender/2.79/scripts/startup/bl_operators/wm.py", line 2155, in execute
    context.area.tag_redraw()
AttributeError: 'NoneType' object has no attribute 'tag_redraw'

location: /usr/share/blender/2.79/scripts/modules/bpy/ops.py:189

location: /usr/share/blender/2.79/scripts/modules/bpy/ops.py:189
Error: Traceback (most recent call last):
  File "/usr/share/blender/2.79/scripts/startup/bl_operators/wm.py", line 2155, in execute
    context.area.tag_redraw()
AttributeError: 'NoneType' object has no attribute 'tag_redraw'

location: /usr/share/blender/2.79/scripts/modules/bpy/ops.py:189

Info: Modules Installed (Audionodes) from '/home/gegaine/Audionodes/Audionodes.zip' into '/home/gegaine/.config/blender/2.79/scripts/addons'
Info: Modules Installed (Audionodes) from '/home/gegaine/Audionodes/Audionodes.zip' into '/home/gegaine/.config/blender/2.79/scripts/addons'


To my eye this looks like a crash having to do with background mode (the -b flag).

Am I doing something wrong or is this a bug with Blender's headless mode?
Not all Python operations are supported when running Blender in the background. The reasons for this is that operations are actions from user interface perspective. And some operations uses Graphical stuff like Window, Area or Region classes that do not exist when not having an UI.

The tag_redraw points me into that direction. You might try to fix the operation to make the wm.py not updating the UI at that point, but it not a bug.