Bug 5693 - Python-docs do not works
Summary: Python-docs do not works
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 2
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: mga2-32-ok mga2-64-ok
Keywords: Junior_job, validated_update
Depends on:
Blocks:
 
Reported: 2012-04-30 16:27 CEST by Jacques Pronchery
Modified: 2013-09-19 11:25 CEST (History)
13 users (show)

See Also:
Source RPM: python
CVE:
Status comment:


Attachments

Description Jacques Pronchery 2012-04-30 16:27:21 CEST
Python docs are unreadable because it is not allow reading for user.
Manuel Hiebel 2012-04-30 16:35:00 CEST

Keywords: (none) => Junior_job
CC: (none) => misc
Source RPM: python-docs-2.7.3-2.mga2 => python

Comment 1 Manuel Hiebel 2012-05-01 00:16:21 CEST
*** Bug 4622 has been marked as a duplicate of this bug. ***

CC: (none) => n54

Comment 2 Marja Van Waes 2012-05-26 13:06:12 CEST
Hi,

This bug was filed against cauldron, but we do not have cauldron at the moment.

Please report whether this bug is still valid for Mageia 2.

Thanks :)

Cheers,
marja

Keywords: (none) => NEEDINFO

Comment 3 JeanBaptiste Lamy 2012-06-06 20:38:31 CEST
The bug IS still present in Mageia 2 :-(

CC: (none) => jibalamy
Version: Cauldron => 2

Sander Lepik 2012-06-07 00:25:54 CEST

Keywords: NEEDINFO => (none)
CC: (none) => sander.lepik
Version: 2 => Cauldron
Whiteboard: (none) => MGA2TOO

Comment 4 Edward Diener 2013-04-21 18:53:51 CEST
I can confirm that this bug is still not fixed for Mageia 2, as I encountered it recently.

CC: (none) => eldlistmailingz

Comment 5 Florian Hubold 2013-04-21 19:25:20 CEST
For reference, came up in the forums recently: https://forums.mageia.org/en/viewtopic.php?f=8&t=4758

Together with instructions how to workaround the problem, e.g.

find /usr/share/doc/python-docs -type d -exec chmod 755 {} \;
find /usr/share/doc/python-docs -type f -exec chmod 644 {} \;

Sent mail to Oliver, if he can't take a look i'll try to fix it before mga3 will be released.

CC: (none) => doktor5000
Hardware: i586 => All
Assignee: bugsquad => oliver.bgr

Comment 6 Alfred Kretschmer 2013-04-21 20:04:08 CEST
btw. still valid for Mageia3

CC: (none) => alfred.kretschmer

Comment 7 Florian Hubold 2013-04-22 21:29:31 CEST
When trying to troubleshoot/fix this, weird thing is that my local rebuild of the cauldron python branch does fail during the test step, ironically while testing the documentation:

346 tests OK.
1 test failed:
    test_pydoc

[...]

Re-running failed tests in verbose mode
Re-running test 'test_pydoc' in verbose mode
test_html_doc (test.test_pydoc.PyDocDocTest) ... 
--- expected
+++ got
@@ -19 +19 @@
-<dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#B">B</a>
+<dt><font face="helvetica, arial">B
@@ -22 +22 @@
-<dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#A">A</a>
+<dt><font face="helvetica, arial">A
@@ -56,12 +55,0 @@
-<tr bgcolor="#eeaa77">
-<td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
-    
-<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><dl><dt><a name="-doc_func"><strong>doc_func</strong></a>()</dt><dd><tt>This&nbsp;function&nbsp;solves&nbsp;all&nbsp;of&nbsp;the&nbsp;world's&nbsp;problems:<br>
-hunger<br>
-lack&nbsp;of&nbsp;Python<br>
-war</tt></dd></dl>
- <dl><dt><a name="-nodoc_func"><strong>nodoc_func</strong></a>()</dt></dl>
-</td></tr></table><p>
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">

FAIL
test_input_strip (test.test_pydoc.PyDocDocTest) ... ok
test_issue8225 (test.test_pydoc.PyDocDocTest) ... ok
test_not_here (test.test_pydoc.PyDocDocTest) ... ok
test_stripid (test.test_pydoc.PyDocDocTest) ... ok
test_text_doc (test.test_pydoc.PyDocDocTest) ... 
--- expected
+++ got
@@ -34,9 +33,0 @@
-FUNCTIONS
-    doc_func()
-        This function solves all of the world's problems:
-        hunger
-        lack of Python
-        war
-    
-    nodoc_func()
-

FAIL
test_apropos_with_bad_package (test.test_pydoc.PydocImportTest) ... FAIL
test_apropos_with_unreadable_dir (test.test_pydoc.PydocImportTest) ... FAIL
test_badimport (test.test_pydoc.PydocImportTest) ... ok
test_class (test.test_pydoc.TestDescriptions) ... ok
test_classic_class (test.test_pydoc.TestDescriptions) ... ok
test_module (test.test_pydoc.TestDescriptions) ... ok
test_namedtuple_public_underscore (test.test_pydoc.TestDescriptions) ... ok
test_builtin (test.test_pydoc.TestHelper) ... ok
test_keywords (test.test_pydoc.TestHelper) ... ok

======================================================================
FAIL: test_html_doc (test.test_pydoc.PyDocDocTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/test_pydoc.py", line 235, in test_html_doc
    self.fail("outputs are not equal, see diff above")
AssertionError: outputs are not equal, see diff above

======================================================================
FAIL: test_text_doc (test.test_pydoc.PyDocDocTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/test_pydoc.py", line 245, in test_text_doc
    self.fail("outputs are not equal, see diff above")
AssertionError: outputs are not equal, see diff above

======================================================================
FAIL: test_apropos_with_bad_package (test.test_pydoc.PydocImportTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/test_pydoc.py", line 316, in test_apropos_with_bad_package
    result = run_pydoc('zqwykjv', '-k', PYTHONPATH=TESTFN)
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/test_pydoc.py", line 185, in run_pydoc
    rc, out, err = assert_python_ok('-B', pydoc.__file__, *args, **env)
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/script_helper.py", line 49, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/script_helper.py", line 41, in _assert_python
    "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 1, stderr follows:
Traceback (most recent call last):
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pydoc.py", line 2358, in <module>
    if __name__ == '__main__': cli()
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pydoc.py", line 2297, in cli
    apropos(val)
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pydoc.py", line 1994, in apropos
    ModuleScanner().run(callback, key, onerror=onerror)
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pydoc.py", line 1968, in run
    StringIO.StringIO(loader.get_source(modname))
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pkgutil.py", line 310, in get_source
    self.source = self._get_delegate().get_source()
AttributeError: 'NoneType' object has no attribute 'get_source'

======================================================================
FAIL: test_apropos_with_unreadable_dir (test.test_pydoc.PydocImportTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/test_pydoc.py", line 326, in test_apropos_with_unreadable_dir
    result = run_pydoc('zqwykjv', '-k', PYTHONPATH=TESTFN)
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/test_pydoc.py", line 185, in run_pydoc
    rc, out, err = assert_python_ok('-B', pydoc.__file__, *args, **env)
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/script_helper.py", line 49, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/test/script_helper.py", line 41, in _assert_python
    "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 1, stderr follows:
Traceback (most recent call last):
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pydoc.py", line 2358, in <module>
    if __name__ == '__main__': cli()
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pydoc.py", line 2297, in cli
    apropos(val)
  Fitest test_pydoc failed -- multiple errors occurred
le "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pydoc.py", line 1994, in apropos
    ModuleScanner().run(callback, key, onerror=onerror)
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pydoc.py", line 1968, in run
    StringIO.StringIO(loader.get_source(modname))
  File "/home/doktor5000/MGA/CAULDRON/python/BUILD/Python-2.7.3/Lib/pkgutil.py", line 310, in get_source
    self.source = self._get_delegate().get_source()
AttributeError: 'NoneType' object has no attribute 'get_source'

----------------------------------------------------------------------
Ran 15 tests in 2.533s

FAILED (failures=4)



I'm not into python that much, and don't even know where to start with this one :/
Comment 8 Florian Hubold 2013-04-23 21:34:26 CEST
I've excluded this test, this allowed the build to complete, and i've looked at the resulting permissions, they're looking fine. My svn diff looks as follows:

[doktor5000@Mageia2 python]$ LC_ALL=C svn diff
Index: SPECS/python.spec
===================================================================
--- SPECS/python.spec   (revision 410738)
+++ SPECS/python.spec   (working copy)
@@ -27,7 +27,7 @@
 Summary:        An interpreted, interactive object-oriented programming language
 Name:           python
 Version:        2.7.3
-Release:        %mkrel 7
+Release:        %mkrel 8
 License:        Modified CNRI Open Source License
 Group:          Development/Python
 Url:            http://www.python.org/
@@ -232,6 +232,8 @@
 
 mkdir html
 bzcat %{SOURCE1} | tar x  -C html
+find ./html -type d -exec chmod 755 {} \;
+find ./html -type f -exec chmod 644 {} \;

 find . -type f -print0 | xargs -0 perl -p -i -e 's@/usr/local/bin/python@/usr/bin/python@'

@@ -318,7 +320,7 @@
 #    raise AttributeError, attr
 # AttributeError: timeout

-make test TESTOPTS="-w -l -x test_gdb -x test_site -x test_io -x test_distutils -x test_urllib2 %custom_test"
+make test TESTOPTS="-w -l -x test_gdb -x test_site -x test_io -x test_distutils -x test_urllib2 -x test_pydoc %custom_test"

 %install
 rm -rf $RPM_BUILD_ROOT


%defattr alone was not enough, or it would have needed 0755, as it applies the same permissions to files and directories, and i'm not sure we want all the files executable for others.


@Oliver: Are you ok for me to commit that? Someone still would need to look why the pydocs test fails, but that may also be totally unrelated, or a non-issue on the buildsystem maybe.
Comment 9 Florian Hubold 2013-04-23 22:38:48 CEST
Actually using %defattr works, but directory permissions neet to be set explicitly.

[doktor5000@Mageia2 python]$ LC_ALL=C svn diff
Index: SPECS/python.spec
===================================================================
--- SPECS/python.spec   (revision 410738)
+++ SPECS/python.spec   (working copy)
@@ -27,7 +27,7 @@
 Summary:        An interpreted, interactive object-oriented programming language
 Name:           python
 Version:        2.7.3
-Release:        %mkrel 7
+Release:        %mkrel 8
 License:        Modified CNRI Open Source License
 Group:          Development/Python
 Url:            http://www.python.org/
@@ -318,7 +318,7 @@
 #    raise AttributeError, attr
 # AttributeError: timeout

-make test TESTOPTS="-w -l -x test_gdb -x test_site -x test_io -x test_distutils -x test_urllib2 %custom_test"
+make test TESTOPTS="-w -l -x test_gdb -x test_site -x test_io -x test_distutils -x test_urllib2 -x test_pydoc %custom_test"

 %install
 rm -rf $RPM_BUILD_ROOT
@@ -506,6 +506,7 @@
 %exclude %{_includedir}/python%{dirver}/pyconfig.h

 %files docs
+%defattr(0644,root,root,0755)
 %doc html/*/*
 %{_datadir}/applications/%{_real_vendor}-%{name}-docs.desktop
Philippe Makowski 2013-09-03 16:07:42 CEST

CC: (none) => makowski.mageia

Comment 10 Philippe Makowski 2013-09-05 20:29:51 CEST
seems that it is fixed in mga3 and cauldron, but not yet in mga2
Philippe Makowski 2013-09-05 20:31:49 CEST

Assignee: oliver.bgr => makowski.mageia

Comment 11 Philippe Makowski 2013-09-05 21:59:24 CEST
python-2.7.3-2.5.mga2 is in update testing

Assignee: makowski.mageia => bugsquad

Comment 12 Manuel Hiebel 2013-09-06 18:42:40 CEST
it's for the qa then not the bugsquad, no ?
Comment 13 Philippe Makowski 2013-09-06 19:13:52 CEST
Suggested advisory:
========================

Updated python-doc packages to make docs readable by regular users

Updated package in core/updates_testing:
========================
python-docs-2.7.3-2.5.mga2.noarch.rpm

libpython-devel-2.7.3-2.5.mga2
libpython2.7-2.7.3-2.5.mga2
python-2.7.3-2.5.mga2
tkinter-2.7.3-2.5.mga2
tkinter-apps-2.7.3-2.5.mga2

Source RPMs: 
python-2.7.3-2.5.mga2.src.rpm

Assignee: bugsquad => qa-bugs

Samuel Verschelde 2013-09-06 20:10:22 CEST

CC: (none) => stormi
Version: Cauldron => 3

Philippe Makowski 2013-09-06 20:19:48 CEST

Version: 3 => 2

Comment 14 Dave Hodgins 2013-09-07 23:42:00 CEST
Advisory 5693.adv committed to svn.

CC: (none) => davidwhodgins

Comment 15 David GEIGER 2013-09-14 08:56:33 CEST
Testing complete mga2_32, ok for me nothing to report.


[david@localhost ~]$ python /usr/lib/python2.7/test/test_pydoc.py
test_html_doc (__main__.PyDocDocTest) ... ok
test_input_strip (__main__.PyDocDocTest) ... ok
test_issue8225 (__main__.PyDocDocTest) ... ok
test_not_here (__main__.PyDocDocTest) ... ok
test_stripid (__main__.PyDocDocTest) ... ok
test_text_doc (__main__.PyDocDocTest) ... ok
test_apropos_with_bad_package (__main__.PydocImportTest) ... ok
test_apropos_with_unreadable_dir (__main__.PydocImportTest) ... ok
test_badimport (__main__.PydocImportTest) ... ok
test_class (__main__.TestDescriptions) ... ok
test_classic_class (__main__.TestDescriptions) ... ok
test_module (__main__.TestDescriptions) ... ok
test_namedtuple_public_underscore (__main__.TestDescriptions) ... ok
test_builtin (__main__.TestHelper) ... ok
test_keywords (__main__.TestHelper) ... ok

----------------------------------------------------------------------
Ran 15 tests in 19.994s

OK

CC: (none) => geiger.david68210

David GEIGER 2013-09-14 08:57:07 CEST

Whiteboard: MGA2TOO => MGA2TOO mga2-32-ok

Comment 16 claire robinson 2013-09-16 10:40:18 CEST
Testing mga2 64

The test in comment 15 doesn't display the problem. It also completes before the update, so the results are misleading.

Before
------
$ ll /usr/share/doc/python-docs/index.html
-rw-r----- 1 root root 9121 Aug 12 13:07 /usr/share/doc/python-docs/index.html

Shows the docs owned by root with no read permission for others.

$ ll -R /usr/share/doc/python-docs/

Shows the other docs are the same and access to subdirectories is prevented.
eg.
ls: cannot open directory /usr/share/doc/python-docs/c-api: Permission denied
ls: cannot open directory /usr/share/doc/python-docs/distutils: Permission denied
etc.


After
-----
$ ll /usr/share/doc/python-docs/index.html 
-rw-r--r-- 1 root root 9121 Sep  5 19:43 /usr/share/doc/python-docs/index.html

Shows read permission for others.

$ ll -R /usr/share/doc/python-docs/

Shows the rest, including subdir's, are now too and file:///usr/share/doc/python-docs/index.html can now be displayed in a browser.

Python tested with some basic scripts run in idle.

I'll double check on mga2 32

Whiteboard: MGA2TOO mga2-32-ok => MGA2TOO mga2-32-ok mga3-64-ok

Comment 17 claire robinson 2013-09-16 11:20:13 CEST
Same results mga2 32. Confirmed mga3 is not affected.

Validating

Could sysadmin please push from 2 core/updates_testing to updates

Thanks!

Keywords: (none) => validated_update
Whiteboard: MGA2TOO mga2-32-ok mga3-64-ok => mga2-32-ok mga3-64-ok
CC: (none) => sysadmin-bugs

claire robinson 2013-09-16 11:20:25 CEST

Whiteboard: mga2-32-ok mga3-64-ok => mga2-32-ok mga2-64-ok

Comment 18 Thomas Backlund 2013-09-19 11:25:03 CEST
Update pushed:
http://advisories.mageia.org/MGAA-2013-0105.html

Status: NEW => RESOLVED
CC: (none) => tmb
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.