Feature services that create enterprise geodatabase edit versions are building version names in the format of "DOMAIN\username_servicename" I have a Python script that attempts to rename the edit version when certain conditions are met. However if the username starts with a lowercase "n", the tool interprets this as a Python newline and cannot find the version.
Successful:
arcpy.AlterVersion_management(sdeConn,"DOM\jdoe_testing","edits_jdoe","","PROTECTED")
Not Successful:
arcpy.AlterVersion_management(sdeConn,"DOM\ndoe_testing","edits_ndoe","","PROTECTED)
Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\management.py", line 18176, in AlterVersion raise e ExecuteError: ERROR 999999: Error executing function. Version not found [SRVR.DOM doe_testing] Failed to execute (AlterVersion).
DOM\ndoe_testing becomes DOM doe_testing
The Alter Version tool in ArcToolbox will let you select the edit version after identifying the database connection, but it populates as (from the example above) as "SRVR.DOMdoe_testing". That allows the tool to start executing, but fails with the error of not being able to find the version.
I've tried what I know with raw strings, double backslash, changing to all uppercase for the version name with no success. Anyone else experienced this and found a workaround?