
    James Milus WEAVER, Appellant, v. Orville B. PUNG, Appellee.
    No. 89-5527.
    United States Court of Appeals, Eighth Circuit.
    Submitted Nov. 16, 1990.
    Decided Feb. 12, 1991.
    
      Paul Engh, Minneapolis, Minn., for appellant.
    Mark S. Rubin, Duluth, Minn., for appel-lee.
    Before ARNOLD and MAGILL, Circuit Judges and BENSON, Senior District Judge.
    
      
       The Honorable Paul Benson, Senior United States District Judge for the District of North Dakota, sitting by designation.
    
   BENSON, Senior District Judge.

James Weaver appeals the district court’s denial of his petitions for writs of habeas corpus for lack of subject-matter jurisdiction. We affirm.

BACKGROUND

Weaver was convicted in state court on one count of first-degree criminal sexual conduct. On June 21, 1985, he was sentenced to imprisonment for a term of forty-three months. Post-conviction relief was sought and denied in state court. Weaver v. State, 408 N.W.2d 200 (Minn.Ct.App.1987). Weaver then sought relief in United States District Court pursuant to 28 U.S.C. § 2254.

Weaver’s petitions for writs of habeas corpus were referred to the United States Magistrate for report and recommendation. The magistrate recommended the petitions be dismissed for lack of jurisdiction because Weaver was not “in custody” for purposes of 28 U.S.C. § 2254 at the time the petitions were filed. The magistrate found Weaver’s sentence had fully expired on November 10, 1988. The magistrate also found the petitions were not filed until November 14, 1988.

Weaver objected to the report and recommendation. He contended that his contacts with the clerk's office prior to the expiration of his sentence were sufficient to constitute “filing.” Weaver stated in his objection:

On November 8, 1988, petitioner appeared in person at the District Court Clerks Office in the Federal Building in St. Paul, with a petition for writ of habe-as corpus. Since two state courts were involved, the person at the counter indicated that two petitions were required. On November 8, 1988, petitioner returned home and drafted two petitions. On November 9, 1988 petitioner returned to the Clerks office after making copies. Since petitions for proceeding in forma pauperis were included, the counter person refused to accept the filing fee and stated that there was plenty of time for the fee if required since, all the documents were acceptable and were date stamped and case numbers assigned....
On November 12, 1988, (Saturday— Federal offices closed) petitioner received the attached letters in the mail and at the earliest possible time available (November 14, 1988) paid the fees.

Upon a de novo review, the district court adopted the magistrate’s report and recommendation and ordered that the petitions for writs of habeas corpus be denied. The district court granted Weaver’s request for a certificate of probable cause. This appeal followed.

DISCUSSION

Title 28, section 2254(a) of the United States Code confers jurisdiction on district courts provided that relief is sought by a person who is “in custody in violation of the Constitution or laws or treaties of the United States.” (emphasis added). If the petitioner does not satisfy the custody requirement, the district court lacks subject-matter jurisdiction. Maleng v. Cook, 490 U.S. 488, 109 S.Ct. 1923, 104 L.Ed.2d 540 (1989).

Custody is tested at the time of filing the petition. A person must be in custody under the conviction or sentence attacked at the time of filing. Id. 109 S.Ct. at 1925. A person whose sentence has fully expired at the time his petition is filed can not satisfy the custody requirement. Id. 109 S.Ct. at 1925-26. Because Weaver’s sentence fully expired on November 10, 1988, we must determine whether the district court erred in concluding that the moment of filing occurred on November 14, 1988.

The filing of petitions for writs of habeas corpus is governed by rule 3(b) of the Rules Governing Section 2254 Cases in the United States District Courts. Rule 3(b) provides that the clerk of the district court shall file a petition “upon receipt of the petition and the filing fee, or an order granting leave to the petitioner to proceed in forma pauperis.” 28 U.S.C. foil. § 2254, Rule 3(b). Notably, the rule does not direct the clerk to file the petition upon receipt of the petition and an application to proceed in forma pauperis.

The advisory committee notes to the Rules Governing Section 2254 Cases indicate that rule 3(b) contemplates prompt attention will be given to applications to proceed in forma pauperis. Weaver’s applications to proceed in forma pauperis received the prompt attention contemplated by the rule. The magistrate denied Weaver’s applications on November 9, 1988 — the date on which they were received by the clerk. Had an order granting leave to proceed in forma pauperis been entered, Weaver’s petitions would have been filed prior to the expiration of his sentence pursuant to rule 3(b).

An order granting leave to proceed in forma pauperis was not entered in this case. Pursuant to rule 3(b), November 14, the date on which the filing fee was paid, was the earliest date on which Weaver’s petitions could have been filed. Weaver was not “in custody” on November 14. The district court lacked subject-matter jurisdiction over Weaver’s petitions. • Its denial of the petitions is affirmed. 
      
      . The Honorable Paul A. Magnuson, United States District Judge, for the District of Minnesota.
     
      
      . The conviction was affirmed on appeal. State v. Weaver, 386 N.W.2d 413 (Minn.Ct.App.1986). Weaver was also convicted on a second count of first degree criminal sexual conduct, one count of third degree criminal sexual conduct and one count of fifth degree assault. These convictions were vacated under state law. Id.
      
     
      
      .The Honorable Floyd E. Boline, United States Magistrate Judge for the District of Minnesota.
     
      
      . The decision to grant or deny in forma pau-peris status is within the sound discretion of the trial court. Cross v. General Motors Corp., 721 F.2d 1152, 1157 (8th Cir.1983). The court did not abuse its discretion in denying in forma pauperis status to Weaver. Weaver’s applications to proceed in forma pauperis were correctly denied because of excessive income. Weaver’s income for the preceding twelve months was estimated at $26,000 to $30,000. The filing fee was five dollars. The opportunity to proceed in forma pauperis is a privilege, not a right. Williams v. McKenzie, 834 F.2d 152, 154 (8th Cir.1987) (citing Startti v. United States, 415 F.2d 1115, 1116 (5th Cir.1969)).
     