keyword "layer" unrecognized in add_cube function
The parameter for primitive_cube_add should be layers not layer.

You will also get an error that layers should only have 20 values not 32. I'm not certain if older versions accepted this length variation, I know it fails in blender since 2.62

import bpy
from bpy import context
from math import sin,cos, radians

add_cube = bpy.ops.mesh.primitive_cube_add
layers = [False]*20
layers[0] = True

cursor = context.scene.cursor_location

radius = 5
anglesInRadians = [radians(degree) for degree in range(0,360,36)]

for theta in anglesInRadians:
    x = cursor.x + radius * cos(theta)
    y = cursor.y + radius * sin(theta)
    z = cursor.z
    add_cube(location=(x,y,z), layers=layers)