Edgewall Software
Modify

Ticket #4248 (closed defect: worksforme)

Opened 5 years ago

Last modified 4 years ago

"ImportError: cannot import name utc" in trac-post-commit-hook

Reported by: rouven <rouven@…> Owned by: jonas
Priority: normal Milestone:
Component: ticket system Version: devel
Severity: normal Keywords:
Cc:
Release Notes:
API Changes:

Description

Hi,
it seems something is broken with the utc module. i don't know much about python, but this seems to be a missing module. i installed some python date modules like "Olson timezone database" for example, but this does not seem to work.

i am using debian etch with 0.10.3dev

cheers
Rouven

Attachments

Change History

comment:1 Changed 5 years ago by cboos

Well, the 0.10 branch doesn't use the utc module (did you mean pytz here?), the 0.11 branch does, however (optionally).

So could this error be caused by trying to use a 0.11 plugin in 0.10.3?

In any case, you should give us more information about the error you got, like a backtrace.

comment:2 Changed 5 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

well i fixed it for myself, it seems that i forgot to checkout the latest datefmt.py. this was the only problem i think.

rouven

comment:3 Changed 5 years ago by eblot

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:4 Changed 5 years ago by eblot

  • Resolution set to worksforme
  • Status changed from reopened to closed

comment:5 follow-up: Changed 4 years ago by anonymous

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Just ran into this and here is the back trace. v0.10 running via upgrade from 0.9. upgraded code, db and docs, though i doubt the last one matters ;)

Traceback (most recent call last):

File "/usr/local/src/trac/contrib/trac-post-commit-hook", line 85, in ?

from trac.util.datefmt import utc

ImportError?: cannot import name utc

comment:6 in reply to: ↑ 5 Changed 4 years ago by cboos

  • Resolution set to worksforme
  • Status changed from reopened to closed

Replying to anonymous:

The contrib/trac-post-commit-hook must be of the same line of development as the Trac version you're using.

Here, you're using source:trunk/contrib/trac-post-commit-hook which is the milestone:0.11 compatible one, with a 0.10 installation.

Likewise, you're likely get similar issues when trying to run the source:branches/0.10-stable/contrib/trac-post-commit-hook with a 0.11 Trac.

comment:7 Changed 4 years ago by toby@…

I tried the hook current when 0.10.4 was tagged (r5236) and it has the same problem.

utc is referenced all the way back to r4159: http://trac.edgewall.org/changeset?new=4159%40trunk%2Fcontrib%2Ftrac-post-commit-hook&old=3743%40trunk%2Fcontrib%2Ftrac-post-commit-hook

comment:8 Changed 4 years ago by cboos

Yes, that's normal. r5236 back to r4159 on trunk was already 0.11dev.
You should have looked in the source:branches/0.10-stable or in source:tags for the matching release, but not in trunk.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.