“Weiner,” the documentary based on the scandal-ridden New York politician Anthony Weiner, plays this weekend at the Martha’s Vineyard Film Center. Formerly New York’s youngest councilman, and a promising U.S. congressman, Weiner resigned after photos of him in his jockey shorts appeared online in 2011. The film starts a worthwhile conversation about politics, the media, and sexting.

The media had a field day punning on Weiner’s name, as he apologized to his pregnant wife Huma and the public. In 2013, the irrepressible politician returned to the public scene in a run for mayor of New York, and the public seemed ready to give him a second chance. As a popular and progressive candidate, Weiner rose to the top polling slot in the mayoral race. Then more sexually explicit behavior surfaced. Adopting Carlos Danger as a pseudonym, he posted even lewder images online and engaged in phone sex up to six times a day after his resignation from Congress. One of his Internet partners, 23-year-old Sydney Leathers, was ready to capitalize on the brouhaha, and went public. In one horrifyingly comic scene, Weiner’s staff shepherds him through the back of a McDonald’s to avoid a confrontation with Leathers.

Co-directed by Elyse Steinberg and one of Weiner’s former staffers, Josh Kriegman, the documentary tracks the politician’s progress in the mayoral race. As such, it tends to paint a sympathetic portrait of Weiner, although Donald Trump makes a cameo calling him a pervert. There are plenty of scenes illustrating Weiner’s crowdpleasing, energetic campaign style and promises to fight for the middle class. The candidate appeals to voters to understand the whole man.

The film spends considerable time observing Weiner’s wife, one of Hillary Clinton’s top aides. In contrast with her exuberant husband, Huma remains composed and reserved — even enigmatic — standing by her man in a press conference (like Clinton) but also exhibiting apprehensive and at times negative body language. Huma is clearly unhappy with her husband’s decision to bring their young son along for photo ops when he votes in the primary. She refused to accompany him. When MSNBC’s Lawrence O’Donnell asks the candidate, “What is wrong with you?” Weiner goes ballistic. Then, watching a playback of the interview with him, Huma asks her husband why he is laughing and proud of his performance.

Certainly, many politicians have been caught in sexual misdeeds. Think of Gary Hart, John Edwards, Bill Clinton, and Eliot Spitzer. Weiner points out he never had physical contact with any of his sexting partners. Such scandals fascinate a voyeuristic public, and “Weiner” is not trying to capitalize on that fascination. It’s more interested in how a political candidate handles scandal. Also central is the issue of how and why the media feed on scandalmongering instead of addressing policy issues the candidate promotes. “Weiner” narrates a cautionary tale about the distortions in our media, a particularly relevant topic in our current presidential election.

Information on screening times and tickets for “Weiner” and other current films is available at mvfilmsociety.com, entertainmentcinemas.com/locations/Edgartown, and MV Times event listings.