Created originally on Bitbucket by tdziopa (Tomek Dziopa)
Was already merged in Bitbucket before import, marked as merged by the import user
Recent PR introduced a bug with undefined variable ch being accessed when raising DeprecationWarning on errorneous escaping. This PR fixes that issue and changes the names of variables to better reflect their contents (first_escape_error_position -> first_escape_error_char)