Giter Club home page Giter Club logo

Comments (3)

mandrewcito avatar mandrewcito commented on May 29, 2024

Solved on the version 0.7.0, was an built in exception from py3

from signalrcore.

gvanderpol avatar gvanderpol commented on May 29, 2024

Are you sure this is solved? I used your latest version 0.7.0 and if I try to import the HubConnectionBuilder class as stated in the example, I still get the undefined 'ConnectionError'.

pip list (omitted full output):

C:\project\websocket>py -2 -m pip list
..
..
Package                       Version
----------------------------- ---------
..
..
signalrcore                   0.7.0
..
..

REPL (python2):

C:\project\websocket>py -2
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> from signalrcore.hub_connection_builder import HubConnectionBuilder
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\signalrcore\hub_connection_builder.py", line 4, in <module>
    from .hub.auth_hub_connection import AuthHubConnection
  File "C:\Python27\lib\site-packages\signalrcore\hub\auth_hub_connection.py", line 4, in <module>
    from .errors import UnAuthorizedHubError, HubError
  File "C:\Python27\lib\site-packages\signalrcore\hub\errors.py", line 1, in <module>
    class HubError(ConnectionError):
NameError: name 'ConnectionError' is not defined
>>>

And it is not only this undefined exception. I also see that some internal modules uses other stuff from Python3, which are not available in Python2, like in the signalrcore.helpers module this import:

from urllib import parse

Will lead to this error in Python2:

C:\Python27>py -2
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from urllib import parse
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name parse
>>>

This parse function is in Python2 available in urlparse, so for Python2 this statement should be:

C:\Python27>py -2
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import urlparse as parse
>>>

So, there might be more stuff in the signalrcore, which is not Python2 compatible.

from signalrcore.

mandrewcito avatar mandrewcito commented on May 29, 2024

This was fixed on previous version (since 0.7.4). Thanks for reporting it !

from signalrcore.

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.