3

Why does arcpy.da.Walk give different output with identical File (GDB) and Personal (MDB) Geodatabases?

Example:

I am using ArcMap 10.4.1

r'D:\SCRipt\New.mdb' is a copy of r'D:\SCRipt\New.gdb'


db = r'D:\SCRipt\New.mdb'
    walk = arcpy.da.Walk(db)
    for x,y,z in walk:
        print x
        print y
        print z

produces this output:

D:\SCRipt\New.mdb
[u'FORESTS']
[u'Layout10', u'Layout1']
D:\SCRipt\New.mdb\FORESTS
[]
[u'Vydel', u'Kvartal', u'Vydel_S', u'Vydel_L', u'Lesnich', u'Leshoz', u'Layout1_Vydel']

db = r'D:\SCRipt\New.gdb'
walk = arcpy.da.Walk(db)
    for x,y,z in walk:
        print x
        print y
        print z

produces this different output:

D:\SCRipt\New.gdb
[u'FORESTS']
[u'Layout1', u'Layout10']
D:\SCRipt\New.gdb\FORESTS
[]
[] ## <- Why?
3
  • Have you tested this code on a modern version of ArcMap? 10.4 is quite old and only partially supported by ESRI. I would imagine most people using this forum are on at least 10.6?
    – Hornbydd
    Sep 25 '21 at 12:34
  • Thank's I'm going to try. But... People may use different version of ArcGIS with my scripts. All my scripts were tested on MDB and work without any problem with this format. Some days ago I tested one script on GDB and find the mistake. I debugged the code and discovered the sourse - Walk and listing functions. I wan't to know - is it a real problem, or it depend's of my software? Maybe there is a way I don't know to make the function work? Sep 25 '21 at 18:21
  • 1
    the same bug in 10.7 detected Sep 27 '21 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.