Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working on linux #23

Open
sensay-nelson opened this issue Apr 19, 2018 · 4 comments
Open

not working on linux #23

sensay-nelson opened this issue Apr 19, 2018 · 4 comments

Comments

@sensay-nelson
Copy link

sensay-nelson commented Apr 19, 2018

Using ubuntu, I'm seeing the following error when doing
dom zachwill.com

Traceback (most recent call last):
  File "/usr/local/bin/dom", line 7, in <module>
    Domain().main()
  File "/usr/local/lib/python2.7/dist-packages/domainr/core.py", line 127, in main
    status = self.status(args)
  File "/usr/local/lib/python2.7/dist-packages/domainr/core.py", line 59, in status
    data = Domain.parse_status(json_data.content, env)
  File "/usr/local/lib/python2.7/dist-packages/domainr/core.py", line 79, in parse_status
    status = data['status']
KeyError: 'status'

replacing:

print('\n'.join(status)) 

with:

print(status)

works, but the output is ugly.

b[0m  zachwill.com', u'\x1b[31m\u2717\x1b[0m  zachwill.compare', u'\x1b[32m\u2713\x1b[0m  \x1b[1m\x1b[34mzachwill.community\x1b[0m', u'\x1b[32m\u2713\x1b[0m  \x1b[1m\x1b[34mzachwill.company\x1b[0m', u'\x1b[32m\u2713\x1b[0m  \x1b[1m\x1b[34mzachwill.computer\x1b[0m', u'\x1b[32m\u2713\x1b[0m  \x1b[1m\x1b[34mzachwill.net\x1b[0m', u'\x1b[32m\u2713\x1b[0m  \x1b[1m\x1b[34mzachwill.org\x1b[0m', u'\x1b[32m\u2713\x1b[0m  \x1b[1m\x1b[34mzachwill.us\x1b[0m']

I believe the issue is the syntax highlighting is specific to osx terminal. may want to put that in the docs.

@sensay-nelson sensay-nelson changed the title breaks not working on linux Apr 19, 2018
@seanlane
Copy link
Collaborator

seanlane commented Apr 24, 2018

I've tried using dom with both OSX, Ubuntu, and a variant of Arch Linux, each with Python 2 & 3, and all have worked fine. I ran into some other issues, but nothing related to a KeyError such that 'status' didn't exist within the data object.

If you are familiar with Docker, the following Dockerfile can be used to show a simple testing environment, which the command docker build /path/to/Dockerfile:

FROM ubuntu:16.04

RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y python python-pip

ENV DOMAINR_MASHAPE_KEY={replace with your key as needed}

RUN pip install dom
RUN dom --ascii zachwill

The output I get from this is as expected:

X  z.ac
X  za.ch
X  zachwill.com
A  zachwill.net
A  zachwill.org
A  zachwill.us

@bogdanr
Copy link

bogdanr commented Jul 31, 2018

I also have this issue with both python2 and 3 on Debian 9

Traceback (most recent call last):
  File "/usr/local/bin/dom", line 7, in <module>
    Domain().main()
  File "/usr/local/lib/python3.5/dist-packages/domainr/core.py", line 127, in main
    status = self.status(args)
  File "/usr/local/lib/python3.5/dist-packages/domainr/core.py", line 59, in status
    data = Domain.parse_status(json_data.content, env)
  File "/usr/local/lib/python3.5/dist-packages/domainr/core.py", line 79, in parse_status
    status = data['status']
KeyError: 'status'

@seanlane
Copy link
Collaborator

Would you be able to debug the script and print out the value for the data object from line 79? I wonder if there's some error that isn't being caught.

@void285
Copy link

void285 commented Sep 12, 2018

This error may be caused by wrong api key, I solved it by correct my api key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants