On 31/12/2021 09:30, Terry Coles wrote:

I've posted this query on the Raspberry Pi Forums, but with no response so

As many of you are aware, I've been busy making changes to the hardware of the
Music and Bells Player at the WMT.  At the same time I've taken the
opportunity to upgrade the OS to bullseye, which I suspect has some bearing on
the issue that I've just encountered.  The software to control the playing of
the bells and chimes is written in Python and although the code I wrote last
year is unchanged, the Python version has been upgraded to Version 3.9 as part
of the changes introduced by bullseye.

When I run my Bells program I get this error, which repeats every few seconds:

PytzUsageWarning: The zone attribute is specific to pytz's interface; please
migrate to a new time zone provider. For more details on how to do so, see

BTW, the program still plays the bells when needed.  I use apscheduler in the
program to schedule a number of events:

def chimes_schedule():  # Schedule functions to be run and start the scheduler
     sched.add_job(hours, 'cron', hour='10')
     sched.add_job(hours, 'cron', hour='11')
     sched.add_job(hours, 'cron', hour='12')
     sched.add_job(hours, 'cron', hour='13')
     sched.add_job(hours, 'cron', hour='14')
     sched.add_job(hours, 'cron', hour='15')
     sched.add_job(hours, 'cron', hour='16')
     sched.add_job(hours, 'cron', hour='17')
     sched.add_job(hours, 'cron', hour='18')
     sched.add_job(hours, 'cron', hour='19')
     sched.add_job(hours, 'cron', hour='20')
     sched.add_job(hours, 'cron', hour='21')
     sched.add_job(hours, 'cron', hour='22')
     sched.add_job(resetnormalopening, 'cron', hour='23')
     sched.add_job(shutdown, 'cron', minute='1')
     sched.add_job(quarters, 'cron', minute='15')
     sched.add_job(quarters, 'cron', minute='30')
     sched.add_job(quarters, 'cron', minute='45')
     sched.add_job(check_minstermusic_commands, 'interval', seconds=1,


The procedure chimes_schedule() is called once at the beginning of the

On visiting the link given in the error message 
(https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html), I've 
found that the strategy to
migrate from pytz is outlined, with 'zoneinfo' being the preferred route.
However, when I tried to install zoneinfo it failed and I had to install
'backports.zoneinfo' instead.  However, I still couldn't make it work and am
not encouraged by:

Support for backports.zoneinfo in Python 3.9+ is currently minimal, since it
is expected that you would use the standard library zoneinfo module instead.

Can anyone help?

Would it be worth uninstalling Python 3.9 and installing an earlier version?

Sounds a bit complicated!

Once I've upgraded my pis to Bullseye I'll take a look.

What error(s) did you get when trying to install zoneinfo? Also which ways did you try (pip, setup.py install, something else?)?


 Next meeting: Online, Jitsi, Tuesday, 2022-01-04 20:00
 Check to whom you are replying
 Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
 New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to