Coder Social home page Coder Social logo

pg8000's People

Contributors

donalm avatar etrepum avatar gi0baro avatar hackgnar avatar jamadden avatar krysros avatar lucmult avatar mfenniak avatar nad2000 avatar paulbarter avatar reingart avatar repl-mathieu-fenniak avatar sitaktif avatar tlocke avatar ulope avatar williamjmorenor avatar zeha avatar zilder avatar zzzeek avatar

Watchers

 avatar  avatar

pg8000's Issues

ErrorResponse field order is arbitrary

According to the PostgreSQL documentation, the ErrorResponse message body consists of a set of fields separated by the null byte. Each field consists of one byte for the field type, followed by a string encoded in the current client encoding.

The docs explicitly state that these fields can appear in any order.

In core.py the handle_ERROR_RESPONSE method unpacks the field strings from ErrorResponse messages in order and passes them as arguments into ProgrammingError. It seems that ProgrammingError may expect these arguments to arrive in a specific order, so that the SQLSTATE (with prefix 'C') is the 1th argument.

PostgreSQL version 9.6 adds a new field to the ErrorResponse with prefix 'V', and (at least for me) this new field arrives as the 1th field in the message. This causes a test to fail because of this line:
self.assertEqual(e.args[1], '42P01') # table does not exist

Testing with postgres.app v9.6.1.0 and various pythons on OSX.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.