PORTLAND, Ore. — Portland is famously weird and fiercely proud of it, so things can get a little bizarre when it comes time to choose a new mayor.

In one local tradition, candidates try to outdo each other in an eating contest at a doughnut shop known nationally for oddities such as oversized, maple-frosted doughnuts topped with strips of crispy bacon.

That’s politics in a city where the main attraction is culture as opposed to commerce or landmarks.

Food carts, fixed-gear bicycles, pot shops and craft beer make Portland a magnet for the young, hip and liberal. But it’s still a major city with all the attendant dilemmas.

Leaders have to contend with tight budgets, high unemployment and crumbling roads. Minorities face economic and social disenfranchisement and are being pushed to the outskirts of town.

Voters will weigh in Tuesday on which brand of liberal is best equipped to run the city while obeying the command posted in bright yellow letters on brick walls, car bumpers, T-shirts and concert fliers, “Keep Portland weird!”

One contender, state Rep. Jefferson Smith, said he finished off three cream-filled treats at Voodoo Doughnut, which has gained national fame on food-themed cable TV shows such as Travel Channel’s “No Reservations” and “Man v. Food.”

Another front-runner, Eileen Brady, the gluten-averse co-founder of a popular organic grocery chain, used a surrogate eater to avoid the deep-fried flour. She apparently preferred the stand-in over bringing steamed kale to the doughnut shop, an option she’d considered.

The other high-profile candidate, Charlie Hales, skipped the tradition.

All told, there are nearly two-dozen contenders pursuing the city’s top job, a field that includes an Occupy Portland leader and a reformed radical environmentalist.

The winner will replace Sam Adams, whose election in 2008 made Portland the largest American city at the time to elect an openly gay mayor.

Recent polling shows the race is very close, and many voters are still making up their minds.

Smith, Brady and Hales, the candidates with the most organized and well-funded campaigns, are all Democrats.

The primary race is expected to whittle the field down to two candidates, who will then face off in the November election.