Opened 10 years ago

Closed 10 years ago

#8051 closed defect (fixed)

Mirobridge fails with NameError: global name 'struct' is not defined

Reported by: rune.evjen@… Owned by: sphery
Priority: minor Milestone: unknown
Component: Contributed Scripts & Apps Version: head
Severity: medium Keywords: mirobridge
Cc: Ticket locked: no

Description

When running Mirobridge using trunk version trunk23484, I get the following error: Python traceback:

Traceback (most recent call last):
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 2651, in <module>
    main()
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 2634, in main
    if not updateMythVideo(watched):
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 1980, in updateMythVideo
    tmp_array = createVideometadataRecord(item)
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 1501, in createVideometadataRecord
    videometadata[u'hash'] = hashFile(videometadata[u'filename'])
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 568, in hashFile
    bytesize = struct.calcsize(longlongformat)
NameError: global name 'struct' is not defined

It seems that maybe the struct module is not imported, I added "import struct" to the python script then I get another error:

Traceback (most recent call last):
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 2652, in <module>
    main()
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 2635, in main
    if not updateMythVideo(watched):
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 1981, in updateMythVideo
    tmp_array = createVideometadataRecord(item)
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 1502, in createVideometadataRecord
    videometadata[u'hash'] = hashFile(videometadata[u'filename'])
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 570, in hashFile
    f = open(name, "rb")
NameError: global name 'name' is not defined

Download and import of videos as recordings works fine, but I suspect that they are not removed from the database after they have been watched based on the above error.

Mirobridge is running as a cron job using this command:

env `dbus-launch` sh -c 'trap "kill $DBUS_SESSION_BUS_PID" EXIT; /usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py -V' > "/tmp/mirobridge.log" 2>&1

Change History (1)

comment:1 Changed 10 years ago by robertm

Resolution: fixed
Status: newclosed

(In [23513]) Fixes #8051. Fix cut and paste error in mirobridge in hash creation code. Patch from Doug Vaughan.

Note: See TracTickets for help on using tickets.