GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Unhandled format of the location string · Issue #17 · vrchatapi/VRChatPython

This repository was archived by the owner on Dec 20, 2021. It is now read-only.
This repository was archived by the owner on Dec 20, 2021. It is now read-only.

Unhandled format of the location string #17

Copy link
Copy link
Closed
Closed
Unhandled format of the location string#17
Copy link
Labels
resolved

Description

@ShingenPizza
ShingenPizza
opened on Oct 16, 2020
Issue body actions

Yesterday I've received a message from my Telegram bot that monitors VRC activity of me and a group of my friends with an information that it failed to process a location string, in a way shown below:

>>> friends = client.fetch_full_friends(offline=False)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Python38\lib\site-packages\vrcpy\client.py", line 66, in fetch_full_friends
    friends.append(friend.fetch_full())
  File "C:\Python38\lib\site-packages\vrcpy\objects.py", line 135, in fetch_full
    return User(self.client, resp["data"])
  File "C:\Python38\lib\site-packages\vrcpy\objects.py", line 202, in __init__
    if not obj == None: self._assign(obj)
  File "C:\Python38\lib\site-packages\vrcpy\objects.py", line 27, in _assign
    setattr(self, key, self.types[key](self.client, obj[key]))
  File "C:\Python38\lib\site-packages\vrcpy\objects.py", line 474, in __init__
    self.name, t, nonce = location.split("~")
ValueError: not enough values to unpack (expected 3, got 2)
>>> friends = client.fetch_friends(offline=False)
... for f in friends:
...     print(f.location)
...     
wrld_a015e11d-7ce8-42ed-8389-aa78104cff8c:7965~public

It's rare (happened only this one time during a couple of weeks), but it did happen. Would you like to add handling of this format and/or some kind of general error handling? If you're not feeling like doing it yourself i could create a pull request.

PS: is it intended that fetch_friends() leaves the .location as a string, while fetch_full_friends() turns it into a Location object? it doesn't request any additional data, so i don't know if it's necessary to leave it like that (although it did help me to find that invalid string).

Activity

  1. Katistic commented on Oct 17, 2020

    @Katistic
    Katistic
    on Oct 17, 2020
    Contributor
    More actions

    That's interesting, until recently it was thought that limited user objects don't have a location attribute (See here), it seems VRC backend either was updated or it's just really rare (there is no formatting/separate object for location of fetch_friends because it's never expected to get one).

    I'll do my best to fix it up based on the error you provided, though I can't be sure it will work since I'm unable to reproduce it.
    Also, feel free to make pull requests to fix things you find if you would like to, I'd love some help on this project! Thank you for reporting this!

  2. Katistic
    closed this as completedin 8bedcafon Oct 17, 2020
  3. Katistic commented on Oct 17, 2020

    @Katistic
    Katistic
    on Oct 17, 2020
    Contributor
    More actions

    Please reopen this if this error comes up again!

  4. ShingenPizza commented on Oct 17, 2020

    @ShingenPizza
    ShingenPizza
    on Oct 17, 2020
    ContributorAuthor
    More actions

    it seems VRC backend either was updated or it's just really rare

    location being there is not rare, i'm pretty sure i fetched location strings with fetch_friends consistently since i started my project about 3 weeks ago, so it's probably the it-was-updated option.

    https://vrchatapi.github.io/#/README says

    As of late, this documentation has become quite outdated, many of the endpoints have changed since the last update,

  5. Katistic commented on Oct 17, 2020

    @Katistic
    Katistic
    on Oct 17, 2020
    Contributor
    More actions

    Ah ok, I guess so then.
    That comment was made in February, since then it's been updated quite a bit

  6. Katistic
    added
    resolved
    on Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolved

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.