[issue3412] Importing filemerge will crash when Mercurial is distributed as a byte-compiled package

Hao Lian bugs at mercurial.selenic.com
Mon Apr 30 16:36:46 CDT 2012


New submission from Hao Lian <hao at fogcreek.com>:

Hi! Python will crash with a None dereference error on this line:

  http://selenic.com/hg/file/038b389d80f5/mercurial/filemerge.py#l28

It assumes __doc__ is always non-None, which is not true when byte-
compilation strips function docstrings out. Our use case is that we run 
py2exe on our product, which uses Mercurial. (We ship the source code 
separately in a ZIP per GPL.) When it imports Mercurial's modules, which 
cause an import to filemerge, Python crashes on that line because py2exe 
byte-compiles all the source files.

It'd be awesome a patch for this could be accepted for 2.2; I'll submit a 
patch tomorrow if nobody else does (I have to head home now).

----------
messages: 19824
nosy: hlian
priority: bug
status: unread
title: Importing filemerge will crash when Mercurial is distributed as a byte-compiled package

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3412>
____________________________________________________


More information about the Mercurial-devel mailing list