jim-easterbrook / pywws

Python software for USB Wireless WeatherStations
https://pywws.readthedocs.io/
GNU General Public License v2.0
204 stars 62 forks source link

Invalid filename in "services" section breaks file copying #79

Closed beermad closed 5 years ago

beermad commented 5 years ago

Hi Jim, For the first time in running this great software I managed to break it. I defined a new text file in weather.ini, but mis-typed it in the "services" directive. So where I should have written services = [('copy', 'feed.xml'),('copy', 'feed2.xml'),('copy','live.data')] I wrote services = [('copy', 'feed.xml'),('copy', 'feed22.xml'),('copy','live.data')] Which was pretty stupid. Afterwards, when running pywws-livelog, when the program tried to copy files to the necessary directory, it threw an error: pywws.service.copy:IOError(2, 'No such file or directory') This shouldn't be a problem - once I realised where I'd gone wrong I edited weather.ini and corrected it. But every time I tried to run pywws-livelog afterwards, the same error occurred. And it stopped all other files being copied as well. After a lot of digging, I found that status.ini contained a section: [pending] copy = ['feed22.xml'] Which seems to mean that the program will keep trying to copy that file even when it isn't in weather.ini, and thus breaking copying.

My guess (Python not being one of my programming languages) is that there's a need for the copy program to check if any pending copy still exists in weather.ini and if it doesn't, removing it.

Thanks again for a great utility. Tony

jim-easterbrook commented 5 years ago

Good point. Should be fixed by 1da368b.