When viewing a file that has spaces in it, ui.active_window().doc returns a path with URL-encoded spaces even though it's not a file:// URL:
>>> ui.active_window().doc
'/Users/pcohen/Desktop/Test%20File.txt'
>>> ui.active_window().element.AXDocument
'file:///Users/pcohen/Desktop/Test%20File.txt'

@nriley suggested this may be a bug.
When viewing a file that has spaces in it,
ui.active_window().docreturns a path with URL-encoded spaces even though it's not afile://URL:@nriley suggested this may be a bug.