After you file

Get it written into the divorce decree that you will file a joint 2017 return but don't try to pull a fast one as that almost always backfires on you.