Skip to content

pydoc -k fails (release30-maint patch) #49703

Closed

Description

@dariusp
mannequin
BPO 5453
Nosy @birkenfeld
Files
  • pydoc-keyword-search-patch-release30-maint.diff
  • pydoc-keyword-search-patch-py3k.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2009-04-05.15:05:56.060>
    created_at = <Date 2009-03-09.02:02:20.833>
    labels = ['library', 'type-crash']
    title = 'pydoc -k fails (release30-maint patch)'
    updated_at = <Date 2009-04-05.15:05:56.058>
    user = 'https://bugs.python.org/dariusp'

    bugs.python.org fields:

    activity = <Date 2009-04-05.15:05:56.058>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-04-05.15:05:56.060>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2009-03-09.02:02:20.833>
    creator = 'dariusp'
    dependencies = []
    files = ['13277', '13278']
    hgrepos = []
    issue_num = 5453
    keywords = ['patch']
    message_count = 2.0
    messages = ['83347', '85510']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'dariusp']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue5453'
    versions = ['Python 3.0', 'Python 3.1']

    Activity

    1. dariusp commented on Mar 9, 2009

      dariuspmannequin
      MannequinAuthor

      pydoc -k fails for both release30-maint and py3k.

      In release30-maint the python io module (or more accurately the
      underlying codecs module used by the io module) raises a
      LookupError if the encoding is invalid. There is a test module
      with a deliberate encoding misspelled as "uft-8". In py3k the C
      io module doesn't raise this exception.

      In addition both release30-maint and py3k raise a SyntaxError if
      the BOM is invalid. Again there is a test module with an invalid
      BOM.

      The only difference between the patch for release30-maint and the
      patch for py3k is that py3k doesn't catch LookupError since the C
      io module doesn't raise it.

      Apart from that, pkgutil.py handles SyntaxError the same as
      ImportError and returns None. pydoc.py handles receiving the
      None and also handles the LookupError the same as
      UnicodeDecodeError.

      A test was added to test_pydoc.py to ensure that a keyword search
      sends text to stdout and nothing to stderr.

      Before (release30-maint):

      $ pydoc -k sys
      errno - This module makes available standard errno system symbols.
      posix - This module provides access to operating system functionality
      that is
      sys - This module provides access to some objects used or maintained by the
      colorsys - Conversion functions between RGB and other color systems.
      distutils.sysconfig - Provide access to Python's configuration
      information.  The specific
      distutils.tests.test_sysconfig - Tests for distutils.dist.
      lib2to3.fixes.fix_sys_exc - Fixer for sys.exc_{type, value, traceback}
      os - OS routines for Mac, NT, or Posix depending on what system we're on.
      site - Append module search paths for third-party packages to sys.path.
      Traceback (most recent call last):
        File "/usr/local/bin/pydoc", line 5, in <module>
          pydoc.cli()
        File "/usr/local/lib/python3.0/pydoc.py", line 2260, in cli
          apropos(val)
        File "/usr/local/lib/python3.0/pydoc.py", line 1966, in apropos
          ModuleScanner().run(callback, key, onerror=onerror)
        File "/usr/local/lib/python3.0/pydoc.py", line 1928, in run
          source = loader.get_source(modname)
        File "/usr/local/lib/python3.0/pkgutil.py", line 293, in get_source
          self.source = self.file.read()
        File "/usr/local/lib/python3.0/io.py", line 1724, in read
          decoder = self._decoder or self._get_decoder()
        File "/usr/local/lib/python3.0/io.py", line 1509, in _get_decoder
          make_decoder = codecs.getincrementaldecoder(self._encoding)
        File "/usr/local/lib/python3.0/codecs.py", line 960, in
      getincrementaldecoder
          decoder = lookup(encoding).incrementaldecoder
      LookupError: unknown encoding: uft-8

      After (release30-maint):

      $ pydoc -k sys
      errno - This module makes available standard errno system symbols.
      posix - This module provides access to operating system functionality
      that is
      sys - This module provides access to some objects used or maintained by the
      colorsys - Conversion functions between RGB and other color systems.
      distutils.sysconfig - Provide access to Python's configuration
      information.  The specific
      distutils.tests.test_sysconfig - Tests for distutils.dist.
      lib2to3.fixes.fix_sys_exc - Fixer for sys.exc_{type, value, traceback}
      os - OS routines for Mac, NT, or Posix depending on what system we're on.
      site - Append module search paths for third-party packages to sys.path.
      test.test_colorsys 
      test.test_largefile - Test largefile support on system where this makes
      sense.
      test.test_sys 
      test.test_syslog 
      warnings - Python part of the warnings subsystem.
      syslog 

      Before (py3k):

      $ pydoc -k sys
      errno - This module makes available standard errno system symbols.
      posix - This module provides access to operating system functionality
      that is
      sys - This module provides access to some objects used or maintained by the
      colorsys - Conversion functions between RGB and other color systems.
      distutils.sysconfig - Provide access to Python's configuration
      information.  The specific
      distutils.tests.test_sysconfig - Tests for distutils.dist.
      importlib.test.import_.test_caching - Test that sys.modules is used
      properly by import.
      lib2to3.fixes.fix_sys_exc - Fixer for sys.exc_{type, value, traceback}
      os - OS routines for Mac, NT, or Posix depending on what system we're on.
      site - Append module search paths for third-party packages to sys.path.
      Traceback (most recent call last):
        File "/usr/local/bin/pydoc", line 5, in <module>
          pydoc.cli()
        File "/usr/local/lib/python3.1/pydoc.py", line 2260, in cli
          apropos(val)
        File "/usr/local/lib/python3.1/pydoc.py", line 1966, in apropos
          ModuleScanner().run(callback, key, onerror=onerror)
        File "/usr/local/lib/python3.1/pydoc.py", line 1925, in run
          loader = importer.find_module(modname)
        File "/usr/local/lib/python3.1/pkgutil.py", line 183, in find_module
          file, filename, etc = imp.find_module(subname, path)
      SyntaxError: encoding problem: with BOM

      After (py3k):

      $ pydoc -k sys
      errno - This module makes available standard errno system symbols.
      posix - This module provides access to operating system functionality
      that is
      sys - This module provides access to some objects used or maintained by the
      colorsys - Conversion functions between RGB and other color systems.
      distutils.sysconfig - Provide access to Python's configuration
      information.  The specific
      distutils.tests.test_sysconfig - Tests for distutils.dist.
      importlib.test.import_.test_caching - Test that sys.modules is used
      properly by import.
      lib2to3.fixes.fix_sys_exc - Fixer for sys.exc_{type, value, traceback}
      os - OS routines for Mac, NT, or Posix depending on what system we're on.
      site - Append module search paths for third-party packages to sys.path.
      test.test_colorsys 
      test.test_largefile - Test largefile support on system where this makes
      sense.
      test.test_sys 
      test.test_syslog 
      warnings - Python part of the warnings subsystem.
      syslog
    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Mar 9, 2009
    3. birkenfeld commented on Apr 5, 2009

      @birkenfeld
      Member

      Fixed in r71242.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytype-crashA hard crash of the interpreter, possibly with a core dump

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions