Chapter 3. Demurrer And Amendment of California Penal Code >> Title 6. >> Part 2. >> Chapter 3.

The only pleading on the part of the defendant is either a demurrer or a plea.
Both the demurrer and plea must be put in, in open Court, either at the time of the arraignment or at such other time as may be allowed to the defendant for that purpose.
The defendant may demur to the accusatory pleading at any time prior to the entry of a plea, when it appears upon the face thereof either: 1. If an indictment, that the grand jury by which it was found had no legal authority to inquire into the offense charged, or, if any information or complaint that the court has no jurisdiction of the offense charged therein; 2. That it does not substantially conform to the provisions of Sections 950 and 952, and also Section 951 in case of an indictment or information; 3. That more than one offense is charged, except as provided in Section 954; 4. That the facts stated do not constitute a public offense; 5. That it contains matter which, if true, would constitute a legal justification or excuse of the offense charged, or other legal bar to the prosecution.
The demurrer must be in writing, signed either by the defendant or his counsel, and filed. It must distinctly specify the grounds of objection to the accusatory pleading or it must be disregarded.
Upon the demurrer being filed, the argument upon the objections presented thereby must be heard immediately, unless for exceptional cause shown, the court shall grant a continuance. Such continuance shall be for no longer time than the ends of justice require, and the court shall enter in its minutes the facts requiring it.
Upon considering the demurrer, the court must make an order either overruling or sustaining it. If the demurrer to an indictment or information is overruled, the court must permit the defendant, at the defendant's election, to plead, which the defendant must do forthwith, unless the court extends the time. If the demurrer is sustained, the court must, if the defect can be remedied by amendment, permit the indictment or information to be amended, either forthwith or within such time, not exceeding 10 days, as it may fix, or, if the defect or insufficiency therein cannot be remedied by amendment, the court may direct the filing of a new information or the submission of the case to the same or another grand jury. If the demurrer to a complaint is sustained, the court must, if the defect can be remedied, permit the filing of an amended complaint within such time not exceeding 10 days as it may fix. The orders made under this section shall be entered in the docket or minutes of the court.
If the demurrer is sustained, and no amendment of the accusatory pleading is permitted, or, in case an amendment is permitted, no amendment is made or amended pleading is filed within the time fixed therefor, the action shall be dismissed, and, except as provided in Section 1010, the court must order, if the defendant is in custody, that he be discharged or if he has been admitted to bail, that his bail be exonerated, or, if money or other property has been deposited instead of bail for his appearance, that such money or other property be refunded to him or to the person or persons found by the court to have deposited such money or other property on his behalf.
An indictment, accusation or information may be amended by the district attorney, and an amended complaint may be filed by the prosecuting attorney, without leave of court at any time before the defendant pleads or a demurrer to the original pleading is sustained. The court in which an action is pending may order or permit an amendment of an indictment, accusation or information, or the filing of an amended complaint, for any defect or insufficiency, at any stage of the proceedings, or if the defect in an indictment or information be one that cannot be remedied by amendment, may order the case submitted to the same or another grand jury, or a new information to be filed. The defendant shall be required to plead to such amendment or amended pleading forthwith, or, at the time fixed for pleading, if the defendant has not yet pleaded and the trial or other proceeding shall continue as if the pleading had been originally filed as amended, unless the substantial rights of the defendant would be prejudiced thereby, in which event a reasonable postponement, not longer than the ends of justice require, may be granted. An indictment or accusation cannot be amended so as to change the offense charged, nor an information so as to charge an offense not shown by the evidence taken at the preliminary examination. A complaint cannot be amended to charge an offense not attempted to be charged by the original complaint, except that separate counts may be added which might properly have been joined in the original complaint. The amended complaint must be verified but may be verified by some person other than the one who made oath to the original complaint.
When an indictment or information is dismissed after the sustaining of a demurrer, or at any other stage of the proceedings because of any defect or insufficiency of the indictment or information, if the court directs that the case be resubmitted to the same or another grand jury or that a new information be filed, the defendant shall not be discharged from custody, nor the defendant's bail exonerated nor money or other property deposited instead of bail on the defendant's behalf refunded, but the same proceedings must be had on such direction as are prescribed in Sections 997 and 998.
When any of the objections mentioned in Section 1004 appears on the face of the accusatory pleading, it can be taken only by demurrer, and failure so to take it shall be deemed a waiver thereof, except that the objection to the jurisdiction of the court and the objection that the facts stated do not constitute a public offense may be taken by motion in arrest of judgment.