<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unsupported operand type(s) for +: 'NoneType' and 'NoneType' in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/unsupported-operand-type-s-for-nonetype-and/m-p/187379#M14431</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jennifer&lt;/P&gt;&lt;P&gt;for line numbers... I don't count beyond 5&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting" target="_blank"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None

b &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None

c &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

a &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; b &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; c
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

  File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-43-c4404d400413&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
    a &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; b &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; c

TypeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; unsupported operand type&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One solution&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;d &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        d&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extend&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        

d
Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;53&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:29:03 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-11T09:29:03Z</dc:date>
    <item>
      <title>Unsupported operand type(s) for +: 'NoneType' and 'NoneType'</title>
      <link>https://community.esri.com/t5/python-questions/unsupported-operand-type-s-for-nonetype-and/m-p/187378#M14430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most distinguish colleagues,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not very good a coding. In fact...I'm a beginner. Yet, I inherited this python script that does compression and analysis and I can't figure out why when we switch from 10.3.1 to 10.6.1 the script won't run anymore. It gives me the following error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Step1_CompressAnalyze.py: Line 35&lt;BR /&gt;ERROR: unsupported operand type(s) for +: 'NoneType' and 'NoneType'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line 35&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dataList = arcpy.ListTables() + arcpy.ListFeatureClasses() + arcpy.ListRasters()  &lt;SPAN style="color: #808080;"&gt;# type:&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Here is the whole script.&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcpy

&lt;SPAN style="color: #cc7832;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;main&lt;/SPAN&gt;(parentSDE):
    &lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;os
    &lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;sys
    &lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;datetime

    &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;parentSDE == &lt;SPAN style="color: #a5c261;"&gt;''&lt;/SPAN&gt;:
        parentSDE = arcpy.GetParameterAsText(&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;)
&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;TOOLROOT = os.path.abspath(os.path.dirname(sys.argv[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])).rpartition(&lt;SPAN style="color: #a5c261;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\\&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"&lt;/SPAN&gt;)[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;]
    &lt;SPAN style="color: #808080;"&gt;tool_folder &lt;/SPAN&gt;= os.path.join(TOOLROOT&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"ToolData"&lt;/SPAN&gt;)
    reportFolder = os.path.join(TOOLROOT&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"Reports"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"Daily"&lt;/SPAN&gt;)
    stepName = &lt;SPAN style="color: #a5c261;"&gt;"Step1_"
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;try&lt;/SPAN&gt;:
        &lt;SPAN style="color: #808080;"&gt;#Delete older logs.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;map&lt;/SPAN&gt;(os.unlink&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;(os.path.join(reportFolder&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;f) &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;f &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;os.listdir(reportFolder) &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;stepName &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;f))
        reportFile = os.path.join(reportFolder&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"Step1_CompressandAnalyze.txt"&lt;/SPAN&gt;)
        logFile = &lt;SPAN style="color: #8888c6;"&gt;open&lt;/SPAN&gt;(reportFile&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;'a'&lt;/SPAN&gt;)

        arcpy.env.workspace = parentSDE

        &lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"I've done it!"
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;        &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;#1. Find all feature datasets, feature classes, tables
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        fcList &lt;/SPAN&gt;= []
        &lt;SPAN style="color: #808080;"&gt;unversionedList &lt;/SPAN&gt;= []
        &lt;SPAN style="color: #808080;"&gt;tableList &lt;/SPAN&gt;= []
        &lt;SPAN style="color: #808080;"&gt;unversionedTable &lt;/SPAN&gt;= []

        &lt;SPAN style="color: #808080;"&gt;userName &lt;/SPAN&gt;= &lt;SPAN style="color: #a5c261;"&gt;'OWNER'
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;        &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #a5c261;"&gt;"Nailed it!"&lt;/SPAN&gt;)
        dataList = arcpy.ListTables() + arcpy.ListFeatureClasses() + arcpy.ListRasters()  &lt;SPAN style="color: #808080;"&gt;# type:
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;arcpy.GetMessages()

        &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;dataset &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;arcpy.ListDatasets(&lt;SPAN style="color: #a5c261;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"Feature"&lt;/SPAN&gt;):&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;            &lt;/SPAN&gt;dataList += arcpy.ListFeatureClasses(&lt;SPAN style="color: #aa4926;"&gt;feature_dataset&lt;/SPAN&gt;=dataset)
        arcpy.RebuildIndexes_management(parentSDE&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"SYSTEM"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;dataList&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"ALL"&lt;/SPAN&gt;)
        arcpy.AnalyzeDatasets_management(parentSDE&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"SYSTEM"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;dataList&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"ANALYZE_BASE"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"ANALYZE_DELTA"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"ANALYZE_ARCHIVE"&lt;/SPAN&gt;)

        &lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #a5c261;"&gt;"Analyze Complete"&lt;/SPAN&gt;)
       

        &lt;SPAN style="color: #808080;"&gt;#2. Compress database
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        &lt;/SPAN&gt;logFile.write(&lt;SPAN style="color: #a5c261;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\n&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;Compressed:&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\n&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"&lt;/SPAN&gt;)
        compressTable = os.path.join(parentSDE&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;[f &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;f &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;arcpy.ListTables() &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"compress_log" &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;f.lower()][&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;])
        fieldList = [f.name &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;f &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;arcpy.ListFields(compressTable)]

        arcpy.Compress_management(parentSDE)

        &lt;SPAN style="color: #cc7832;"&gt;with &lt;/SPAN&gt;arcpy.da.SearchCursor(compressTable&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;fieldList) &lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;cur:
            &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;cur:
                lastRow = &lt;SPAN style="color: #a5c261;"&gt;","&lt;/SPAN&gt;.join(&lt;SPAN style="color: #8888c6;"&gt;str(x)&lt;/SPAN&gt; &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;x &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;row[:])


        logFile.write(&lt;SPAN style="color: #a5c261;"&gt;","&lt;/SPAN&gt;.join(fieldList))
        logFile.write(&lt;SPAN style="color: #a5c261;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\n&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"&lt;/SPAN&gt;)
        logFile.write(lastRow)
        logFile.write(&lt;SPAN style="color: #a5c261;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\n&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"&lt;/SPAN&gt;)

        &lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #a5c261;"&gt;"I've done it the right way!"&lt;/SPAN&gt;)
             
      
        &lt;SPAN style="color: #808080;"&gt;#3. Analyze last time
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        &lt;/SPAN&gt;arcpy.RebuildIndexes_management(parentSDE&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"NO_SYSTEM"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;dataList&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"ALL"&lt;/SPAN&gt;)
        arcpy.AnalyzeDatasets_management(parentSDE&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"NO_SYSTEM"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;dataList&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"ANALYZE_BASE"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"ANALYZE_DELTA"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"ANALYZE_ARCHIVE"&lt;/SPAN&gt;)

        &lt;SPAN style="color: #808080;"&gt;## Review report for errors
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        &lt;/SPAN&gt;errorLogs = []
        allLogs = []
        &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;(dirPath&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;dirName&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;fileNames) &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;os.walk(reportFolder):
            &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;fileName &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;fileNames:
                &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;stepName &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;fileName:
                    reportFile = os.path.join(reportFolder&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;fileName)
                    &lt;SPAN style="color: #cc7832;"&gt;with &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;open&lt;/SPAN&gt;(reportFile) &lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;f:
                        content = [x.upper() &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;x &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;f]
                        &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"FAILURE" &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;content &lt;SPAN style="color: #cc7832;"&gt;or &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"IN PROGRESS" &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;content &lt;SPAN style="color: #cc7832;"&gt;or &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"UNSUCCESSFUL" &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;content:
                            errorLogs.append(reportFile)
                            arcpy.AddWarning(&lt;SPAN style="color: #a5c261;"&gt;"Warning or Error found: %s"&lt;/SPAN&gt;%reportFile)
                        &lt;SPAN style="color: #cc7832;"&gt;else&lt;/SPAN&gt;:
                            allLogs.append(reportFile)

        arcpy.SetParameterAsText(&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;errorLogs)
        &lt;SPAN style="color: #cc7832;"&gt;return &lt;/SPAN&gt;(allLogs&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;errorLogs)

    &lt;SPAN style="color: #cc7832;"&gt;except &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;Exception&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;e:
        &lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;traceback&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;sys&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;os
        tb = sys.exc_info()[&lt;SPAN style="color: #6897bb;"&gt;2&lt;/SPAN&gt;]        
        arcpy.AddError(&lt;SPAN style="color: #a5c261;"&gt;"%s: Line %i"&lt;/SPAN&gt;%(&lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(os.path.basename(__file__))&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;tb.tb_lineno))
        arcpy.AddError(e)
        logFile.write(&lt;SPAN style="color: #a5c261;"&gt;"%s: Line %i&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\n&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"&lt;/SPAN&gt;%(&lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(os.path.basename(__file__))&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;tb.tb_lineno))
        logFile.write(&lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(e))
        logFile.close()
        arcpy.SetParameterAsText(&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;reportFile)
        &lt;SPAN style="color: #cc7832;"&gt;return&lt;/SPAN&gt;([]&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;[reportFile])
    &lt;SPAN style="color: #cc7832;"&gt;finally&lt;/SPAN&gt;:
        logFile.close()
        arcpy.AddMessage(&lt;SPAN style="color: #a5c261;"&gt;"--%s Complete"&lt;/SPAN&gt;%(&lt;SPAN style="color: #8888c6;"&gt;str&lt;/SPAN&gt;(os.path.basename(__file__)).replace(&lt;SPAN style="color: #a5c261;"&gt;".pyc"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;''&lt;/SPAN&gt;)))
&lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;__name__ ==  &lt;SPAN style="color: #a5c261;"&gt;"__main__"&lt;/SPAN&gt;:
    parentSDE = &lt;SPAN style="color: #a5c261;"&gt;''
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;    &lt;/SPAN&gt;main(parentSDE)

&lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"I'm done compressing!"
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;After I run it I see this message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've done it!&lt;BR /&gt;Nailed it!&lt;BR /&gt;ERROR: Step1_CompressAnalyze.py: Line 35&lt;BR /&gt;ERROR: unsupported operand type(s) for +: 'NoneType' and 'NoneType'&lt;BR /&gt;--Step1_CompressAnalyze.py Complete&lt;BR /&gt;I'm done compressing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be much appreciate it. Thank you.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unsupported-operand-type-s-for-nonetype-and/m-p/187378#M14430</guid>
      <dc:creator>Jen_Zumbado-Hannibal</dc:creator>
      <dc:date>2021-12-11T09:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Unsupported operand type(s) for +: 'NoneType' and 'NoneType'</title>
      <link>https://community.esri.com/t5/python-questions/unsupported-operand-type-s-for-nonetype-and/m-p/187379#M14431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jennifer&lt;/P&gt;&lt;P&gt;for line numbers... I don't count beyond 5&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting" target="_blank"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None

b &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None

c &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

a &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; b &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; c
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

  File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-43-c4404d400413&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
    a &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; b &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; c

TypeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; unsupported operand type&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One solution&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;d &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        d&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extend&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        

d
Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;53&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:29:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unsupported-operand-type-s-for-nonetype-and/m-p/187379#M14431</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T09:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unsupported operand type(s) for +: 'NoneType' and 'NoneType'</title>
      <link>https://community.esri.com/t5/python-questions/unsupported-operand-type-s-for-nonetype-and/m-p/187380#M14432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for ya'll responses. What happened was that the arguments within the Task Scheduler were not being read correctly. Also, the task wasn't being completed on the server because it&amp;nbsp;had to be run under a different user name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All things that a person who originally built this script would have known. However, I didn't because I was still not yet hired.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for all you who struggle with someone else's work....be certain they create a user name to run tasks. Hopefully, one that doesn't disappear when the person leaves.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2019 01:25:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unsupported-operand-type-s-for-nonetype-and/m-p/187380#M14432</guid>
      <dc:creator>Jen_Zumbado-Hannibal</dc:creator>
      <dc:date>2019-11-20T01:25:45Z</dc:date>
    </item>
  </channel>
</rss>

