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

TypeError: an integer is required #7

Open
MarkoKauzlaric opened this issue Oct 21, 2019 · 1 comment
Open

TypeError: an integer is required #7

MarkoKauzlaric opened this issue Oct 21, 2019 · 1 comment

Comments

@MarkoKauzlaric
Copy link

Hello,

I'm trying to use your library but when I try to run your demoCreate function is returning: TypeError: an integer is required. Using python 3.7

@mr50und
Copy link

mr50und commented May 18, 2020

I have same problem:

Code:
SCHEMA = (
("ISO_DIG", "C", 3 ),
("ISO_LAT3", "C", 3 ),
("DAT", "D" ),
("SCALE", "N", 11, 0),
("CURSE", "N", 20, 5),
("NAME_RUSH", "C", 100 ),
("PR_ECU", "C", 1 ),
)
db = dbf.Dbf(FilePathDBF+FileNameDBF, new=True)
db.addField(*SCHEMA)

On RUN script i have error:
Traceback (most recent call last):
File "C:/Python/Projects/CBR_py2/venv/CBR_py3.py", line 277, in safeCur2dbf
db.addField(*SCHEMA)
File "C:\Python\lib\site-packages\dbfpy3\dbf.py", line 227, in addField
self.header.addField(*defs)
File "C:\Python\lib\site-packages\dbfpy3\header.py", line 226, in addField
self.recordLength += self._addField(*defs)
File "C:\Python\lib\site-packages\dbfpy3\header.py", line 199, in _addField
_cls = fields.lookupFor(_type)
File "C:\Python\lib\site-packages\dbfpy3\fields.py", line 457, in lookupFor
return _fieldsRegistry[chr(typeCode)]
TypeError: an integer is required (got type str)

It's perfect work on Python 2.7 with dbfpy.
But in Python 3.7 with your custom lib it's no work.

Help please to understand what's going on.
Your Lib not include functional for save DBF?

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