Mercurial > p > roundup > code
comparison roundup/cgi/engine_zopetal.py @ 8311:dff6d2edc52f
fix: issue2551396: os.path.stat.ST_MTIME + windows python 3.13 crashes
Looks like os.path.stat was removed in 3.13 on windows. Use
stat.ST_MTIME instead. stat.ST_MTIME is also used in cgi/client.py.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 11 May 2025 17:37:57 -0400 |
| parents | 310e19beba3e |
| children |
comparison
equal
deleted
inserted
replaced
| 8310:e7002216d95c | 8311:dff6d2edc52f |
|---|---|
| 5 | 5 |
| 6 import errno | 6 import errno |
| 7 import mimetypes | 7 import mimetypes |
| 8 import os | 8 import os |
| 9 import os.path | 9 import os.path |
| 10 import stat | |
| 10 | 11 |
| 11 from roundup.cgi.templating import StringIO, context, TALLoaderBase | 12 from roundup.cgi.templating import StringIO, context, TALLoaderBase |
| 12 from roundup.cgi.PageTemplates import PageTemplate | 13 from roundup.cgi.PageTemplates import PageTemplate |
| 13 from roundup.cgi.PageTemplates.Expressions import getEngine | 14 from roundup.cgi.PageTemplates.Expressions import getEngine |
| 14 from roundup.cgi.TAL import TALInterpreter | 15 from roundup.cgi.TAL import TALInterpreter |
| 28 raise ValueError("Unable to load template file basename: %s: %s" % ( | 29 raise ValueError("Unable to load template file basename: %s: %s" % ( |
| 29 tplname, e)) | 30 tplname, e)) |
| 30 | 31 |
| 31 # has it changed? | 32 # has it changed? |
| 32 try: | 33 try: |
| 33 stime = os.stat(src)[os.path.stat.ST_MTIME] | 34 stime = os.stat(src)[stat.ST_MTIME] |
| 34 except os.error as error: | 35 except os.error as error: |
| 35 if error.errno != errno.ENOENT: | 36 if error.errno != errno.ENOENT: |
| 36 raise | 37 raise |
| 37 | 38 |
| 38 if src in self.templates and \ | 39 if src in self.templates and \ |
