From 190812a521dfa92704ca1e48dcc623268f2fd2ef Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Thu, 6 Dec 2018 14:23:19 -0800 Subject: [PATCH] Updated notes on Python 3 --- docs/devnotes.htm | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/devnotes.htm b/docs/devnotes.htm index 16611848..b929de7d 100644 --- a/docs/devnotes.htm +++ b/docs/devnotes.htm @@ -123,13 +123,6 @@ Version: 3.9 Conditions" page takes just under 2 seconds (compared with 0.4 seconds for wview).

-

Unfortunately, the architectural goal of one code base is likely to be broken with the arrival of Python - V3.X. It has so many changes that are not backwards compatible with V2.X, that a separate code base will - most likely be needed. My intention is to stick with the V2.X versions until V3.X is so widespread it cannot - be ignored, then make a permanent switch. Given the slow adoption rate of V3.X this is unlikely to happen - anytime soon. In any case, I doubt the transition will affect the average WeeWX - user.

-

All writes to the databases are protected by transactions. You can kill the program at any time (either Control-C if run directly or "/etc/init.d/weewx stop" if run as a daemon) without fear of corrupting the databases.

@@ -146,6 +139,12 @@ Version: 3.9 affected — the main thread will continue downloading data off the instrument and putting them in the database. You can fix the problem at your leisure, without worrying about losing any data.

+

+ For now, WeeWX requires Python v2.6 or v2.7. However, we eventually plan on supporting Python v3.x as well. + See the Wiki page Python 3 strategy + for details on the transition. +

+

Units

In general, there are three different areas where the unit system makes a difference:

@@ -171,9 +170,11 @@ Version: 3.9 because of a failed checksum). If the hardware simply doesn't support it, then the driver should not emit a value at all.

-

The same rule applies to derived values. If the input data for a derived value are missing, then no derived +

+ The same rule applies to derived values. If the input data for a derived value are missing, then no derived value should be emitted. However, if the input values are present, but have value - None

, then the derived value should be set to None. + None, then the derived value should be set to None. +

However, the time value must never be None. This is because it is used as the primary key in the SQL database.

@@ -210,7 +211,7 @@ next_ts = int(time.mktime(next_dt.timetuple()))

Internationalization

-

Generally, weewx does not make much use of Unicode. This is because the Python 2.x libraries do not always +

Generally, WeeWX does not make much use of Unicode. This is because the Python 2.x libraries do not always handle it correctly. In particular, the function time.strftime() completely fails when handed a Unicode string with a non-ASCII character. As this function is often used by extensions, working around this bug is an unfair expectation on extension writers. So, we generally avoid Unicode.