Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

odc-cli crashes with "'staticmethod' object is not callable" on Python 3.8 and 3.9, which it claims to support

Abierto Apto para principiantes
#1,776 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
cli

Línea de trabajo

Empieza con cli/odc-cli:58-68 y los decoradores de los manejadores alrededor de cli/odc-cli:300-302; cli/AGENTS.md indica la versión de Python compatible y la falta de un entorno de pruebas. Comprueba cómo se aplican los decoradores en las clases de comandos y luego verifica setup get-state, auth login e instruments list con Python 3.8, 3.9 y una versión actual. La tarea estará completada cuando esos comandos ya no provoquen el TypeError indicado en los intérpretes compatibles.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Area: Infrastructure Bug Difficulty: Low Good First Issue Priority: Medium

On Python 3.8 and 3.9, odc-cli crashes with TypeError: 'staticmethod' object is not callable on every command that talks to the API. Each command handler is declared as @require_url (and often @require_token) stacked on @staticmethod. The decorators are applied in order, so require_url receives the staticmethod object itself, and its wrapper later calls fn(*args, **kwargs) on that object. A staticmethod object only became callable in Python 3.10 (bpo-43682). The script states that it targets Python 3.8: cli/AGENTS.md says so, and the file only hard-exits below 3.8. On the interpreters an administrator is most likely to have on a server or laptop, including macOS's /usr/bin/python3 (3.9.6), Debian 11 (3.9) and Ubuntu 20.04 (3.8), nothing works except config and the local auth logout and auth status. That includes auth login, setup, subjects, instrument-records and instruments.

Where

cli/odc-cli:58-68:

def require_url(fn: Callable[..., Any]) -> Callable[..., Any]:
    def wrapper(*args: Any, **kwargs: Any) -> None:
        # ...
        fn(*args, **kwargs)
    return wrapper

cli/odc-cli:300-302 (the same pattern is on every handler in AuthCommands, InstrumentRecordsCommands, SubjectCommands, InstrumentsCommands and SetupCommands):

class AuthCommands:
    @require_url
    @staticmethod
    def login(username: str, password: str) -> None:

Reproduce

  1. With Python 3.9 (for example macOS /usr/bin/python3), run python3 cli/odc-cli config set-url http://127.0.0.1:5500.
  2. Run python3 cli/odc-cli setup get-state.

Actual:

  File "cli/odc-cli", line 68, in wrapper
    fn(*args, **kwargs)
TypeError: 'staticmethod' object is not callable

Expected: the request is sent, as it is on Python 3.10 and later, where the same command prints the setup state or a network-error JSON.

Tests

cli/ has no test harness and nothing in CI runs it (cli/AGENTS.md). Verify the fix by running setup get-state, auth login and instruments list under Python 3.8, 3.9 and the current release, for example with uv run --python 3.8 cli/odc-cli setup get-state.

Suggested fix

Put @staticmethod outermost: write @staticmethod above @require_url and @require_token, so the auth decorators wrap the plain function. Alternatively, keep the order and unwrap inside the decorators with fn = fn.__func__ if isinstance(fn, staticmethod) else fn.

Lenguaje dominante
TypeScript
Estrellas
119
Forks
19
Merge medio
1 d 2 h
PR fusionados (30 d)
56

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DouglasNeuroInformatics/OpenDataCapture

Todos los issues de DouglasNeuroInformatics/OpenDataCapture

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.