Warn instead of crashing because of invalid path in MANIFEST.in (#8286).
sdist used to crash with a full traceback dump instead of printing a
nice warning with the faulty line number.
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index 75950f3..d30de10 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -320,7 +320,10 @@
try:
self.filelist.process_template_line(line)
- except DistutilsTemplateError, msg:
+ # the call above can raise a DistutilsTemplateError for
+ # malformed lines, or a ValueError from the lower-level
+ # convert_path function
+ except (DistutilsTemplateError, ValueError) as msg:
self.warn("%s, line %d: %s" % (template.filename,
template.current_line,
msg))