It is possible the end of line character from PowerShell is not handled properly be Python. Can you provide the version of Python you have installed on your machine? Specifically, regarding the error above, read this:
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.