This is a year later but I wanted to propose a solution I came across online to this problem. Other solutions here have proposed math calculations to "get around" this issue, but there is actually a solution. (Kinda)
Basically, from my understanding, regardless of what you set the pivot/orient_type to, in EDIT mode Blender will always perform that transformation as Median Point.
What you want to do is override the context, so that it performs the transformation over the cursor (or your specified pivot) instead of this default median point.
Source of where I first came across this solution
Credit to Garrett:
Overriding the context can be done like this:
def get_override(area_type, region_type):
for area in bpy.context.screen.areas:
if area.type == area_type:
for region in area.regions:
if region.type == region_type:
override = {'area': area, 'region': region}
return override
#error message if the area or region wasn't found
raise RuntimeError("Wasn't able to find", region_type," in area ", area_type,
"\n Make sure it's open while executing script.")
#we need to override the context of our operator
override = get_override( 'VIEW_3D', 'WINDOW' )
#rotate about the X-axis by 45 degrees
bpy.ops.transform.rotate(override, value=6.283/8, axis=(1,0,0))
Then, whatever your transformation is, pass in override as the first argument:
bpy.context.tool_settings.transform_pivot_point = "CURSOR"
bpy.ops.transform.resize(override,value=(0.95, 0.95, 0.95))
Also, it should be noted that this means that when you run the script, it requires a visible 3D Viewer to be present.