sphinx_doc_gen.py causes ValueError: list.remove(x): x not in list #82493

Closed
opened 2020-11-07 20:36:40 +01:00 by Grische · 13 comments

System Information
Operating system: Linux
Graphics card: -

Blender Version
Broken: 2.91.0-02677ec4e0fa
Worked: 2.90
Caused by blender/blender@fa566157a5

Short description of error
Running Blender with sphinx_doc_gen.py causes a ValueError: list.remove(x): x not in list

Exact steps for others to reproduce the error

  1. Clone Blender: git clone https://git.blender.org/blender.git
  2. Checkout 2.91 branch: cd blender.git && git checkout -b blender-v2.91-release && cd ..
  3. Extract blender and enter its directory cd blender-2.91.0-02677ec4e0fa-linux64
  4. Run Blender:
  `./blender --background --factory-startup -noaudio --python ../blender/doc/python_api/sphinx_doc_gen.py -- --output /tmp/blender_sphinx`
  1. Observe error:
    ./blender --background --factory-startup -noaudio --python ../blender.git/doc/python_api/sphinx_doc_gen.py -- --output /tmp/blender_sphinx
...
Exception in module unregister(): '/home/ubuntu/blender-2.91.0-02677ec4e0fa-linux64/2.91/scripts/addons/cycles/__init__.py'
Traceback (most recent call last):
  File "/home/ubuntu/blender-2.91.0-02677ec4e0fa-linux64/2.91/scripts/modules/addon_utils.py", line 434, in disable
    mod.unregister()
  File "/home/ubuntu/blender-2.91.0-02677ec4e0fa-linux64/2.91/scripts/addons/cycles/__init__.py", line 153, in unregister
    bpy.app.handlers.version_update.remove(version_update.do_versions)
ValueError: list.remove(x): x not in list

This worked fine in 2.90.

**System Information** Operating system: Linux Graphics card: - **Blender Version** Broken: 2.91.0-02677ec4e0fa Worked: 2.90 Caused by blender/blender@fa566157a5 **Short description of error** Running Blender with sphinx_doc_gen.py causes a ValueError: list.remove(x): x not in list **Exact steps for others to reproduce the error** 1. Clone Blender: `git clone https://git.blender.org/blender.git` 2. Checkout 2.91 branch: `cd blender.git && git checkout -b blender-v2.91-release && cd ..` 3. Extract blender and enter its directory `cd blender-2.91.0-02677ec4e0fa-linux64` 4. Run Blender: ``` `./blender --background --factory-startup -noaudio --python ../blender/doc/python_api/sphinx_doc_gen.py -- --output /tmp/blender_sphinx` ``` 5. Observe error: ``` ./blender --background --factory-startup -noaudio --python ../blender.git/doc/python_api/sphinx_doc_gen.py -- --output /tmp/blender_sphinx ... Exception in module unregister(): '/home/ubuntu/blender-2.91.0-02677ec4e0fa-linux64/2.91/scripts/addons/cycles/__init__.py' Traceback (most recent call last): File "/home/ubuntu/blender-2.91.0-02677ec4e0fa-linux64/2.91/scripts/modules/addon_utils.py", line 434, in disable mod.unregister() File "/home/ubuntu/blender-2.91.0-02677ec4e0fa-linux64/2.91/scripts/addons/cycles/__init__.py", line 153, in unregister bpy.app.handlers.version_update.remove(version_update.do_versions) ValueError: list.remove(x): x not in list ``` This worked fine in 2.90.
Author

Added subscriber: @grische

Added subscriber: @grische
Aaron Carlisle was assigned by Grische 2020-11-07 20:38:03 +01:00
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

@ideasman42 perhaps this is caused by your recent app version changes

@ideasman42 perhaps this is caused by your recent app version changes

Added subscriber: @rjg

Added subscriber: @rjg

This seems to be cause by Cycles not checking if the handler exists it tries to remove (init.py ).

def unregister():
    from bpy.utils import unregister_class
    from . import ui
    from . import operators
    from . import properties
    from . import presets
    import atexit

    bpy.app.handlers.version_update.remove(version_update.do_versions)

    ui.unregister()
    operators.unregister()
    properties.unregister()
    presets.unregister()

    for cls in classes:
        unregister_class(cls)

Since sphinx_doc_gen.py removes the handler in setup_blender(), Cycles can't remove it on unregister.

This seems to be cause by Cycles not checking if the handler exists it tries to remove ([__init__.py ](https://developer.blender.org/diffusion/B/browse/master/intern/cycles/blender/addon/__init__.py)). ``` def unregister(): from bpy.utils import unregister_class from . import ui from . import operators from . import properties from . import presets import atexit bpy.app.handlers.version_update.remove(version_update.do_versions) ui.unregister() operators.unregister() properties.unregister() presets.unregister() for cls in classes: unregister_class(cls) ``` Since `sphinx_doc_gen.py` removes the handler in `setup_blender()`, Cycles can't remove it on unregister.
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

This broke somewhere inbetween blender/blender@0a66436fe5 and blender/blender@b002fdc4bf.
Very much likely is blender/blender@fa566157a5.

Of course we could check if the handler exists, but afaict, we would have to do this for every Addon.
So maybe there is a more general fix to the situation @ideasman42 ?

This broke somewhere inbetween blender/blender@0a66436fe5 and blender/blender@b002fdc4bf. Very much likely is blender/blender@fa566157a5. Of course we could check if the handler exists, but afaict, we would have to do this for every Addon. So maybe there is a more general fix to the situation @ideasman42 ?
Aaron Carlisle removed their assignment 2020-11-13 01:29:55 +01:00
Member

Added subscriber: @Blendify

Added subscriber: @Blendify

This issue was referenced by blender/blender@07db110add

This issue was referenced by blender/blender@07db110add161c50b48cb7bc8e1c77f2b12b2c76

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Campbell Barton self-assigned this 2020-11-20 09:01:50 +01:00
Author

@ideasman42 @Blendify Thanks for the quick fix!
I just noticed that Blender 2.83.9 seems to be affected by this issue:
commit 7e39e0a9f62b13e0b3a91df4cf9477a4eaef3dd9

Should I open another bug report for that?

@ideasman42 @Blendify Thanks for the quick fix! I just noticed that Blender 2.83.9 seems to be affected by this issue: commit 7e39e0a9f62b13e0b3a91df4cf9477a4eaef3dd9 Should I open another bug report for that?
Member

The issue shouldn't affect the output of the API documentation so there is no real need to have it fixed

The issue shouldn't affect the output of the API documentation so there is no real need to have it fixed
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#82493
No description provided.