Issue #21942: Fixed source file viewing in pydoc's server mode on Windows.

This commit is contained in:
Zachary Ware 2014-07-10 11:21:01 -05:00
commit fff80d984c
3 changed files with 7 additions and 10 deletions

View file

@ -13,6 +13,7 @@
import time
import types
import unittest
import urllib.parse
import xml.etree
import textwrap
from io import StringIO
@ -396,11 +397,7 @@ class PydocDocTest(unittest.TestCase):
def test_html_doc(self):
result, doc_loc = get_pydoc_html(pydoc_mod)
mod_file = inspect.getabsfile(pydoc_mod)
if sys.platform == 'win32':
import nturl2path
mod_url = nturl2path.pathname2url(mod_file)
else:
mod_url = mod_file
mod_url = urllib.parse.quote(mod_file)
expected_html = expected_html_pattern % (
(mod_url, mod_file, doc_loc) +
expected_html_data_docstrings)