This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alexandre.vassalotti
Recipients alexandre.vassalotti, christian.heimes, gvanrossum
Date 2007-10-14.16:00:21
SpamBayes Score 0.0009168339
Marked as misclassified No
Message-id <1192377622.87.0.989770474728.issue1272@psf.upfronthosting.co.za>
In-reply-to
Content
> I have a question for Alexandre related to frozen.c -- why is there a
> mode line with an encoding involved in freezing hello.py?

For some reason which I don't know about, freeze.py tries to read all
the modules accessible from sys.path:

    # collect all modules of the program
    dir = os.path.dirname(scriptfile)
    path[0] = dir
    mf = modulefinder.ModuleFinder(path, debug, exclude, replace_paths)

The problem is the imp module, which modulefinder uses, does not
detect the encoding of the files from the mode-line. This causes
TextIOWrapper to crash when it tries to read modules using an encoding
other than ASCII or UTF-8. Here an example:

  >>> import imp
  >>> imp.find_module('heapq')[0].read()
  Traceback (most recent call last):
  ...
  UnicodeDecodeError: 'utf8' codec can't decode bytes in position
  1428-1430: invalid data

I probably should open a seperate issue in the tracker for this,
though.
History
Date User Action Args
2007-10-14 16:00:22alexandre.vassalottisetspambayes_score: 0.000916834 -> 0.0009168339
recipients: + alexandre.vassalotti, gvanrossum, christian.heimes
2007-10-14 16:00:22alexandre.vassalottisetspambayes_score: 0.000916834 -> 0.000916834
messageid: <1192377622.87.0.989770474728.issue1272@psf.upfronthosting.co.za>
2007-10-14 16:00:22alexandre.vassalottilinkissue1272 messages
2007-10-14 16:00:21alexandre.vassalotticreate