Skip to content
Advertisement

Troubelshooting raise TypeError(“quote_from_bytes() expected bytes”)

I have an error raised by the following piece of code

JavaScript

The params are Make_Payment_params = { “debitAccountNumber”: 12003189487, “creditAccountNumber”: 12065812627, “amount”: 100, “requestedExecutionDate”: “2019-03-09” }

and the error is raise TypeError(“quote_from_bytes() expected bytes”) TypeError: quote_from_bytes() expected bytes

Help is much appreciated

Advertisement

Answer

The argument to urllib.parse.quote must be a string, but your code sometimes passes integers instead. Changing the call to something like urllib.parse.quote(str(param_value)) should fix the problem.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement