error using encoding keyword on windows.

avoid the error
TypeError: 'encoding' is an invalid keyword argument for this function