Susan
Thanks, that's the first useful suggestion in my request for help so far.
Meanwhile, I've done something to "initialize" the variable, assigning a
nominal value to it before it's read from the file, and somehow  -- I don't
have a clue how -- that has reduced or eliminated the extraneous null value
added by the read().  So far.
Thanks.
Phil

On Wed, Apr 16, 2025 at 11:20 PM Susan Mackay <vk3...@gmail.com> wrote:

> Probably not the problem (as it this relates to code above the error line)
> but you have several places where you open a file, read every line and
> process the data in that line but only pass back the last value read. This
> seems to be a waste of a lot of processing
> .
> I agree with the comments above - the extraneous NULL in the file would
> seem to be the issue. Perhaps you need to look at that and see if you can
> fix the problem in the file. (Probably not as I'm guessing by the comments
> that the file is written by the OS.) Try 'rstrip("\0")' after the 'read()'
> Susan
> On Thursday, 17 April 2025 at 5:07:48 am UTC+10 Karen K wrote:
>
>> messyp...@gmail.com schrieb am Mittwoch, 16. April 2025 um 06:31:01
>> UTC+2:
>>
>> Apr 15 16:00:16 PI4B1 weewxd[268425]: weewx[268425] CRITICAL __main__:
>>   ****  ValueError: could not convert string to float: '94.8\x00'
>>
>>
>> May be the nul character at the end of the file to read is the problem.
>> In the error message above it is expressed as "\x00".
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/weewx-user/cM4T6W4XjdA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> weewx-user+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/weewx-user/181b3489-8883-4fbe-bda6-b627806231adn%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/181b3489-8883-4fbe-bda6-b627806231adn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-user/CAB7-S76Q2Qz8jFo%3D3uGKk9hSQF%2Bzu%2BxwW1RDUwjyeuDriKDMAQ%40mail.gmail.com.

Reply via email to