Opened 13 years ago
Closed 13 years ago
#9793 closed defect (fixed)
Setting new billing date by hand results in an error with python2.4
Reported by: | Owned by: | Russ Tyndall | |
---|---|---|---|
Priority: | normal | Component: | TimingAndEstimationPlugin |
Severity: | normal | Keywords: | setuptools, dependencies, python2.4 |
Cc: | Trac Release: | 0.11 |
Description (last modified by )
I think strptime has a different location in 2.5 vs 2.4. I'm using centos 5 and python24
File "/usr/lib/python2.4/site-packages/Trac-0.12.3-py2.4.egg/trac/web/main.py", line 522, in _dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.4/site-packages/Trac-0.12.3-py2.4.egg/trac/web/main.py", line 243, in dispatch resp = chosen_handler.process_request(req) File "build/bdist.linux-i686/egg/timingandestimationplugin/webui.py", line 119, in process_request self.set_bill_date(req.authname, req.args.get('newbilltime')) File "build/bdist.linux-i686/egg/timingandestimationplugin/webui.py", line 63, in set_bill_date when = parsetime(when, now.tzinfo) File "build/bdist.linux-i686/egg/timingandestimationplugin/webui.py", line 49, in parsetime try: return datetime.datetime.strptime(val, f).replace(tzinfo=tzinfo)
Attachments (0)
Change History (16)
comment:1 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 13 years ago by
Keywords: | waiting-for-feedback added |
---|
comment:4 Changed 13 years ago by
Keywords: | waiting-for-feedback removed |
---|
We're using CentOS 5.6 (released last year) which comes with python2.4. It's also the latest of the rightscale ami instances on ec2.
At the same time, it's fine if python2.4 is not supported, but it would be helpful if the installer could let people know that this python version is not supported. I can fix the error myself, but not sure if there is more and it's scary to uninstall the plugin...
BTW, version 0.12 doesn't compile on python2.4
comment:5 Changed 13 years ago by
comment:6 Changed 13 years ago by
Good to know, and that does provide some motivation to support this. Please do provide any patches you make (at least as reference for others facing the same situation, or myself if I go to fix this).
- When you say version 0.12 I assume you mean the branch of this plugin that works with trac 0.12 ?
- If you care to elaborate on "it's scary to uninstall the plugin" I might be able to help. I dont know of any cases where it would cause problems once uninstalled. (It should mostly be about removing the configuration in trac.ini and removing the built / installed packages from your python site-packages / dist-packages directory. (That said I have only even attempted uninstalls when trying to help others.)
- As a note my ubuntu development server (11.10) does not include python2.4 as an installable package. (Though I'm sure I can add a backport or something if it became necessary).
comment:7 Changed 13 years ago by
I don't know if you were trying to accomplish something more elaborate, but adding the line install_requires = [ 'Python >= 2.4' ]
might accomplish the same thing (e.g. DateFieldPlugin's setup.py). I've used this to help prevent issues such as a user installing the wrong plugin / Trac combination. I may have the syntax wrong, but you can do something like install_requires = [ '0.11 <= Trac < 0.12' ]
.
Anyway, if you already knew that, sorry for butting in ;)
comment:8 follow-ups: 9 12 Changed 13 years ago by
rjollos: I appreciate it, I had actually just copied that line from the top of trac's own setup.py assuming they would be doing it the nominally "correct" way. I had figured setup would have that built in, but then saw the trac setup and just blindly followed what it was doing.
I tried switching it around and it seemed to behave ... oddly. It also automatically downloaded and installed trac and dependencies (rather than signalling that the user didnt have prerequisites (or prompting to do the download)).
I don't understand why this occurred, when I changed it to the setup.py install_requires, perhaps it can be ignored, but without understanding it further I am reticent to commit it.
Searching for Python==2.6 Best match: Python 2.6 Adding Python 2.6 to easy-install.pth file
comment:9 follow-up: 10 Changed 13 years ago by
Replying to bobbysmith007:
I tried switching it around and it seemed to behave ... oddly. It also automatically downloaded and installed trac and dependencies (rather than signalling that the user didnt have prerequisites (or prompting to do the download)).
Yeah, I've seen the auto-download behavior as well. I'm not sure what the best practice is (which is why I felt like commenting on this ticket ... I figure correctly that you'd have some interesting comments ;)
hasienda and I have been talking about putting together a wiki page of best practices for plugin development. This seems like an important item to research and add a section for.
comment:10 Changed 13 years ago by
Replying to rjollos:
Yeah, I've seen the auto-download behavior as well. I'm not sure what the best practice is (which is why I felt like commenting on this ticket ... I figure correctly that you'd have some interesting comments ;)
I got the impression that if I spent another hour reading the docs, that there was probably a way to configure that behavior either through setup.cfg or by using different keys in setup.py. I have a coworker who has dealt with that stuff more than I and might be able to provide some insight tomorrow.
hasienda and I have been talking about putting together a wiki page of best practices for plugin development. This seems like an important item to research and add a section for.
Please do and also send a link to the mailing list. I think that sort of page could be very useful and help people avoid common mistakes. I would be happy to contribute what I can.
comment:11 Changed 13 years ago by
comment:12 Changed 13 years ago by
Keywords: | setuptools dependencies python2.4 added |
---|
Replying to bobbysmith007:
I don't understand why this occurred, when I changed it to the setup.py install_requires, perhaps it can be ignored, but without understanding it further I am reticent to commit it.
#9589 describes similar problems using install_requires
.
comment:13 Changed 13 years ago by
#9844 is also complaining about the centOS / py2.4 problem. I think I will attempt to just apply a fix for that soon, so that everyone can just get this working easier.
comment:14 Changed 13 years ago by
comment:15 Changed 13 years ago by
comment:16 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
It seemed like there was a value in attempting to get this to run in python 2.4. I have made an attempt at changing the code so that it should work in 2.4 on.
I cant easily run 2.4 , but I have replaced the offending function, so it should hopefully work. Please report any bugs you might find.
Is it necessary to fix this? Python 2.5 has been released for over 5 years. I am not opposed to applying patches that make the plugin more compatible with more versions of things, but I don't want to spend time squashing random bugs to maintain backwards compatibility with old software. (Especially since I don't have a box I can easily test against python2.4, I would have to reconstitute a python / trac env from a while ago, just to start debugging this). I have updated the python version number on the wiki page for this project to reflect python 2.5 as the lowest version number (though if patches are forthcoming I can revise that)..
Is there any reason a newer python cannot be installed?