InStream.get_channels_buffer_size uses wrong encoding
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
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ni/nidaqmx-python
-
tech debt
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
ni/nidaqmx-python#945 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
ni/nidaqmx-python#941 ·
Los mantenedores suelen responder en 1 día
-
Potential typos in the APIAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
ni/nidaqmx-python#939 ·
Los mantenedores suelen responder en 1 día
-
Add gRPC examplesAbiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
ni/nidaqmx-python#917 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
ni/nidaqmx-python#914 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de ni/nidaqmx-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
PedestrianDynamics/pyFDS-Evac#199 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
521xueweihan/HelloGitHub#3790 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
sandialabs/atlas-ui-3#978 ·
Los mantenedores suelen responder en 1 día
-
area: tests perceived difficulty: 2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Nitjsefnie-Harness-Commons/daedalus#1255 ·
Los mantenedores suelen responder en 1 día
-
hf-audiolm-qwen: `generate_until` hardcodes `.to("cuda")` and aborts on non-CUDA acceleratorsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
EleutherAI/lm-evaluation-harness#4256 ·
Los mantenedores suelen responder en 1 día