You are not logged in.

#1 2014-06-17 18:54:27

jowijo
Member
From: North America
Registered: 2014-01-23
Posts: 25

Weird python issues with dvbobjects.

So, despite getting opencaster to build and install, I seem to have a strange issue with actually importing dvbojects. There are several examples:

When initially making the modules... (This happens to all of them. None of the modules are copied)

byte-compiling usr/lib/python3.4/site-packages/dvbobjects/DVB/Loops.py to Loops.cpython-34.pyc
Sorry: TabError: inconsistent use of tabs and spaces in indentation (Loops.py, line 116)

...then when I manually install them...
Python 3.4

Traceback (most recent call last):
  File "./PSIP_MP2.py", line 7, in <module>
    from dvbobjects.PSI.PAT import *
  File "/usr/lib/python3.4/site-packages/dvbobjects/PSI/PAT.py", line 41
    self.private_indicator = 0
                             ^
TabError: inconsistent use of tabs and spaces in indentation

Python 2.7

Traceback (most recent call last):
  File "./PSIP_MP2.py", line 7, in <module>
    from dvbobjects.PSI.PAT import *
  File "/usr/lib/python2.7/site-packages/dvbobjects/PSI/__init__.py", line 5
SyntaxError: Non-ASCII character '\xa9' in file /usr/lib/python2.7/site-packages/dvbobjects/PSI/__init__.py 
on line 5, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Never had this issue on Ubuntu or Fedora when I ran these. How can I import these modules without having to edit them? Or whatever other solution is available?

Thanks.

Offline

#2 2014-06-17 19:36:29

rune0077
Member
Registered: 2009-04-11
Posts: 135

Re: Weird python issues with dvbobjects.

The errors you get are pretty self explanatory:

TabError: inconsistent use of tabs and spaces in indentation

There's no way you can "fix" this without editing the file. Whoever wrote that code used both tabs and spaces for indentation, when he/she should have stuck with one or the other.

To fix it, you need to open the file in an editor and do a search/replace-all to replace all tabs with four spaces. Or you need to manually ensure that all indentations in the file are either four spaces or a single tab.

Last edited by rune0077 (2014-06-17 19:36:59)

Offline

Board footer

Powered by FluxBB