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

InStream.get_channels_buffer_size uses wrong encoding

Abierto
#620 1 comentario 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
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
api, backend

Línea de trabajo

Empieza en generated/nidaqmx/task/_in_stream.py, en InStream.get_channels_buffer_size, y en generated/nidaqmx/task/_out_stream.py, en OutStream.get_channels_buffer_size. Lee cómo se decodifica Task.channel_names y, después, inspecciona la llamada DAQmxGetTaskChannels y su comportamiento de codificación nativa. Se considera terminado cuando las propiedades de condición de fallo reciben un tamaño de búfer basado en la representación de la API de C y ya no producen un error de buffer-too-small para nombres de canal multibyte.

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

Descripción

InStream.get_channels_buffer_size and OutStream.get_channels_buffer_size read the Task.channel_names property to calculate the maximum buffer size for a fault condition status property such as overcurrent_chans.

The problem is that these functions are calculating the length of the channel_names property after decoding from bytes to str. If Python represents str as UTF-16 or UTF-32, the number of characters in a str may be smaller than the number of UTF-8 bytes used to return that str from the DAQmx C API. When this happens, reading the fault condition property will likely return a "buffer too small" error when there is a fault.

Some potential solutions:

  • Use DAQmxGetTaskChannels(task, NULL, 0) to query the size of the TaskChannels property in the C API's native encoding (UTF-8 or MBCS). This would also be a small optimization because it would query the size of the TaskChannels property without querying the actual value.
  • Convert the task channels back to the C API's native encoding. This is a hack, so the first solution is better.
Lenguaje dominante
Python
Estrellas
592
Forks
199
Merge medio
1 d 15 h
PR fusionados (30 d)
12

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 ni/nidaqmx-python

Todos los issues de ni/nidaqmx-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.