Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working #1

Closed
FPSUsername opened this issue May 30, 2017 · 4 comments
Closed

Not working #1

FPSUsername opened this issue May 30, 2017 · 4 comments

Comments

@FPSUsername
Copy link

Hello, I have an issue and it doesn't work at all:

https://pastebin.com/1DxVr8Rp

The first conversion is done by replacing:
import dbfread -> from dbfread import DBF
dbfread.open( -> DBF(

The second conversion is with the dbf2json file unmodified

Please update this as soon as possible

@eastein
Copy link
Owner

eastein commented May 31, 2017

The problem is probably in https://github.com/olemb/dbfread/ not my code.

Can you provide some more info?

  • what version of dbfread is installed? I'm using an older version of dbfread (1.0.1) in my requirements file
  • can you upload your dbf file? It seems like the version of dbfread you are using can't read it, maybe there is something wrong or a newer version of dbfread would be able to read it
  • try installing newer dbfread and see if it works (assuming you are using 1.0.1)

I'll re-open the ticket when you reply.

@eastein eastein closed this as completed May 31, 2017
@FPSUsername
Copy link
Author

FPSUsername commented Jun 1, 2017

I believe that I use the latest version available. I will downgrade to 1.0.1 as soon as I can.
I wrote an issue ticket here: Polyconseil/libcanardbc#2
That is the tool that I can use with caneton (DBC to JSON), but it has an issue with converting extended frame ids. I also tried to convert with canmatrix and that does the job, but it is sorted differently, so caneton can not use it.

I used busmaster to convert the DBC file to a DBF file
Downloads.zip

@FPSUsername FPSUsername changed the title Not working Not working for extended frame ID Jun 1, 2017
@FPSUsername FPSUsername changed the title Not working for extended frame ID Not working Jun 1, 2017
@eastein
Copy link
Owner

eastein commented Jun 3, 2017

I'm not going to lie, I don't know what any of those software packages you are talking about are.

I can tell you that dbfread 1.0.1 on my system doesn't like the file you uploaded, though.

(dbf2json)eastein@amontillado ~/git/dbf2json :( master  $ ./dbf2json /home/eastein/Downloads/V10_CAN_ime.dbf
Traceback (most recent call last):
  File "./dbf2json", line 47, in <module>
    output = [rec for rec in dbfread.open(in_filename)]
  File "/home/eastein/venvs/dbf2json/local/lib/python2.7/site-packages/dbfread/dbf.py", line 142, in __init__
    self._check_headers()
  File "/home/eastein/venvs/dbf2json/local/lib/python2.7/site-packages/dbfread/dbf.py", line 245, in _check_headers
    raise ValueError('Unknown field type: {!r}'.format(field.type))
ValueError: Unknown field type: u'e'
(dbf2json)eastein@amontillado ~/git/dbf2json :( master  $ 

@eastein
Copy link
Owner

eastein commented Jun 3, 2017

Upon looking at the DBF standard a bit (http://www.dbase.com/KnowledgeBase/int/db7_file_fmt.htm) I see that field type E isn't defined there, which I presume is the "extended frames" you are talking about. dbfread is erroring about a field type 'e' not being known.

Newest dbfread (2.0.7) doesn't work either (the following was tested with 2.0.7):

(dbf2json)eastein@amontillado ~/git/dbf2json :) master  $ !./dbf2
./dbf2json /home/eastein/Downloads/V10_CAN_ime.dbf
/home/eastein/venvs/dbf2json/local/lib/python2.7/site-packages/dbfread/deprecated_dbf.py:52: UserWarning: dbfread.open() has been replaced by DBF() and will be removed in 2.2.
  warnings.warn("dbfread.open() has been replaced by DBF()"
Traceback (most recent call last):
  File "./dbf2json", line 47, in <module>
    output = [rec for rec in dbfread.open(in_filename)]
  File "/home/eastein/venvs/dbf2json/local/lib/python2.7/site-packages/dbfread/deprecated_dbf.py", line 54, in open
    return DeprecatedDBF(filename, load=True, **kwargs)
  File "/home/eastein/venvs/dbf2json/local/lib/python2.7/site-packages/dbfread/dbf.py", line 123, in __init__
    self._check_headers()
  File "/home/eastein/venvs/dbf2json/local/lib/python2.7/site-packages/dbfread/dbf.py", line 265, in _check_headers
    raise ValueError('Unknown field type: {!r}'.format(field.type))
ValueError: Unknown field type: 'e'
(dbf2json)eastein@amontillado ~/git/dbf2json :( master  $ 

I'm also not sure what libcanardbc has to do with my software (which is just a very simple wrapper around dbfread).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants