Details
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.