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

TypeError: list indices must be integers or slices, not str #400

Open
dsm-72 opened this issue Apr 21, 2024 · 0 comments
Open

TypeError: list indices must be integers or slices, not str #400

dsm-72 opened this issue Apr 21, 2024 · 0 comments

Comments

@dsm-72
Copy link

dsm-72 commented Apr 21, 2024

# nbformat.validator.py:360
# Generate cell ids if any are missing
if repair_duplicate_cell_ids:
    cell["id"] = generate_corpus_id()
    changes += 1

Where

# nbformat.corpus.words
"""Generate a corpus id."""
from __future__ import annotations

import uuid


def generate_corpus_id():
    """Generate a corpus id."""
    return uuid.uuid4().hex[:8]

The line:

cell["id"] = generate_corpus_id()

Yields:

TypeError: list indices must be integers or slices, not str

Which will always be a string since uuid.uuid4().hex[:8] is a string.

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

1 participant