NEW YORK — On the day Anthony Weiner’s wife, Huma Abedin, announced she was leaving him amid a revival of his sexting scandal, Showtime said it will debut the documentary “Weiner,” a painful, unrestricted look at their lives.

The film, to air Oct. 22 at 9 p.m. EDT, follows the former congressman as he runs for New York City mayor in 2013, two years after he quit Congress when it was revealed he was sending women sexually explicit messages on social media.

His mayoral campaign collapsed after reports surfaced that he had continued to sext women. In round 3, the New York Post published photos late Sunday that it said the Democrat had sent last year to a woman, including bare-chested shots and images of Weiner lying on a bed with his toddler while texting the woman, according to the Post.

The tabloid also ran sexually suggestive text messages that it said the two exchanged.

Soon after the fresh allegations, Abedin — vice chair of Hillary Clinton’s presidential campaign — said Monday in a statement issued by the campaign:

“After long and painful consideration and work on my marriage, I have made the decision to separate from my husband. Anthony and I remain devoted to doing what is best for our son, who is the light of our life.”