Any legislator can prattle on uselessly about the depredations of California’s housing crisis. But how many have the courage to do something about it?

We’ll soon find out. SB50, state Sen. Scott Wiener’s measure to legalize apartment construction throughout the state and particularly near mass transit and job centers, is expected to come to its first vote on the Senate floor as soon as Wednesday. A legislative deadline requires it to pass by the end of this week or expire.

Bottled up in committee for two years running, the measure gained a chance of emerging from the chamber this month when Senate President Pro Tem Toni Atkins rescued it from Appropriations Chairman Anthony Portantino, the Los Angeles area Democrat who smothered it last year. Portantino represents the sort of affluent, exclusively zoned neighborhoods that drive the housing shortage by blocking development — and which loathe SB50 for its capacity to prevent them from doing so.

Such impulses have ruled not just the suburbs but the state for too long. The Legislature has not passed a significant bill to boost housing production since 2017. Meanwhile, California has fewer homes per capita than nearly every other state, its housing production continues to slump and the recent growth of its homeless population accounts for more than the entire national increase.

Wiener, D-San Francisco, has made extensive concessions to his critics, amending the bill to preclude displacement of existing affordable housing, exclude smaller counties from many of its provisions and give affected cities two years to develop their own plans to boost density. Support for the bill has grown among environmentalists, labor unions and even local governments. But some remain implacable because they oppose the bill not in its details but in its substance.

It’s clear by now that some misguided California residents and officials would rather live with the housing crisis and its cruelest consequences than let more people live here. The state’s senators now face that choice.

This commentary is from The Chronicle’s editorial board. We invite you to express your views in a letter to the editor. Please submit your letter via our online form: SFChronicle.com/letters.