InStream.get_channels_buffer_size uses wrong encoding
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia in generated/nidaqmx/task/_in_stream.py, in InStream.get_channels_buffer_size, e in generated/nidaqmx/task/_out_stream.py, in OutStream.get_channels_buffer_size. Leggi come viene decodificato Task.channel_names, quindi esamina la chiamata DAQmxGetTaskChannels e il relativo comportamento di codifica nativa. Il lavoro è completato quando le proprietà delle condizioni di errore ricevono una dimensione del buffer basata sulla rappresentazione dell’API C e non producono più un errore buffer-too-small per i nomi dei canali multibyte.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 592
- Fork
- 199
- Merge medio
- 1g 16h
- PR unite (30g)
- 10
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ni/nidaqmx-python
-
tech debt
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
ni/nidaqmx-python#945 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
ni/nidaqmx-python#941 ·
-
Potential typos in the API Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
ni/nidaqmx-python#939 ·
-
Add gRPC examples Apertaenhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
ni/nidaqmx-python#917 · 1 commento · 1 reazione ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
ni/nidaqmx-python#914 · 1 commento ·
Tutte le issue di ni/nidaqmx-python
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·