(1) A person shall not be guilty of contempt of court on the ground that he has published (whether by words, spoken or written, or by signs, or by visible representations, or otherwise) any matter which interferes or tends to interfere with, or obstructs or tends to obstruct, the course of justice in connection with any civil or criminal proceeding pending at that time of publication, if at that time he had no reasonable grounds for believing that the proceeding was pending.
(2) Notwithstanding anything to the contrary contained in this Act or any other law for the time being in force, the publication of any such matter as is mentioned in sub-section (1) in connection with any civil or criminal proceeding which is not pending at the time of publication shall not be deemed to constitute contempt of court.
(3) A person shall not be guilty of contempt of court on the ground that he has distributed a publication containing any such matter as is mentioned in sub-section (1), if at the time of distribution he had no reasonable grounds for believing that it contained or was likely to contain any such matter as aforesaid:
Provided that this sub-section shall not apply in respect of the distribution of—
(i) any publication which is a book or paper printed or published otherwise than in conformity with the rules contained in section 3 of the Press and Registration of Books Act, 1867 (25 of 1867);
(ii) any publication which is a newspaper published otherwise than in conformity with the rules contained in section 5 of the said Act.
Explanation.—For the purposes of this section, a judicial proceeding—
(a) is said to be pending—
(A) in the case of a civil proceeding, when it is instituted by the filing of a plaint or otherwise,
(B) in the case of a criminal proceeding under the Code of Criminal Procedure, 1898 (5 of 1898), or any other law—
(i) where it relates to the commission of an offence, when the charge-sheet or challan is filed, or when the court issues summons or warrant, as the case may be, against the accused, and
(ii) in any other case, when the court takes cognizance of the matter to which the proceeding relates, and
in the case of a civil or criminal proceeding, shall be deemed to continue to be pending until it is heard and finally decided, that is to say, in a case where an appeal or revision is competent, until the appeal or revision is heard and finally decided or, where no appeal or revision is preferred, until the period of limitation prescribed for such appeal or revision has expired;
(b) which has been heard and finally decided shall not be deemed to be pending merely by reason of the fact that proceedings for the execution of the decree, order or sentence passed therein are pending.