RowClassFactory: __slots__ must be identifiers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 3 |
Won't Fix
|
Low
|
Unassigned | ||
zope.rdb |
Confirmed
|
Low
|
Unassigned |
Bug Description
Zope3.3.0 with cx_Oracle adapter
I've used typical Oracle statement:
select 1 from dual
I've received error:
TypeError: __slots__ must be identifiers
The problem is with RowClassFactory defined
in zope/rdb/
names are valid python identifiers.
There is current implementation of RowClassFactory:
def RowClassFactory
"""Creates a Row object"""
klass_namespace = {}
klass_
NamesCheck
klass_
return type('Generated
in my case:
klass_namespace is {'__slots_
and '1' causes error.
select 1 as abc from dual executes correctly.
For me, I've implemented temporary solution that simply changes
the names of numeric attributes (like '1') to prefixed ones
(like '_1').
I think there should be a kind of parser that converts
column names to valid python identifiers or different
implementation that doesn't use class attributes to store columns
data.
Changed in zope3: | |
status: | New → Confirmed |
affects: | zope.component → zope.rdb |
Changed in zope.rdb: | |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in zope3: | |
status: | Confirmed → Won't Fix |
I seem to recall this being reported before and either fixed, or marked as a WONTFIX, but for the life of me, I can't find the original issue.