Closed MrEdinLaw closed 5 years ago
@MrEdinLaw Please update the package to the latest version. I had included the latest fix.
Thank you very much, the latest update fixed the problem/bug.
I reinstalled the package just now and I'm still getting this error.
@atschutz I just did a reinstall to reproduce the error, but I am getting random words Can you please help me in opening new issue with proper steps, and environment you are facing this issue
Just submitted a new issue. Thanks for the quick reply!
The same issue occurs in my APP today suddenly, but it was working well in the past. Is there any usage limit on the number of times ?
(wx-env) freman@DEV01:~/project/$ python
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from random_word import RandomWords
>>> nickname = RandomWords().get_random_word()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/freman/project/wechat/wx-env/lib/python3.6/site-packages/random_word/random_word.py", line 60, in get_random_word
"Error occured, No result found. If you think this was a mistake than raise issue at {}".format(self.issue_url))
Exception: Error occured, No result found. If you think this was a mistake than raise issue at https://github.com/vaibhavsingh97/random-word/issues
>>>
The same issue occurs in my APP today suddenly, but it was working well in the past. Is there any usage limit on the number of times ?
(wx-env) freman@DEV01:~/project/$ python Python 3.6.8 (default, Jan 14 2019, 11:02:34) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> from random_word import RandomWords >>> nickname = RandomWords().get_random_word() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/freman/project/wechat/wx-env/lib/python3.6/site-packages/random_word/random_word.py", line 60, in get_random_word "Error occured, No result found. If you think this was a mistake than raise issue at {}".format(self.issue_url)) Exception: Error occured, No result found. If you think this was a mistake than raise issue at https://github.com/vaibhavsingh97/random-word/issues >>>
I checked the source code of 'random_word.py' and doubted that maybe this is a network issue regarding the API url 'https://api.wordnik.com/v4/words.json/randomWord?'
try: url += urlencode(payload, quote_via=quote_plus) except TypeError: url += urlencode(payload) response = request_url(url) result = response.json() if response.status_code == 200: return result['word'] else: raise Exception( "Error occured, No result found. If you think this was a mistake than raise issue at {}".format(self.issue_url))
Then tried to switch by a better network line from China and it works. To sum up, the connection stability of the API service is a crucial factor.
To sum up, the connection stability of the API service is a crucial factor.
This would explain the unpredictability in reproducing the error. Thanks for looking into it.
Describe the bug
To Reproduce Steps to reproduce the behavior:
Expected behavior Word variable should get a random word assigned.
Screenshots If applicable, add screenshots to help explain your problem. No....
Environment (please complete the following information):
Additional context Add any other context about the problem here.