I got this error today after doing a git pull from my repo (there is one 
other person working on this code as well). I'm sure I'm missing something 
small but I don't know what. I also cannot get into database administration 
due to the same error. Thanks in advance for the help.

<class 'cPickle.UnpicklingError'> invalid load key, '<'. Version  web2py™ 
Version 
2.7.4-stable+timestamp.2013.11.14.13.28.53  Python Python 2.7: 
C:\web2py\web2py_no_console.exe (prefix: C:\web2py)  Traceback 

1.
2.
3.
4.
5.
6.
7.
8.

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 217, in restricted
  File "C:/web2py/applications/siriadmin/models/db.py" 
<http://127.0.0.1:8000/admin/default/edit/siriadmin/models/db.py>, line 136, in 
<module>
  File "C:\web2py\gluon\dal.py", line 8129, in define_table
  File "C:\web2py\gluon\dal.py", line 8166, in lazy_define_table
  File "C:\web2py\gluon\dal.py", line 1079, in create_table
UnpicklingError: invalid load key, '<'.

Error snapshot [image: help] 
<http://127.0.0.1:8000/admin/default/ticket/siriadmin/127.0.0.1.2013-12-13.14-00-38.09e21ced-5687-4f9f-8040-7ebeeb3dd80d#>
 

<class 'cPickle.UnpicklingError'>(invalid load key, '<'.) 

inspect attributes 
 Frames 
   
   -  
   
   *File C:\web2py\gluon\restricted.py in restricted at line 217* code 
   arguments variables 
    -  
   
   *File C:\web2py\applications\siriadmin\models\db.py in <module> at line 
   136* code arguments variables 
    -  
   
   *File C:\web2py\gluon\dal.py in define_table at line 8129* code arguments 
   variables 
    -  
   
   *File C:\web2py\gluon\dal.py in lazy_define_table at line 8166* code 
   arguments variables 
    -  
   
   *File C:\web2py\gluon\dal.py in create_table at line 1079* code arguments 
   variables 
    Function argument list 
   
   (self=<gluon.dal.SQLiteAdapter object>, table=<Table siri_projects 
   
(id,name,description,coordi..._loc,num_students,reviewed,contracted,is_active)>,
 
   migrate=True, fake_migrate=False, polymodel=None)
    Code listing 
   
   1074.
   1075.
   1076.
   1077.
   1078.
   1079.
   
   1080.
   1081.
   1082.
   1083.
   
                   else:
                       self.log('success!\n', table)
           else:
               tfile = self.file_open(table._dbt, 'r')
               try:
                   sql_fields_old = pickle.load(tfile)
   
               except EOFError:
                   self.file_close(tfile)
                   raise RuntimeError('File %s appears corrupted' % table._dbt)
               self.file_close(tfile)
   
    Variables   
    
 Context 

locals request session response 
 In file: C:\web2py\applications\siriadmin\models\db.py 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.

# -*- coding: utf-8 -*-

#########################################################################
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#########################################################################

## if SSL/HTTPS is properly configured and you want all HTTP requests to
## be redirected to HTTPS, uncomment the line below:
# request.requires_https()

if not request 
<http://127.0.0.1:8000/examples/global/vars/request>.env.web2py_runtime_gae:
    ## if NOT running on Google App Engine use SQLite or other DB
    db = DAL 
<http://127.0.0.1:8000/examples/global/vars/DAL>('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
else:
    ## connect to Google BigTable (optional 'google:datastore://namespace')
    db = DAL 
<http://127.0.0.1:8000/examples/global/vars/DAL>('google:datastore')
    ## store sessions and tickets there
    session 
<http://127.0.0.1:8000/examples/global/vars/session>.connect(request 
<http://127.0.0.1:8000/examples/global/vars/request>, response 
<http://127.0.0.1:8000/examples/global/vars/response>, db=db)
    ## or store session in Memcache, Redis, etc.
    ## from gluon.contrib.memdb import MEMDB
    ## from google.appengine.api.memcache import Client
    ## session.connect(request, response, db = MEMDB(Client()))

## by default give a view/generic.extension to all actions from localhost
## none otherwise. a pattern can be 'controller/function.extension'
response <http://127.0.0.1:8000/examples/global/vars/response>.generic_patterns 
= ['*'] if request 
<http://127.0.0.1:8000/examples/global/vars/request>.is_local else []
## (optional) optimize handling of static files
# response.optimize_css = 'concat,minify,inline'
# response.optimize_js = 'concat,minify,inline'

#########################################################################
## Here is sample code if you need for
## - email capabilities
## - authentication (registration, login, logout, ... )
## - authorization (role based authorization)
## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)
## - old style crud actions
## (more options discussed in gluon/tools.py)
#########################################################################

# import gdata
# import gdata.docs.service
# import gspread
# import xlwt
# from xlwt import *
from datetime import datetime, date, time, timedelta, tzinfo
from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db)
crud, service, plugins = Crud(db), Service(), PluginManager()

## create all tables needed by auth if not custom tables
auth.define_tables(username=False, signature=False)

## configure email
mail = auth.settings.mailer
mail.settings.server = 'logging' or 'smtp.gmail.com:587'
mail.settings.sender = 'e.caldw...@sirinstitute.org'
mail.settings.login = 'dawg3tt:mol090901!'

## configure auth policy
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True

## if you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, etc.
## register with janrain.com, write your domain:api_key in private/janrain.key
from gluon.contrib.login_methods.rpx_account import use_janrain
use_janrain(auth, filename='private/janrain.key')

## this is the janrain login code for Facebook, Google, etc. login
## TODO: token URL not whitelisted
# from gluon.contrib.login_methods.rpx_account import RPXAccount
# 
auth.settings.actions_disabled=['register','change_password','request_reset_password']
# auth.settings.login_form = RPXAccount(request,
#     api_key='0caee29a1f349b43e83b5d1cb5cb5019eec2bef4',
#     domain='siri-admin',
#     url = "http://your-external-address/%s/default/user/login"; % 
request.application)

#########################################################################
## Define your tables below (or better in another model file) for example
##
## >>> db.define_table('mytable',Field('myfield','string'))
##
## Fields can be 'string','text','password','integer','double','boolean'
##       'date','time','datetime','blob','upload', 'reference TABLENAME'
## There is an implicit 'id integer autoincrement' field
## Consult manual for more options, validators, etc.
##
## More API examples for controllers:
##
## >>> db.mytable.insert(myfield='value')
## >>> rows=db(db.mytable.myfield=='value').select(db.mytable.ALL)
## >>> for row in rows: print row.id, row.myfield
#########################################################################

# db questions: should the students all be in one complex table or should they 
be in separate tables?

db.define_table('timeclock',
    Field 
<http://127.0.0.1:8000/examples/global/vars/Field>('project','string', 
required=True, label='Project'),
    Field 
<http://127.0.0.1:8000/examples/global/vars/Field>('work_date','date', 
required=True, label='Work Date'),
    Field <http://127.0.0.1:8000/examples/global/vars/Field>('time_in','time', 
required=True, label='Time In'),
    Field 
<http://127.0.0.1:8000/examples/global/vars/Field>('time_in_ampm','string', 
required=True, label=''),
    Field <http://127.0.0.1:8000/examples/global/vars/Field>('time_out','time', 
required=True, label='Time Out'),
    Field 
<http://127.0.0.1:8000/examples/global/vars/Field>('time_out_ampm','string', 
required=True, label=''),
    Field <http://127.0.0.1:8000/examples/global/vars/Field>('description', 
'text', required=True, label='Description'),
    Field <http://127.0.0.1:8000/examples/global/vars/Field>('hours','double', 
label='hours'),
    Field 
<http://127.0.0.1:8000/examples/global/vars/Field>('usr_id','reference 
auth_user', label='ID', readable=False)
)
db.timeclock.project.requires = IS_IN_DB 
<http://127.0.0.1:8000/examples/global/vars/IS_IN_DB>(db,'siri_projects.name')
db.timeclock.work_date.requires = IS_DATE 
<http://127.0.0.1:8000/examples/global/vars/IS_DATE>(format='%m/%d/%Y')
db.timeclock.time_in.requires = IS_NOT_EMPTY 
<http://127.0.0.1:8000/examples/global/vars/IS_NOT_EMPTY>()
db.timeclock.time_in_ampm.requires = IS_IN_SET 
<http://127.0.0.1:8000/examples/global/vars/IS_IN_SET>(['AM', 'PM'])
db.timeclock.time_in_ampm.default = 'AM'
db.timeclock.time_out.requires = IS_NOT_EMPTY 
<http://127.0.0.1:8000/examples/global/vars/IS_NOT_EMPTY>()
db.timeclock.time_out_ampm.requires = IS_IN_SET 
<http://127.0.0.1:8000/examples/global/vars/IS_IN_SET>(['AM', 'PM'])
db.timeclock.time_out_ampm.default = 'PM'
db.timeclock.description.requires = IS_NOT_EMPTY 
<http://127.0.0.1:8000/examples/global/vars/IS_NOT_EMPTY>()
# db.timeclock.hours.readable = False
db.timeclock.usr_id.writable = db.timeclock.usr_id.readable = False
if auth.is_logged_in():
    db.timeclock.usr_id.default = auth.user.id

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to