Code Monkey home page Code Monkey logo

Comments (8)

etpinard avatar etpinard commented on May 8, 2024

I confirm this bug on Python 3.4.

Thanks for reaching out to us.

from plotly.py.

hnykda avatar hnykda commented on May 8, 2024

Fix #79 doesn't solve that for me. Here is traceback:


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-9-4f183c164120> in <module>()
      4 
      5 s.write(dict(x=[1,2,3], y=[3,5,4]))
----> 6 s.close()

/home/dan/prac/.virtualenvs/work/lib/python3.4/site-packages/plotly/plotly/plotly.py in close(self)
    509         """
    510         try:
--> 511             self._stream.close()
    512         except AttributeError:
    513             raise exceptions.PlotlyError("Stream has not been opened yet.")

/home/dan/prac/.virtualenvs/work/lib/python3.4/site-packages/plotly/plotly/chunked_requests/chunked_request.py in close(self)
    109             return ''
    110 
--> 111         return self._getresponse()
    112 
    113     def _getresponse(self):

/home/dan/prac/.virtualenvs/work/lib/python3.4/site-packages/plotly/plotly/chunked_requests/chunked_request.py in _getresponse(self)
    132                 break
    133             else:
--> 134                 response += bytes
    135         # Set recv to be non-blocking again
    136         self._conn.sock.setblocking(False)

TypeError: Can't convert 'bytes' object to str implicitly

(I've just change the loop to something easy, to make minimal example. Output is same with original step)

from plotly.py.

etpinard avatar etpinard commented on May 8, 2024

Try pulling in the latest commit

$ git checkout iss79
$ git pull origin iss79

from plotly.py.

theengineear avatar theengineear commented on May 8, 2024

@kotrfa, try either cloning master, or pip install --upgrade plotly and running your code again?

The most recent updates were target towards Python 3 use and should help you out.

Thanks again for the feedback!

from plotly.py.

hnykda avatar hnykda commented on May 8, 2024

Yeah, that worked! Solved. Thank you for your gret work

from plotly.py.

theengineear avatar theengineear commented on May 8, 2024

Awesome! Thanks for keeping us updated on your end! We're trying to ramp up Python 3 integration, so do let us know if anything else comes up.

from plotly.py.

hnykda avatar hnykda commented on May 8, 2024

Sure I will.

By the way, I've noticed that if I create stream:

s = py.Stream(my_stream_id)

# Open the stream
s.open()

then s.connected always returns False for me. I'm not sure how exactly it should work, so I'm not signing it as a bug. Help for this thing is not documented a lot and plotly.plotly.Stream.connected doesn't exists (but again, not understand why so maybe it's my fault).

from plotly.py.

theengineear avatar theengineear commented on May 8, 2024

Ah, yeah. We should take care of that attribute. I'm not sure that it's being used currently, so that False is just a default set on instantiation: https://github.com/plotly/python-api/blob/master/plotly/plotly/plotly.py#L400

If you've opened the connection, you should be good to go.

from plotly.py.

Related Issues (20)

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.