"bpy.context.scene.object_bases" not working in 2.80?
Appears no need for bases in 2.8  join operator override.

Testing this in python console. Have duped the default cube 3 times, the last dupe "Cube.003" is active and only object selected.

&gt;&gt;&gt; C.object
bpy.data.objects['Cube.003']


&gt;&gt;&gt; C.selected_objects
[bpy.data.objects['Cube.003']]


A list of all the mesh objects in scene to join

&gt;&gt;&gt; obs = [o for o in C.scene.objects if o.type == 'MESH']
&gt;&gt;&gt; obs
[bpy.data.objects['Cube'], bpy.data.objects['Cube.001'], bpy.data.objects['Cube.002'], bpy.data.objects['Cube.003']]


Make a context override dictionary, with only object, active_object, selected_objects, selected_editable_objects as members (possibly don't require "object")

&gt;&gt;&gt; c = {}

&gt;&gt;&gt; c["object"] = c["active_object"] = C.object
&gt;&gt;&gt; c["selected_objects"] = c["selected_editable_objects"] = obs


Run the operator with this override

&gt;&gt;&gt; bpy.ops.object.join(c)
{'FINISHED'}


Resulting scene after running.  All four cubes are joined as one "Cube.003"

&gt;&gt;&gt; C.scene.objects[:]
[bpy.data.objects['Lamp'], bpy.data.objects['Camera'], bpy.data.objects['Cube.003']]


Risky look at obs since three of the objects no longer exist.

&gt;&gt;&gt; obs
[&lt;bpy_struct, Object invalid&gt;, &lt;bpy_struct, Object invalid&gt;, &lt;bpy_struct, Object invalid&gt;, bpy.data.objects['Cube.003']]


Related

poll() failed, context incorrect? - Example: bpy.ops.view3d.background_image_add()

Scripting -- Can&#39;t figure out how to use correct contexts?

Reliable way to find out the required context for an operator?

How to find an operator&#39;s source code?