Comments (9)
Yep, it's a bug. I'll fix it in frpc8.
I'll look into the kwargs for loads
, it seems possible to do.
from fastrpc.
useBinary
in loads
was implemented in 01f566c
from fastrpc.
The way loads handles data is dependent on fastRPC library itself, which is trying to be smart, deciding whether it should use Binary or XML based unmarshaller by looking at the stream length and first 2 bytes.
You can craft arbitary length sequences that will pass as valid data, for example <sdfadsfasdfa
I don't currently see a way to enforce Binary unmarshaller to force the validation, I'll see what I can do here.
from fastrpc.
I found the reason the faultCode is sometimes unset - there is no guarantee the faultCode will be the first element in the xml stream:
<?xml version='1.0'?>\n<methodResponse>\n<fault>\n<value><struct>\n<member>\n<name>faultCode</name>\n<value><int>504</int></value>\n</member>\n<member>\n<name>fau ltString</name>\n<value><string>Err</string>...
or
<?xml version='1.0'?>\n<methodResponse>\n<fault>\n<value><struct>\n<member>\n<name>faultString</name>\n<value><string>Err</string></value>\n</member>\n<member>\n< name>faultCode</name>\n<value><int>504</int>...
The code that parses the fault is not able to handle the faultCode if it comes as a second value.
from fastrpc.
faultCode
ok, but it's a bug, right? and should be fixed in major 8 version?
fastRPC library itself, which is trying to be smart
would be nice to have some parameter in fastrpc.loads
where I can specify content-type, for example:
fastrpc.loads(data, use_binary=True/False/None)
where None should be default and it means, try to load it at your discretion (backward compatible) and True and False means use fastrpc or use xmlrpc. Because I know, what data I've got from content-type header.
from fastrpc.
We decided not to change the behavior of loads
(tuple/non-tuple parameters) as it would likely break existing usage and would be hard to fix. We may implement an opt-in change later on, but we don't like the idea of postponing the frpc8 release to implement this.
The useBinary
for loads
will probably make it into the release.
from fastrpc.
We decided not to change the behavior of loads (tuple/non-tuple parameters)
and the behavior is: When method is not set, returns non-tuple, when method is set, returns tuple?
from fastrpc.
Yes. There is unknown amount of code that relies on the current behavior.
from fastrpc.
ok, I will wrap this for myself as well
from fastrpc.
Related Issues (20)
- Python 2.7 binary data and strings don't handle same way
- python-fastrpc: unworking sdist package
- Wrong Datetime serialisation HOT 3
- Unable to get server address from existing ServerProxy object
- Null serialisation vs specification HOT 1
- Debian package for python-fastrpc 8.0.1 cant be installed because of syntax errors HOT 4
- Segfault on cyclic reference
- non-normalized bool values cause frpc binary serializer to produce gibberish
- Missing python-fastrpc 8.0.3 in pypi
- Where can I get python setup.py dependencies?
- Python setup.py should compile the cpp files to create standalone python package
- CI
- ServerProxy seems to revert to protocol version 1.0 after xmlrpc response HOT 3
- Bad docs for Struct_t::erase
- Build Depends v.s. transitive package depends
- Support for application/x-base64-frpc in python handlers HOT 1
- pool.DateTime(time_t, tz) and UTCTime(time_t) are wrong
- python3-fastrpc equal version dependency is not enfoced
- re-do address resolution in case reconnect is needed
- python module dependencies
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 fastrpc.