Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Normal
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: PUP 4.4.0
-
Component/s: None
-
Template:customfield_10700 115228
-
Story Points:2
-
Sprint:Language 2016-02-10, Language 2016-02-24
-
Release Notes:Bug Fix
-
Release Notes Summary:
Description
The current error message that Puppet propagates when lexing files that contain a leading UTF-8 BOM (0xFEFF) is Syntax error at '' at line 1:1.
Saving a file with a UTF-8 BOM is rather common on Windows, and Puppet should be able to report a better error during the parsing phase that helps inform users of the appropriate action to take, given the parser cannot handle a BOM. spec/unit/face/parser_spec.rb currently contains a test documenting the current behavior as part of https://github.com/puppetlabs/puppet/pull/4585/files
Note - this does not impact loading of Ruby code from puppet modules. Such loading uses the Ruby eval method after reading files from disk, and even if the content contains a leading BOM, Ruby does not have a problem parsing / executing the code.