-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried to pass a bytearray but it went wrong #8
Comments
It seems to use Python2.x |
Sorry, the above code may mislead you I also tried it on python3, throwing the same exception Traceback (most recent call last): |
Ok, I understand finally what you want to. |
Thanks for your answer, the problem was solved successfully |
Hello |
msg = messaging.RemotingMessage(
messageId=str(uuid.uuid1()).upper(),
clometOd=None,
operation='findBizObjEx',
destination='superSystemFacadeService',
timeTolive=0,
timestamp=0
)
string = "78daa5524d6fd33018fe2b93cf69643b8d49bc5"
userDtoBytes = bytearray(string, encoding='utf-8')
msg.headers['userDtoBytes'] = userDtoBytes"
userDtoBytes = bytearray(string, encoding='utf-8')
msg.headers['userDtoBytes'] = userDtoBytes
I tried to construct this request but an exception was thrown!
Seems to be an argument that does not support passing a bytearray
I hope to get your reply
Traceback (most recent call last):
File "C:/Users/EDZ/PycharmProjects/untitled1/pyamf_test.py", line 62, in
ihotel_spider.construct_flex_message()
File "C:/Users/EDZ/PycharmProjects/untitled1/pyamf_test.py", line 56, in construct_flex_message
bin_msg = remoting.encode(ev)
File "C:\Users\EDZ\Envs\py2\lib\site-packages\pyamf\remoting_init_.py", line 724, in encode
write_body(name, message, stream, encoder, strict)
File "C:\Users\EDZ\Envs\py2\lib\site-packages\pyamf\remoting_init.py", line 550, in _write_body
encode_body(message)
File "C:\Users\EDZ\Envs\py2\lib\site-packages\pyamf\remoting_init.py", line 523, in _encode_body
encoder.writeElement(x)
File "cpyamf/codec.pyx", line 623, in cpyamf.codec.Encoder.writeElement (cpyamf\codec.c:10902)
File "cpyamf/codec.pyx", line 629, in cpyamf.codec.Encoder.writeElement (cpyamf\codec.c:10661)
File "cpyamf/amf0.pyx", line 581, in cpyamf.amf0.Encoder.handleBasicTypes (cpyamf\amf0.c:7975)
File "cpyamf/amf0.pyx", line 577, in cpyamf.amf0.Encoder.writeAMF3 (cpyamf\amf0.c:7917)
File "cpyamf/codec.pyx", line 645, in cpyamf.codec.Encoder.writeElement (cpyamf\codec.c:10786)
File "cpyamf/amf3.pyx", line 930, in cpyamf.amf3.Encoder.writeObject (cpyamf\amf3.c:11500)
File "cpyamf/codec.pyx", line 629, in cpyamf.codec.Encoder.writeElement (cpyamf\codec.c:10661)
File "cpyamf/amf3.pyx", line 1034, in cpyamf.amf3.Encoder.handleBasicTypes (cpyamf\amf3.c:12466)
File "cpyamf/codec.pyx", line 587, in cpyamf.codec.Encoder.handleBasicTypes (cpyamf\codec.c:9961)
File "cpyamf/amf3.pyx", line 790, in cpyamf.amf3.Encoder.writeDict (cpyamf\amf3.c:10088)
File "cpyamf/codec.pyx", line 645, in cpyamf.codec.Encoder.writeElement (cpyamf\codec.c:10786)
File "cpyamf/amf3.pyx", line 911, in cpyamf.amf3.Encoder.writeObject (cpyamf\amf3.c:11322)
File "C:\Users\EDZ\Envs\py2\lib\site-packages\pyamf\alias.py", line 404, in getEncodableAttributes
return obj.dict.copy()
AttributeError: 'bytearray' object has no attribute 'dict'
The text was updated successfully, but these errors were encountered: