Codec Search Function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James Stroud

    #1

    Codec Search Function

    Hello All,

    I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to find
    the codec for several encodings (hex, base64, etc.). I resorted to
    writing my own for hex, just to see if I could get my program deployed.
    But I think a more permanent solution would be to get pyinstaller
    working right.

    I tried the latest release (unstable version), claiming that it solved
    the problem, but it had problems finding a search function:

    LookupError: no codec search functions registered: can't find encoding

    I looked at the documentation for codecs.register , and it was really not
    clear exactly how I was to create the search function that needs
    registering. Any help would be appreciated.

    James
  • James Stroud

    #2
    Re: Codec Search Function

    James Stroud wrote:[color=blue]
    > Hello All,
    >
    > I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to find
    > the codec for several encodings (hex, base64, etc.). I resorted to
    > writing my own for hex, just to see if I could get my program deployed.
    > But I think a more permanent solution would be to get pyinstaller
    > working right.
    >
    > I tried the latest release (unstable version), claiming that it solved
    > the problem, but it had problems finding a search function:
    >
    > LookupError: no codec search functions registered: can't find encoding
    >
    > I looked at the documentation for codecs.register , and it was really not
    > clear exactly how I was to create the search function that needs
    > registering. Any help would be appreciated.
    >
    > James[/color]

    I was able to get all the functionality I needed from binascii.

    James

    Comment

    • Giovanni Bajo

      #3
      Re: Codec Search Function

      James Stroud wrote:
      [color=blue]
      > I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to
      > find the codec for several encodings (hex, base64, etc.). I resorted
      > to writing my own for hex, just to see if I could get my program
      > deployed. But I think a more permanent solution would be to get
      > pyinstaller working right.
      >
      > I tried the latest release (unstable version), claiming that it solved
      > the problem, but it had problems finding a search function:
      >
      > LookupError: no codec search functions registered: can't find encoding
      >
      > I looked at the documentation for codecs.register , and it was really
      > not clear exactly how I was to create the search function that needs
      > registering. Any help would be appreciated.[/color]


      Do you have a small reproducible sample which shows the problem? With
      PyInstaller SVN version, the problem appeared to be fixed for the testcases I
      had.

      BTW: putting "PyInstalle r" in the subject of the mail for PyInstaller-related
      mails (and/or mailing to the PyInstaller mailing list) would be preferred to
      get a quicker answer.

      Thanks!
      --
      Giovanni Bajo


      Comment

      • James Stroud

        #4
        Re: Codec Search Function

        Giovanni Bajo wrote:[color=blue]
        > James Stroud wrote:
        >
        >[color=green]
        >>I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to
        >>find the codec for several encodings (hex, base64, etc.). I resorted
        >>to writing my own for hex, just to see if I could get my program
        >>deployed. But I think a more permanent solution would be to get
        >>pyinstaller working right.
        >>
        >>I tried the latest release (unstable version), claiming that it solved
        >>the problem, but it had problems finding a search function:
        >>
        >>LookupError : no codec search functions registered: can't find encoding
        >>
        >>I looked at the documentation for codecs.register , and it was really
        >>not clear exactly how I was to create the search function that needs
        >>registering . Any help would be appreciated.[/color]
        >
        >
        >
        > Do you have a small reproducible sample which shows the problem? With
        > PyInstaller SVN version, the problem appeared to be fixed for the testcases I
        > had.
        >
        > BTW: putting "PyInstalle r" in the subject of the mail for PyInstaller-related
        > mails (and/or mailing to the PyInstaller mailing list) would be preferred to
        > get a quicker answer.
        >
        > Thanks![/color]

        How do I get the SVN version? Maybe that is not the one I have. This
        crashes on the version I have (complete program listing):

        "abcde".encode( 'hex')

        LookupError: no codec search functions registered: can't find encoding

        I am using the latest enthought python and the latest snapshot of
        pyinstaller.

        James

        Comment

        • Fredrik Lundh

          #5
          Re: Codec Search Function

          James Stroud wrote:
          [color=blue]
          > How do I get the SVN version? Maybe that is not the one I have. This
          > crashes on the version I have (complete program listing):
          >
          > "abcde".encode( 'hex')
          >
          > LookupError: no codec search functions registered: can't find encoding[/color]
          [color=blue]
          > I am using the latest enthought python and the latest snapshot of
          > pyinstaller.[/color]

          looks like pyinstaller isn't clever enough to bundle the relevant encodings
          by default. see



          for workarounds for py2exe.

          </F>



          Comment

          • Giovanni Bajo

            #6
            Re: Codec Search Function

            James Stroud wrote:
            [color=blue]
            > How do I get the SVN version? Maybe that is not the one I have.[/color]

            svn export svn://pyinstaller.hpc f.upr.edu/trunk pyinstaller
            [color=blue]
            > This
            > crashes on the version I have (complete program listing):
            >
            > "abcde".encode( 'hex')
            >
            > LookupError: no codec search functions registered: can't find encoding[/color]


            I tried it and it works for me with a default spec file. Try again with latest
            PyInstaller from SVN, or otherwise please enter the "buildXXXXX " directory made
            by PyInstaller through the build process, and execute "ArchiveViewer. py
            out1.pyz" (ArchiveViewer. py is shipped with Python). It will display a list of
            all the packaged modules: in my list, 'encodings.hex_ codec' appears.
            --
            Giovanni Bajo


            Comment

            Working...