See if this works -- replace "\" with "\\" in your path string formation:
import arcpy
import os
fc = r" C:\Users\GIS\Documents\TEST 2-25\project_test.shp"
fields = ["PROJECT_DW"]
with arcpy.da.SearchCursor (fc,fields) as cursor:
for row in cursor:
Roll = str(row[0])
Roll = Roll.replace("\\", "\\\\")
if os.path.exists(Roll):
pass
else:
f = open(r"C:\Users\GIS\Documents\brokenlinks.txt","a")
f.write(Roll + os.linesep)
f.close()
This is also valid way to deal with it too:roll = roll.replace('\\', r'/')