Git Product home page Git Product logo

Comments (18)

PSNAppz avatar PSNAppz commented on May 18, 2024

@shivankar-madaan Thank you for raising the issue. @KingAkeem Please confirm this.

from torbot.

KingAkeem avatar KingAkeem commented on May 18, 2024

I can't reproduce the error, I just tried it out and it worked fine for me. Could you give me some more details of your system?

from torbot.

shivankar-madaan avatar shivankar-madaan commented on May 18, 2024

@KingAkeem did you have the Tor service as not running?

from torbot.

KingAkeem avatar KingAkeem commented on May 18, 2024

No it's running, if it weren't running then I wouldn't be able to connect to the .onion website.

from torbot.

shivankar-madaan avatar shivankar-madaan commented on May 18, 2024

Here are my details

Attempting to connect to https://check.torproject.org/
Attempting to connect to https://check.torproject.org/
Attempting to connect to https://check.torproject.org/
Traceback (most recent call last):
  File "torBot.py", line 186, in <module>
    main(conn=True)
  File "torBot.py", line 158, in main
    print("Tor IP Address :", pagereader.get_ip())
  File "/tmp/TorBoT/modules/pagereader.py", line 102, in get_ip
    pg = page.find('strong')
AttributeError: 'NoneType' object has no attribute 'find'
[root@ip-10-96-16-124 TorBoT]# python -V
Python 3.6.0
[root@ip-10-96-16-124 TorBoT]#
[root@ip-10-96-16-124 TorBoT]# service tor status
tor is not running```

from torbot.

PSNAppz avatar PSNAppz commented on May 18, 2024

@KingAkeem He is running without the tor services being started.
@shivankar-madaan Are you saying that to handle the exception in a neat way?

from torbot.

shivankar-madaan avatar shivankar-madaan commented on May 18, 2024

yes @PSNAppz

from torbot.

PSNAppz avatar PSNAppz commented on May 18, 2024

I think thats a good idea. @KingAkeem What do you think?

from torbot.

KingAkeem avatar KingAkeem commented on May 18, 2024

I understand now, I thought you were saying that it didn't work correctly. What would you think a better method of handling the exception be? Currently it attempts to connect to a site three times, then raises an error which gives a description that tells the user how many times the connection was attempted and why it failed.

from torbot.

KingAkeem avatar KingAkeem commented on May 18, 2024

@PSNAppz I'm open to suggestions

from torbot.

shivankar-madaan avatar shivankar-madaan commented on May 18, 2024

I am not sure about how right the solution is to be
But the I think if condition is not rightly written
It should be modified something like this

    if type(err) == HTTPError:
        raise("There has been an HTTP error after three attempts.")
    if type(err) == ConnectionError:
        raise("There has been a connection error after three attempts.")

And with this we get a different error

Attempting to connect to https://check.torproject.org/
Attempting to connect to https://check.torproject.org/
Traceback (most recent call last):
  File "torBot.py", line 186, in <module>
    main(conn=True)
  File "torBot.py", line 158, in main
    print("Tor IP Address :", pagereader.get_ip())
  File "/tmp/TorBoT/modules/pagereader.py", line 103, in get_ip
    page = read_first_page('https://check.torproject.org/')
  File "/tmp/TorBoT/modules/pagereader.py", line 52, in read_first_page
    raise("There has been a connection error after three attempts.")
TypeError: exceptions must derive from BaseException```

from torbot.

KingAkeem avatar KingAkeem commented on May 18, 2024

@shivankar-madaan type(err) == ConnectionError returns False. The correct form is err == ConnectionError

from torbot.

PSNAppz avatar PSNAppz commented on May 18, 2024

@shivankar-madaan Would you like to talk in our slack channel? If yes, please post your emil for the invitation.

from torbot.

shivankar-madaan avatar shivankar-madaan commented on May 18, 2024

sure @PSNAppz

from torbot.

shivankar-madaan avatar shivankar-madaan commented on May 18, 2024

@KingAkeem with type(err) the code flow is able to reach to the raise("There has been a connection error after three attempts")
But with the usual code we are reaching to

  File "torBot.py", line 186, in <module>
    main(conn=True)
  File "torBot.py", line 158, in main
    print("Tor IP Address :", pagereader.get_ip())
  File "/tmp/TorBoT/modules/pagereader.py", line 102, in get_ip
    pg = page.find('strong')
AttributeError: 'NoneType' object has no attribute 'find'```

from torbot.

PSNAppz avatar PSNAppz commented on May 18, 2024

@shivankar-madaan Invited

from torbot.

shivankar-madaan avatar shivankar-madaan commented on May 18, 2024

thanks @PSNAppz

from torbot.

PSNAppz avatar PSNAppz commented on May 18, 2024

Referencing PR #78

from torbot.

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.