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

Fixed .jp updated_date domain_name and name_servers #214

Closed
wants to merge 3 commits into from

Conversation

wakaka6
Copy link
Contributor

@wakaka6 wakaka6 commented Apr 26, 2024

whois server return

[ JPRS database provides information on network administration. Its use is    ]
[ restricted to network administration purposes. For further information,     ]
[ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e'     ]
[ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'.                 ]
Domain Information: [ドメイン情報]
a. [ドメイン名]                 YAHOO.CO.JP
e. [そしきめい]                 らいんやふーかぶしきがいしゃ
f. [組織名]                     LINEヤフー株式会社
g. [Organization]               LY Corporation
k. [組織種別]                   株式会社
l. [Organization Type]          Corporation
m. [登録担当者]                 HT57990JP
n. [技術連絡担当者]             YY47022JP
p. [ネームサーバ]               ns01.yahoo.co.jp
p. [ネームサーバ]               ns02.yahoo.co.jp
p. [ネームサーバ]               ns11.yahoo.co.jp
p. [ネームサーバ]               ns12.yahoo.co.jp
s. [署名鍵]
[状態]                          Connected (2024/09/30)
[ロック状態]                    AgentChangeLocked
[登録年月日]                    2019/09/27
[接続年月日]                    2019/09/27
[最終更新]                      2023/11/24 15:13:45 (JST)

fixed before

In [1]: import whois

In [2]: whois.whois("yahoo.co.jp")
Out[2]:
{'domain_name': None,
 'registrant_org': 'LY Corporation',
 'creation_date': datetime.datetime(2019, 9, 27, 0, 0),
 'expiration_date': None,
 'name_servers': None,
 'updated_date': '2023/11/24 15:13:45 (JST)',
 'status': 'Connected (2024/09/30)'}

fixed after

In [1]: import whois

In [2]: whois.whois("yahoo.co.jp")
Out[2]:
{'domain_name': 'YAHOO.CO.JP',
 'registrant_org': 'LY Corporation',
 'creation_date': datetime.datetime(2019, 9, 27, 0, 0, tzinfo=datetime.timezone.utc),
 'expiration_date': None,
 'name_servers': ['ns01.yahoo.co.jp',
  'ns02.yahoo.co.jp',
  'ns11.yahoo.co.jp',
  'ns12.yahoo.co.jp'],
 'updated_date': datetime.datetime(2023, 11, 24, 15, 13, 45, tzinfo=tzoffset('JST', 32400)),
 'status': 'Connected (2024/09/30)'}

@richardpenman
Copy link
Owner

Thanks for PR! Looks like some tests are failing:
https://github.com/richardpenman/whois/actions/runs/8846370438/job/24292113782?pr=214

@richardpenman
Copy link
Owner

The tests don't use live data and the parser will need to be updated to reflect your format changes.

@wakaka6
Copy link
Contributor Author

wakaka6 commented Apr 26, 2024

image
I've resolved the exception related to using datetime.UTC, which resulted in the parsed data incorporating timezone information. I believe preserving the timezone data within the time stamps is beneficial to prevent potential time-associated errors in a global application context.

image

Actually, this chunk of the code will never run.
image
image

@richardpenman
Copy link
Owner

Unfortunately the tests are still failing. You can run tests locally with python -m pytest to see what needs fixing.

@wakaka6
Copy link
Contributor Author

wakaka6 commented May 20, 2024

Unfortunately the tests are still failing. You can run tests locally with python -m pytest to see what needs fixing.

Hey bro, can you tell me why your test cases come with time zone information one time and not the other, I can understand that you use the test used to make sure that the program is correct, but without learning that I have no motivation to fix this tests error as it works fine in my environment.

@richardpenman
Copy link
Owner

richardpenman commented May 20, 2024 via email

@wakaka6 wakaka6 closed this May 21, 2024
@mzpqnxow
Copy link
Contributor

There is an issue with using datetime.UTC that causes a silent failure

I believe this is because of a NameError, caused by datetime.UTC only being supported on some Python 3 versions

I will send a PR to fix it later today, the issue may have been a symptom of this

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

Successfully merging this pull request may close these issues.

3 participants