vast-ai / vast-python

Vast.ai python and cli api client
MIT License
117 stars 44 forks source link

./vast.py show user --raw returns garbage JSON #28

Closed trollwookiee closed 2 years ago

trollwookiee commented 2 years ago

The JSON returned by the command ./vast.py show user --raw cannot be parsed correctly, whereas ./vast.py search offers --raw can be correcly parsed.

$ ./vast.py show user --raw { "balance": 0, "balance_threshold": 3.0, "balance_threshold_enabled": false, "billaddress_city": "Nice", "billaddress_country": "xxxxxxxxxxx", "billaddress_line1": "xxxxxxxxx", "billaddress_line2": "xxxxxxxxxxx", "billaddress_zip": "xxxxxxxxxxx", "billed_expected": 0.0, "billed_verified": 0.0, "billing_creditonly": 1, "can_pay": true, "credit": 4.0162268849960014, "email": "xxxxxxxxxxx", "email_verified": true, "fullname": "xxxxxxxxxxx", "got_signup_credit": 1, "has_billing": true, "has_payout": false, "id": xxxxxxxxxxx, "last4": null, "paid_expected": 0.0, "paid_verified": 0.0, "password_resettable": null, "paypal_email": null, "ssh_key": "ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "user": "https://vast.ai/admin/user/xxxxxxxxxxx/", "username": "xxxxxxxxxxx" } <=== START: This part is added to the JSON and cannot be parsed ===> Current: {'can_pay': True, 'id': xxxxxxxxxxx, 'username': 'xxxxxxxxxxx', 'ssh_key': 'ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n', 'paypal_email': None, 'fullname': 'xxxxxxxxxxx', 'balance_threshold': 3.0, 'balance_threshold_enabled': False, 'billaddress_line1': 'xxxxxxxxxxx', 'billaddress_line2': 'xxxxxxxxxxx', 'billaddress_city': 'xxxxxxxxxxx', 'billaddress_zip': 'xxxxxxxxxxx', 'billaddress_country': 'xxxxxxxxxxx\xa0', 'billing_creditonly': 1, 'password_resettable': None, 'email': 'xxxxxxxxxxx', 'has_billing': True, 'has_payout': False, 'email_verified': True, 'last4': None, 'balance': 0, 'credit': 4.0162268849960014, 'got_signup_credit': 1, 'user': 'https://vast.ai/admin/user/xxxxxxxxxxx/', 'paid_verified': 0.0, 'paid_expected': 0.0, 'billed_verified': 0.0, 'billed_expected': 0.0} Raw mode <=== END: This part is added to the JSON and cannot be parsed ===>

The part starting by : Current: {'can_pay': True, 'id' and ending with: Raw mode

is garbage. Test with commit Id: ab05424498d06f148a53a7dd0e781cdf08739aab