PBR

installing pbr during doc build breaks markupsafe module under some conditions

Bug #1384919 reported by Doug Hellmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PBR
Invalid
Undecided
Unassigned
pylockfile
Fix Released
High
Joshua Harlow
stevedore
Fix Released
Critical
Doug Hellmann

Bug Description

I'm having trouble making the doc build for cliff work. I keep getting an error from markupsafe about "TypeError: object.__new__(Markup) is not safe, use unicode.__new__()". It appears that this error is only triggered if pbr is not installed when "tox -e docs" is run. I can reproduce the problem by:

 $ tox -e docs
 (error)
 $ tox -e docs
 (build works)
 $ rm -rf pbr-*.egg
 $ tox -e docs
 (error)

I added some print statements to markupsafe/__init__.py to see what's going on, and it appears that the markupsafe modules are deleted or unloaded or something at the point when the error happens -- the "text_type" variable defined in markupsafe/_compat.py is None, as is markupsafe._compat itself.

Original failed log: http://logs.openstack.org/16/129716/5/check/gate-cliff-docs/677d00d/console.html

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

Adding "pbr" to the test-requirements.txt list for cliff is one way to eliminate the problem.

The patch that shows the error is https://review.openstack.org/#/c/129716/5

Revision history for this message
Robert Collins (lifeless) wrote :

So this is rather mysterious. pbr isn't in the habit of randomly assigning None to attributes of modules.

https://github.com/mitsuhiko/markupsafe/blob/master/markupsafe/_compat.py is the code in question, and pbr's absence certainly can't explain sys module attributes being bong.

Can I see the print output - I'm particularly interested in whether PY2 is assigned correctly, and what the content of builtins() is when those if blocks run.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

Adding pbr to the requirements list for stevedore fixes the problem in cliff's documentation build.

Changed in pbr:
status: New → Invalid
Changed in python-stevedore:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Doug Hellmann (doug-hellmann)
milestone: none → next-kilo
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

See https://review.openstack.org/#/c/130641/ for the fix in stevedore.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stevedore (master)

Reviewed: https://review.openstack.org/130641
Committed: https://git.openstack.org/cgit/openstack/stevedore/commit/?id=5749d5413c1afaa8ac34b1f1a424ce17fe77cb60
Submitter: Jenkins
Branch: master

commit 5749d5413c1afaa8ac34b1f1a424ce17fe77cb60
Author: Doug Hellmann <email address hidden>
Date: Thu Oct 23 17:41:33 2014 -0400

    Add pbr to dependency list

    We use pbr to install stevedore, and because of the way setuptools deals
    with install-time requirements we also need to include it as a runtime
    dependency to ensure it is installed by pip and not easy_install.

    Change-Id: I0a39bb50218a1a7cdb2d42fb474a9b8f6d6ac32a
    Closes-Bug: #1384919

Changed in python-stevedore:
status: Triaged → Fix Committed
Changed in python-stevedore:
status: Fix Committed → Fix Released
Joshua Harlow (harlowja)
Changed in pylockfile:
assignee: nobody → Joshua Harlow (harlowja)
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to pylockfile (master)

Fix proposed to branch: master
Review: https://review.openstack.org/131336

Changed in pylockfile:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pylockfile (master)

Reviewed: https://review.openstack.org/131336
Committed: https://git.openstack.org/cgit/openstack/pylockfile/commit/?id=028164a0a477584bc2247dc2ff214f3236cdf1d6
Submitter: Jenkins
Branch: master

commit 028164a0a477584bc2247dc2ff214f3236cdf1d6
Author: Joshua Harlow <email address hidden>
Date: Mon Oct 27 20:57:55 2014 -0700

    Add pbr to dependency list

    Currently pbr is breaking markup safe usage in docs, the
    not so obvious way to fix this is to place pbr in the
    explicit requirements for pylockfile.

    Closes-Bug: #1384919

    Change-Id: I0bba2f28956aeeb70b1e15f82d6bb67fdbd49118

Changed in pylockfile:
status: In Progress → Fix Committed
Changed in pylockfile:
milestone: none → 0.11.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.