PARIS—In publishing sexually explicit messages allegedly from a mayoral candidate, Russian performance artist Piotr Pavlensky broke one of France’s unwritten rules: The sex lives of politicians are off limits.

Politicians and mainstream media in France have long observed the convention that the private indiscretions of the political class do not belong in the public eye. A determined outsider like Mr. Pavlensky, amplified by social media, has shown how that arrangement is under threat.

...