“In so doing, the Legislature has gone far beyond the innocent laborers carrying these knives for legitimate purposes and has grossly disregarded the concerns of law enforcement,” he wrote.

But advocates say a legislative change is urgent because the laws are more frequently applied to minorities, primarily in Manhattan. The Legal Aid Society, a nonprofit organization that represents low-income New Yorkers, said 84 percent of its clients prosecuted for gravity knife possession between July 1, 2015, and Dec. 31, 2015, were black or Hispanic. About 5,000 New Yorkers are arrested per year on charges related to carrying pocketknives, the organization said.

“We’re not talking about people who may use a knife in an unlawful way,” said Tina Luongo, attorney-in-charge of the criminal practice at the Legal Aid Society. “What we’re talking about is merely walking around possessing that knife.”

Assemblyman Dan Quart, who sponsored the vetoed bill with Senator Diane Savino, a fellow Democrat, said that New Yorkers, especially those in communities of color, would “face the continuation of discriminatory arrests and prosecutions thanks to unjust opposition in Albany.”

“Make no mistake, this veto will have real life consequences for New York families,” he said. “Electricians, plumbers, laborers and many more have shared their stories of ending up with a criminal record or in Rikers Island due to carrying a work tool they bought in a local hardware store. We could have prevented these results and put an end to these discriminatory prosecutions.”