Richard H. Pildes is the Sudler Family Professor of Constitutional Law at New York University School of Law and a CNN election analyst.

Pennsylvania’s Democratic governor and Republican legislature will both deserve blame for hurtling the country toward a potential election nightmare should the election be close. In a perfect example of the dysfunction that plagues so much of our governing process, their failure has made Pennsylvania a likely center of chaos in a close election.

Since the pandemic first broke, we have known that this election would produce a dramatic increase in absentee voting. In 2016, 266,000 Pennsylvanians voted absentee. This year, the state expects as many as 3 million such ballots will be cast, all of which must be verified, processed and counted. Those received so far are sitting in election administrators’ offices because state law — for no good reason — prohibits these officials from beginning the arduous process of tabulating them.

For months, it has also been widely known that this absentee-ballot surge, across most states, means that election administrators will need considerably more time to process ballots. Grasping this reality, many states changed their laws to permit election officials to tackle ballots earlier than normal.

Georgia, for example, shifted to permitting this process to begin more than two weeks before Election Day. Florida permits processing three weeks before Election Day. Other states allow officials to process these ballots as they come in. As a result, these states will be able to provide vote counts — including a high percentage of absentee ballots — on election night or shortly after. Processing these ballots does not mean counting them; it means doing all the prior work, such as verifying their validity , removing them from envelopes and flattening them to get ready to be counted.

But not Pennsylvania. The governor and legislature recently made sure of that by failing to reach any agreement on this issue, despite state election administrators from both parties pleading for them to do so. If only 5 percent of voters had cast their ballots by mail, as in past Pennsylvania elections, this would not be a problem. But with as many as 3 million absentee ballots on their way, it’s a disaster waiting to happen.

This was completely avoidable. Indeed, the situation was already difficult for election administrators in Pennsylvania; they have to implement, for the first time in a presidential election, the greatest set of changes to the state’s election processes since 1937.

Both sides in Pennsylvania understood this problem and appeared to want to change it. Yet they failed in their public responsibility, to Pennsylvania and the country. The legislature was prepared to permit the process to begin three days before Election Day. This period would have made a significant difference in how quickly Pennsylvania could process these ballots and include many of them in the vote totals it released on election night. It would have been the difference between waiting two days for a full count or five days.

But Republicans in the legislature insisted on packaging this critical proposal with other voting policies they wanted changed. Meanwhile, Gov. Tom Wolf (D) argued that election officials be able to start 21 days in advance and was not willing to accept the policy changes the legislature was demanding.

If the two sides had simply isolated negotiations to focus just on processing early ballots, it appears they could have reached an agreement. Indeed, if the governor couldn’t reach an agreement with anything more than the three days the legislature was offering, he should have taken those three days. The issue of how soon Pennsylvania could count its vote was far more important for the country than the other issues with which the two sides insisted on entangling it. Each side, of course, blames the other for no deal taking place; the governor says he offered major concessions, while the legislature denies this is true.

In states that permit early processing, such as Florida, it has been going on quietly for almost three weeks. That early start has minimized political struggles over the validity of ballots. When polls close in Florida, the state will be able quickly to include most of its absentee ballots in its election night count.

But Pennsylvania is sitting on a tinderbox. In a close election, the state will be critical. Scorched-earth struggles over absentee ballots will erupt, with incentives on one side to drag that process out as long as possible. I am doubtful the country will sit patiently if Pennsylvania takes a week to figure out its vote. All this brought to you by a governor and legislature who provide a textbook example of much of what’s wrong with our politics.

Watch Opinions videos:

Wendy Weiser of the Brennan Center warns that the president is doing the work of our foreign adversaries by undermining the legitimacy of the U.S. election. (The Washington Post)

Read more: