Hi all,
Wondering if anybody else had this issue: when using the append function from the python API, I receive an "Object reference not set to an instance of an object" error. The weird part is I've gotten the code to work previously after getting the error, then today went I went in to make some adjustments, it stopped working all the sudden. The previous reason I was getting the error had to do with the field names not matching, but that has since been corrected (since I'm appending from a shapefile, I had to account for truncated field names). While troubleshooting, I used the exact same code from within the python window in ArcGIS Pro and it appeared to work, which makes me think something else is going on here.
Here is the code in question:
<SPAN class="comment token"># get public lease feature layer</SPAN>
public_leases <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'item id string'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># get specific sublayer from public lease feature layer</SPAN>
public_lease_layer <SPAN class="operator token">=</SPAN> public_leases<SPAN class="punctuation token">.</SPAN>layers<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token"># get source lease data </SPAN>
source_leases <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'item id string'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># get source lease layer </SPAN>
source_leases_layer <SPAN class="operator token">=</SPAN> source_leases<SPAN class="punctuation token">.</SPAN>layers<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token"># Query for only Active, Pending Leases as a spatial data frame</SPAN>
source_leases_query <SPAN class="operator token">=</SPAN> source_leases_layer<SPAN class="punctuation token">.</SPAN>query<SPAN class="punctuation token">(</SPAN>where<SPAN class="operator token">=</SPAN><SPAN class="string token">"RecordStatus = 'Active' Or RecordStatus = 'Pending'"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>sdf
<SPAN class="comment token"># Publish the spatial data frame as a feature layer, will also publish a shapefile</SPAN>
temp_layer <SPAN class="operator token">=</SPAN> source_leases_query<SPAN class="punctuation token">.</SPAN>spatial<SPAN class="punctuation token">.</SPAN>to_featurelayer<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'temp_lease_feature_layer'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Export temporary layer to shapefile</SPAN>
temp <SPAN class="operator token">=</SPAN> temp_layer<SPAN class="punctuation token">.</SPAN>export<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'temp_lease_shapefile'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'Shapefile'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># append public lease layer with records from temp shapefile (SLC Properties) using upsert</SPAN>
public_lease_layer<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>
item_id<SPAN class="operator token">=</SPAN>temp<SPAN class="punctuation token">.</SPAN>id<SPAN class="punctuation token">,</SPAN>
upload_format<SPAN class="operator token">=</SPAN><SPAN class="string token">'shapefile'</SPAN><SPAN class="punctuation token">,</SPAN>
upsert<SPAN class="operator token">=</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">,</SPAN>
update_geometry<SPAN class="operator token">=</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">,</SPAN>
use_globalids<SPAN class="operator token">=</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">,</SPAN>
field_mappings<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'RecordStatus'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'RecordStat'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'LeaseNum'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'LeaseNum'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'GeneralLocation'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'GeneralLoc'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'LeaseorPermit'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'LeaseorPer'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'TypeofLease'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'TypeofLeas'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'LeaseStartDate'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'LeaseStart'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'LeaseExpirationDate'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'LeaseExpir'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'SLCApprovalDate'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'SLCApprova'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'MinuteItem'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'MinuteItem'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Improvements'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Improvemen'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Latitude'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Latitude'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Longitude'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Longitude'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>And here is the error I get:
<SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN>
RuntimeError Traceback <SPAN class="punctuation token">(</SPAN>most recent call last<SPAN class="punctuation token">)</SPAN>
<SPAN class="operator token"><</SPAN>ipython<SPAN class="operator token">-</SPAN>input<SPAN class="number token">-13</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">93b5922cf27b</SPAN><SPAN class="operator token">></SPAN> <SPAN class="keyword token">in</SPAN> <SPAN class="operator token"><</SPAN>module<SPAN class="operator token">></SPAN>
<SPAN class="number token">43</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="number token">44</SPAN> <SPAN class="string token">'name'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Longitude'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">45</SPAN> <SPAN class="string token">'source'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Longitude'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="operator token">/</SPAN>opt<SPAN class="operator token">/</SPAN>conda<SPAN class="operator token">/</SPAN>lib<SPAN class="operator token">/</SPAN>python3<SPAN class="number token">.6</SPAN><SPAN class="operator token">/</SPAN>site<SPAN class="operator token">-</SPAN>packages<SPAN class="operator token">/</SPAN>arcgis<SPAN class="operator token">/</SPAN>features<SPAN class="operator token">/</SPAN>layer<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> append<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> item_id<SPAN class="punctuation token">,</SPAN> upload_format<SPAN class="punctuation token">,</SPAN> source_table_name<SPAN class="punctuation token">,</SPAN> field_mappings<SPAN class="punctuation token">,</SPAN> edits<SPAN class="punctuation token">,</SPAN> source_info<SPAN class="punctuation token">,</SPAN> upsert<SPAN class="punctuation token">,</SPAN> skip_updates<SPAN class="punctuation token">,</SPAN> use_globalids<SPAN class="punctuation token">,</SPAN> update_geometry<SPAN class="punctuation token">,</SPAN> append_fields<SPAN class="punctuation token">,</SPAN> rollback<SPAN class="punctuation token">,</SPAN> skip_inserts<SPAN class="punctuation token">,</SPAN> upsert_matching_field<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1456</SPAN> sres <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>_con<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN>path<SPAN class="operator token">=</SPAN>surl<SPAN class="punctuation token">,</SPAN> params<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="string token">'f'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'json'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1457</SPAN> <SPAN class="keyword token">while</SPAN> sres<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'status'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>lower<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">!=</SPAN> <SPAN class="string token">"completed"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">1458</SPAN> sres <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>_con<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN>path<SPAN class="operator token">=</SPAN>surl<SPAN class="punctuation token">,</SPAN> params<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="string token">'f'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'json'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1459</SPAN> <SPAN class="keyword token">if</SPAN> sres<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'status'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>lower<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">in</SPAN> <SPAN class="string token">"failed"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="number token">1460</SPAN> <SPAN class="keyword token">break</SPAN>
<SPAN class="operator token">/</SPAN>opt<SPAN class="operator token">/</SPAN>conda<SPAN class="operator token">/</SPAN>lib<SPAN class="operator token">/</SPAN>python3<SPAN class="number token">.6</SPAN><SPAN class="operator token">/</SPAN>site<SPAN class="operator token">-</SPAN>packages<SPAN class="operator token">/</SPAN>arcgis<SPAN class="operator token">/</SPAN>_impl<SPAN class="operator token">/</SPAN>connection<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> get<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> path<SPAN class="punctuation token">,</SPAN> params<SPAN class="punctuation token">,</SPAN> ssl<SPAN class="punctuation token">,</SPAN> compress<SPAN class="punctuation token">,</SPAN> try_json<SPAN class="punctuation token">,</SPAN> is_retry<SPAN class="punctuation token">,</SPAN> use_ordered_dict<SPAN class="punctuation token">,</SPAN> out_folder<SPAN class="punctuation token">,</SPAN> file_name<SPAN class="punctuation token">,</SPAN> force_bytes<SPAN class="punctuation token">,</SPAN> add_token<SPAN class="punctuation token">,</SPAN> token<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">900</SPAN> <SPAN class="keyword token">return</SPAN> self<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN>path<SPAN class="operator token">=</SPAN>path<SPAN class="punctuation token">,</SPAN> params<SPAN class="operator token">=</SPAN>params<SPAN class="punctuation token">,</SPAN> ssl<SPAN class="operator token">=</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">,</SPAN> compress<SPAN class="operator token">=</SPAN>compress<SPAN class="punctuation token">,</SPAN> try_json<SPAN class="operator token">=</SPAN>try_json<SPAN class="punctuation token">,</SPAN> is_retry<SPAN class="operator token">=</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">901</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">902</SPAN> self<SPAN class="punctuation token">.</SPAN>_handle_json_error<SPAN class="punctuation token">(</SPAN>resp_json<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'error'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> errorcode<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">903</SPAN> <SPAN class="keyword token">return</SPAN> None
<SPAN class="number token">904</SPAN> <SPAN class="keyword token">except</SPAN> AttributeError<SPAN class="punctuation token">:</SPAN>
<SPAN class="operator token">/</SPAN>opt<SPAN class="operator token">/</SPAN>conda<SPAN class="operator token">/</SPAN>lib<SPAN class="operator token">/</SPAN>python3<SPAN class="number token">.6</SPAN><SPAN class="operator token">/</SPAN>site<SPAN class="operator token">-</SPAN>packages<SPAN class="operator token">/</SPAN>arcgis<SPAN class="operator token">/</SPAN>_impl<SPAN class="operator token">/</SPAN>connection<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _handle_json_error<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> error<SPAN class="punctuation token">,</SPAN> errorcode<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1201</SPAN>
<SPAN class="number token">1202</SPAN> errormessage <SPAN class="operator token">=</SPAN> errormessage <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\n(Error Code: "</SPAN> <SPAN class="operator token">+</SPAN> str<SPAN class="punctuation token">(</SPAN>errorcode<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN><SPAN class="string token">")"</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">1203</SPAN> <SPAN class="keyword token">raise</SPAN> RuntimeError<SPAN class="punctuation token">(</SPAN>errormessage<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1204</SPAN>
<SPAN class="number token">1205</SPAN> <SPAN class="keyword token">class</SPAN> <SPAN class="token class-name">_StrictURLopener</SPAN><SPAN class="punctuation token">(</SPAN>request<SPAN class="punctuation token">.</SPAN>FancyURLopener<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
RuntimeError<SPAN class="punctuation token">:</SPAN> Object reference <SPAN class="operator token">not</SPAN> set to an instance of an object<SPAN class="punctuation token">.</SPAN>
<SPAN class="punctuation token">(</SPAN>Error Code<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">400</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Thoughts? am I missing something?