Jon Stewart jokes that he and Maziar Bahari have spent so much time traveling the country together to promote Stewart’s new film, “Rosewater,” that they’ve become the equivalent of a showbiz odd couple.

Now, if they can only decide which pair they most resemble.

“It’s a lot of Walter Matthau and Jack Lemmon-two grumpy old men trying to figure out schedules and what we’re going to eat,” Stewart says during a spirited conversation at the St. Francis Hotel in San Francisco.

“But it’s also like George Michael and that other guy from Wham-Andrew Ridgeley,” insists Bahari, the subject of the film.

“OK,” Stewart concedes. “So it’s like Wham and the Sunshine Boys. On tour together.”

The two men became linked in 2009 when Stewart’s satirical news program, “The Daily Show” aired a playful interview with Bahari, a Tehran-born journalist with Canadian citizenship, just days before Iran’s hotly disputed presidential election. During the bit, “Daily Show” correspondent Jason Jones, pretending to be a dim-witted reporter, demanded to know why Iran was so evil.

Unfortunately, Iranian officials didn’t get the joke. They absurdly claimed the interview and other random “evidence” proved that Bahari was an American spy. He was arrested and thrust into solitary confinement for 118 days, during which he was repeatedly interrogated and tortured.

In a fitting postscript, Stewart took a three-month leave from “The Daily Show” last year to spend his summer in Jordan making a movie that depicts Bahari’s ordeal. “Rosewater,” Stewart’s directorial debut, recalls the reporter’s excruciating incarceration and the international publicity campaign to free him.

Motivated in part by guilt, Stewart optioned the rights to Bahari’s memoir in 2010, expecting to recruit someone to write and direct the cinematic adaptation. But after learning that the filmmakers he met with were busy with other projects, an impatient Stewart decided to embrace the challenge himself.

Some may consider “Rosewater” to be an unlikely debut for a comedian, but Bahari, points to Stewart’s passion for politics and the media.

“It’s not like you’ve got Carrot Top making ‘Schindler’s List,’” he says with a smile.

As for Stewart, he insists that slipping into a director’s chair didn’t feel “like an alien thing.”

“I certainly had my concerns, but I felt good about the team around me and the source material, and that Maziar was with us on set,” he says. “It was just a question of whether the alchemy would occur. Everything can line up in a very logical and rational way, but you can miss an essence that does not translate.”

Stewart’s worries weren’t truly eased until he was able to present Bahari with a rough cut of the film in an editing room back at the “Daily Show“‘s New York studio.

“When I came out of the room, I saw Jon hunched in a corner, hugging his three-legged dog, Little Dipper,” Bahari recalls. “He was very nervous, but he didn’t need to be. I told him it turned out beautifully. We hugged, and it was one of the seminal moments in our relationship.”

Bahari, who with Stewart, presented “Rosewater” to UC Berkeley journalism students during their stop in the Bay Area in October, says he hopes the film gives viewers “an appreciation for what journalists are going through on a daily basis-especially journalists in countries where freedom of information is not respected.

“The film is based on my story,” he says. “But it’s really the story of countless people around the world.”