hfaran / slack-export-viewer

A Slack Export archive viewer that allows you to easily view and share your Slack team's export
https://pypi.python.org/pypi/slack-export-viewer
MIT License
939 stars 194 forks source link

TypeError: string indices must be integers #91

Open osterman opened 5 years ago

osterman commented 5 years ago

what

output

TypeError: string indices must be integers ``` /export # slack-export-viewer --archive /export/ Archive already extracted. Viewing from /export... Traceback (most recent call last): File "/usr/bin/slack-export-viewer", line 11, in sys.exit(main()) File "/usr/lib/python3.6/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3.6/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/lib/python3.6/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3.6/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/lib/python3.6/site-packages/slackviewer/main.py", line 50, in main configure_app(app, archive, debug) File "/usr/lib/python3.6/site-packages/slackviewer/main.py", line 19, in configure_app reader = Reader(path) File "/usr/lib/python3.6/site-packages/slackviewer/reader.py", line 19, in __init__ self.__USER_DATA = {u["id"]: User(u) for u in json.load(f)} File "/usr/lib/python3.6/site-packages/slackviewer/reader.py", line 19, in self.__USER_DATA = {u["id"]: User(u) for u in json.load(f)} TypeError: string indices must be integers ```

Relevant user snippet...

{
    "erik": {
        "id": "UB2EH889X",
        "team_id": "TB2A18NRE",
        "name": "erik",
        "deleted": false,
        "color": "9f69e7",
        "real_name": "Erik Osterman",
        "tz": "America/Los_Angeles",
        "tz_label": "Pacific Standard Time",
        "tz_offset": -28800,
hfaran commented 5 years ago

Would you mind adding a try catch around that statement and checking what the value of u is when it errors out? I'm curious to know why it's a string and not a dict and what it contains.