[mythtv-users] find orphans.py question

Raymond Wagner raymond at wagnerrp.com
Fri Jun 10 11:51:50 UTC 2011


On 6/10/2011 03:40, Warpme wrote:
> 1.Launch script. It lists 18 of 0 byte rec
> 2.Select to delete 0 byte rec
> 3.Script processing about 5sec and returns with list now showing 16 of 
> 0 byte rec.

That's a known issue, and an unavoidable race condition.  The script 
tells the backend to delete those recordings, and the backend threads it 
off and takes its time doing so.  By the time the script rescans and 
returns to the user, only a handful of those files have been deleted.  I 
could set up a thread in the bindings to listen for the relevant events 
indicating deletion, but for now, I just handle the error and dump the 
user back to the list.

> Traceback (most recent call last):
>   File "/usr/local/bin/maintenance/find_orphans.py", line 230, in 
> <module>
>     main()
>   File "/usr/local/bin/maintenance/find_orphans.py", line 214, in main
>     opt[1](opt[2])
>   File "/usr/local/bin/maintenance/find_orphans.py", line 135, in 
> delete_recs
>     except MythError:
> NameError: global name 'MythError' is not defined
> Exception TypeError: 'reconnect() takes at most 2 arguments (3 given)' 
> in <bound method BEConnection.__del__ of 
> <MythTV.connections.BEConnection object at 0xa2792cc>> ignored

This is a known issue in trunk, where the the connection classes were 
rewritten to use two independent connections for commands and events, to 
more correctly duplicate the behavior of the frontend.  Certain things 
like the automatic reconnection have not yet been fixed, although why 
the bindings think they need to reconnect, I don't know.

> downgraded from 3.2 as in recent Arch default python is 3.2

Python 2.x and Python 3.x are two completely independent languages and 
can co-exist on a single system without issue.  There shouldn't be a 
need to uninstall 3.2 to install 2.7.  IMO, it was a very poor choice 
for Arch to make the Python 3.x binary the primary 'python' binary, 
since as you're discovering, it breaks all sorts of things all over.  
When you compile MythTV, configure takes a '--python=' argument, which 
sets what binary you want to use for the bindings and any internally 
installed scripts.  External ones like mythvidexport.py will have to be 
set manually.


More information about the mythtv-users mailing list