Comments (8)
I have now added Py_DECREF on the temporary objects. Otherwise, if I add
fprintf(stderr, "codecs refs=%ld", (long)Py_REFCNT(codecs));
then I see the reference count increasing on each call.
from hiredis-py.
Fair point. Would you like to do this and send a PR?
from hiredis-py.
Which behaviour do you want: don't validate the encoding, or validate it via codecs.lookup_error
? The former seems more natural to me, but is a minor behaviour change.
from hiredis-py.
I prefer the latter one. It's the current behavior.
If we don't validate the coding in the Reader_init
phase, it is possible that reader.gets
will raise a LookupError
. Maybe I'm a little pedantic but it's kind of an API change.
from hiredis-py.
OK - can you tell me the correct way to call codecs.lookup_error
from C ?
from hiredis-py.
Import module: https://docs.python.org/3/c-api/import.html#c.PyImport_ImportModule
Call method: https://docs.python.org/3/c-api/object.html#c.PyObject_CallMethod
from hiredis-py.
OK, done. However I'm not sure if my unit test test_decode_error_with_surrogateescape_errors
will work for python2.7; it could be made conditional or removed entirely.
from hiredis-py.
Fixed it
from hiredis-py.
Related Issues (20)
- Can not decode resp3's big number type HOT 4
- pip install failing for version 2.0.0 python 3.10 HOT 2
- Can't install hiredis HOT 2
- C99 errors with older gcc HOT 4
- PUSH type not distinguishable from ARRAY type in RESP3 HOT 4
- Release for supporting Python 3.10 HOT 9
- Support newest hiredis release 1.1.0
- Source tarballs unavailable on pypi? HOT 5
- Changelog entry missing for 2.1.0
- Support dispatch/manual and tagged releases
- Windows wheels fail to build due to ssize_t redefinition HOT 2
- CI needs to properly account for all buildwheels attempts - at least in some labelled cases HOT 1
- sdsalloc.h doesn't seem to be installed as part of regular hiredis HOT 9
- Support garbage collection in Reader HOT 1
- Tag mismatch for 2.2.3/2.3.0 release HOT 2
- tests/test_asyncio/test_connect.py hangs on Python 3.12
- Release 2.3.0 not available on PyPI HOT 4
- Python 3.12 wheels HOT 2
- Memory leak on hgetall with RESP3 and hiredis HOT 2
- hiredis 2.3.2 probably causes fastapi app crashes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hiredis-py.