Removed the trailing newline from widget attrs.html template. The solution may be revisited by fixing refs #9198 but not for Django 1.11. Thanks Dmitry Ivanchenko for the report and Preston Timmons for advice.
Thanks Matt Westcott for the review.