Git Product home page Git Product logo

Comments (5)

StdCarrot avatar StdCarrot commented on August 23, 2024 1

Ok, I understand finally what you want to.
If you want to use ByteArray type on AMF, it doesn't mean bytearray on Python.
ByteArray is AMF specific type, so, if you want to use it, you must use ByteArray class in lib.
See this page, line 363.
https://github.com/StdCarrot/Py3AMF/blob/master/pyamf/tests/test_amf3.py
There is how to use ByteArray in Py3AMF or PyAMF.

from py3amf.

StdCarrot avatar StdCarrot commented on August 23, 2024

It seems to use Python2.x
This project only support Python3.
Can you make sure where your code run on?

from py3amf.

qczrzl avatar qczrzl commented on August 23, 2024

Sorry, the above code may mislead you
The above code is run on Python2 using the pyamf library

I also tried it on python3, throwing the same exception
It's uses the py3amf library, And, I used Python3.5.4

Traceback (most recent call last):
File "C:/GitWorkSpace/comments_spider/py3rmf_test.py", line 72, in
data = ihotel_spider.construct_flex_message()
File "C:/GitWorkSpace/comments_spider/py3rmf_test.py", line 54, in construct_flex_message
bin_msg = remoting.encode(ev)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\remoting_init_.py", line 724, in encode
write_body(name, message, stream, encoder, strict)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\remoting_init
.py", line 550, in _write_body
encode_body(message)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\remoting_init
.py", line 523, in _encode_body
encoder.writeElement(x)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\codec.py", line 576, in writeElement
func(data)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\amf0.py", line 676, in writeAMF3
self.context.getAMF3Encoder(self).writeElement(data)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\codec.py", line 576, in writeElement
func(data)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\amf3.py", line 1509, in writeObject
self.writeElement(value)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\codec.py", line 576, in writeElement
func(data)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\amf3.py", line 1521, in writeObject
self.writeElement(value)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\codec.py", line 576, in writeElement
func(data)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\amf3.py", line 1500, in writeObject
attrs = alias.getEncodableAttributes(obj, codec=self)
File "C:\Users\EDZ\Envs\spider\lib\site-packages\pyamf\alias.py", line 404, in getEncodableAttributes
return obj.dict.copy()
AttributeError: 'bytearray' object has no attribute 'dict'

from py3amf.

qczrzl avatar qczrzl commented on August 23, 2024

Thanks for your answer, the problem was solved successfully

from py3amf.

benci042 avatar benci042 commented on August 23, 2024

Thanks for your answer, the problem was solved successfully

Hello
I has same issule with your met. Hope to get your help.
Would you please give me some demo code ,thanks.

from py3amf.

Related Issues (9)

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.