Giter Site home page Giter Site logo

py-pgproto's People

Contributors

1st1 avatar bryanforbes avatar drscream avatar elprans avatar eltoder avatar fantix avatar krokoziabla avatar sreenandan avatar tailhook avatar vmarkovtsev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

py-pgproto's Issues

Unable to build on Python 3.12

Getting a lot of these errors when trying to build https://github.com/MagicStack/asyncpg on Python 3.12:

  asyncpg/pgproto/pgproto.c:40800:55: error: no member named 'ob_digit' in 'struct _longobject'
              const digit* digits = ((PyLongObject*)x)->ob_digit;
                                    ~~~~~~~~~~~~~~~~~~  ^
  asyncpg/pgproto/pgproto.c:40855:55: error: no member named 'ob_digit' in 'struct _longobject'
              const digit* digits = ((PyLongObject*)x)->ob_digit;
                                    ~~~~~~~~~~~~~~~~~~  ^
  asyncpg/pgproto/pgproto.c:41034:55: error: no member named 'ob_digit' in 'struct _longobject'
              const digit* digits = ((PyLongObject*)x)->ob_digit;
                                    ~~~~~~~~~~~~~~~~~~  ^

I believe this can be solved by converting ((PyLongObject*)x)->ob_digit to ((PyLongObject*)x)->long_value->ob_digit

Tiny fix in hton.h

Should the argument x here have type int32_t?

pack_int32(char *buf, int64_t x)

I understand that the current version will produce exactly the same result.

Some more cython optimizations ?

While working on ChunkedBuffer:

https://github.com/tzickel/chunkedbuffer

I think it's for calling python methods which are already bound to a Python object, it's faster to do instead of (check the annotated output):

self._bufs_popleft(...)

this:

with cython.optimize.unpack_method_calls(False):
    self._bufs_popleft(...)

^^- but it's better to leave it though for calling other stuff, like when calling an .find directly.

Also instead of:

self._bufs = collections.deque()

it's less code

from collections import deque
self._bufs = deque()

Wrong number of items in using codecs API

The codecs.Codec.decode() and encode() APIs return a tuple, while the current code is assuming its first item:

encoded = settings.get_text_codec().encode(obj)
cpython.PyBytes_AsStringAndSize(encoded, cstr, size)

bytes = cpython.PyBytes_FromStringAndSize(data, len)
return settings.get_text_codec().decode(bytes)

This leads to issues in asyncpg when client_encoding is not UTF-8 - all text results are tuples, while text arguments fail to be encoded with errors.

macaddr missed

Trying copy_records_to_table i have this error:

no binary format encoder for type macaddr (OID 829)

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.