In polls, Mr. Stewart’s campaign found that voters considered the behavior hypocritical and shocking. “Then you ask them, ‘Does it change your mind about voting for him?’ and still a big majority said no,” said Mr. Stewart, who is now working as an assistant development director for a private school.

Political scientists have found that politicians mired in scandal are indeed in worse shape than their colleagues, but that is a relative measurement. A study of post-Watergate Congressional scandals by Scott J. Basinger of the University of Houston found that while scandal-tarred incumbents were far more likely to retire or resign, nearly three-quarters of those who decided to run again survived their primaries and 81 percent of those who made it to the general election retained their seats.

Various elements have been found to favor survival, including the passage of time (which seemed to help Senator Vitter, whose scandal was three years old by the time of his re-election) and reassurances from third parties (which, coming in the form of late endorsements by the South Carolina Republican establishment, may have helped the adulterous former governor, Mark Sanford, win his Congressional race in May).

Some studies conclude that denial tends to be the best survival strategy, but this is not really an option when a candidate has sent anatomical photos over Twitter like Mr. Weiner or popped up in a federal investigation like Mr. Spitzer or, say, had a stripper jump out of his car.

Image Marion Barry, left, arrested on drug charges in 1990, defeated John L. Ray in the 1994 Democratic mayoral primary in Washington. Credit... Left, David Scull/The New York Times; right, Stephen Crowley/The New York Times

Such was the case with Wilbur Mills, a powerful Democratic congressman from Arkansas, who a month before the 1974 elections was stopped by the police in Washington for driving without his lights on. He was found to be drunk and scratched up, while his passenger, a striptease artist known as Fanne Foxe, the Argentine Firecracker, jumped out of his car and into the Tidal Basin beside the Jefferson Memorial.

Mr. Mills’s Republican opponent in that election was a political rookie named Judy C. Petty, who had been running a scrappy but effective campaign focused on taxes and a less colorful scandal involving illegal contributions from dairy interests. When she heard about the stripper incident, Ms. Petty — now she is Judy Petty Wolf — had a bad feeling.