Thanks, Hartmut!

I think the problem is that the file that is to be FTP'd, was being opened
in text mode instead of binary. So, it was trying to decode it into Unicode.

Fixed in commit 5167069
<https://github.com/weewx/weewx/commit/5167069ea4249821c83d5c7f190f1786bd5bdde0>

Do a pull on the repository, then try again.

-tk

On Sat, Mar 2, 2019 at 9:37 AM Hartmut Schweidler <hesfr...@gmail.com>
wrote:

> Hallo
> my try python3 and weewx
>
> Mar  2 15:20:47 wx2013 weewx[30145]: copygenerator: copied 0 files to
> /home/weewx/public_html/mobile
> Mar  2 15:20:48 wx2013 weewx[30145]: reportengine: Caught unrecoverable
> exception in generator 'weewx.reportengine.FtpGenerator'
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****  catching classes that
> do not inherit from BaseException is not allowed
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****  Traceback (most recent
> call last):
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****    File
> "/home/weewx/bin/weewx/reportengine.py", line 351, in run
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****      n = ftp_data.run()
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****    File
> "/home/weewx/bin/weeutil/ftpupload.py", line 159, in run
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****
> ftp_server.storbinary(STOR_cmd, fd)
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****    File
> "/usr/lib/python3.5/ftplib.py", line 505, in storbinary
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****      buf =
> fp.read(blocksize)
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****    File
> "/usr/lib/python3.5/codecs.py", line 321, in decode
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****      (result, consumed)
> = self._buffer_decode(data, self.errors, final)
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****  UnicodeDecodeError:
> 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****  During handling of the
> above exception, another exception occurred:
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****  Traceback (most recent
> call last):
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****    File
> "/home/weewx/bin/weewx/reportengine.py", line 208, in run
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****      obj.start()
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****    File
> "/home/weewx/bin/weewx/reportengine.py", line 304, in start
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****      self.run()
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****    File
> "/home/weewx/bin/weewx/reportengine.py", line 352, in run
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****      except
> (socket.timeout, socket.gaierror, ftplib.all_errors, IOError) as e:
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****  TypeError: catching
> classes that do not inherit from BaseException is not allowed
> Mar  2 15:20:48 wx2013 weewx[30145]:         ****  Generator terminated
> Mar  2 15:23:33 wx2013 systemd[1]: Stopping LSB: weewx weather system...
> Mar  2 15:23:33 wx2013 weewx[30145]: engine: Main loop exiting. Shutting
> engine down.
> Mar  2 15:23:33 wx2013 weewx[30145]: engine: Shutting down StdReport thread
> Mar  2 15:23:34 wx2013 weewx[30145]: engine: Terminating weewx version
> 4.0.0a3
> Mar  2 15:23:39 wx2013 weewx[30298]: Stopping weewx weather system: weewx..
> Mar  2 15:23:39 wx2013 systemd[1]: Stopped LSB: weewx weather system.
> Mar  2 15:23:39 wx2013 systemd[1]: Starting LSB: weewx weather system...
> Mar  2 15:23:39 wx2013 weewx[30339]: engine: Initializing weewx version
> 4.0.0a3
> Mar  2 15:23:39 wx2013 weewx[30339]: engine: Using Python 3.5.3 (default,
> Sep 27 2018, 17:25:39) #012[GCC 6.3.0 20170516]
> Mar  2 15:23:39 wx2013 weewx[30339]: engine: Platform
> Linux-4.14.98-v7+-armv7l-with-debian-9.8
> Mar  2 15:23:39 wx2013 weewx[30339]: engine: Locale is 'de_DE.UTF-8'
> Mar  2 15:23:39 wx2013 weewx[30339]: engine: pid file is /var/run/weewx.pid
> Mar  2 15:23:39 wx2013 weewx[30328]: Starting weewx weather system: weewx.
> Mar  2 15:23:39 wx2013 systemd[1]: Started LSB: weewx weather system.
> Mar  2 15:23:39 wx2013 weewx[30343]: engine: Using configuration file
> /home/weewx/weewx.conf
> Mar  2 15:23:39 wx2013 weewx[30343]: engine: Loading station type
> Simulator (weewx.drivers.simulator)
> Mar  2 15:23:39 wx2013 weewx[30343]: snowdepth: using /home/weewx/snow
> Mar  2 15:23:39 wx2013 weewx[30343]: engine: StdConvert target unit is 0x10
> i have python3 running
>
> but uploading via ftp does not work, i have no idea
> for a debugging
>
> Thanks for weewx-python3 and the support
> Hartmut
>

Reply via email to