Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3432360
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:26:22+00:00 2026-05-18T07:26:22+00:00

Running Python 2.5 on Windows XP SP2. When I run a Python script that

  • 0

Running Python 2.5 on Windows XP SP2.

When I run a Python script that calls a user-defined module called Zipper.py (basically a wrapper for a zipfile) using a Windows scheduledTask I get this exception:

Traceback (most recent call last):
File “C:\PythonScripts\ZipAndSendEOD-Reports.py”, line 78, in main
Zipper.main([report],f, debug=True) #[:-4] + “_” + str(x) + “.zip”)
TypeError: main() got an unexpected keyword argument ‘debug’

The odd thing is that if I simply open the file in IDLE and hit ‘F5’, it runs flawlessly.

I’m sure I left out some pertinent information, please let me know what you need.

Zipper.py looks like this:

import zipfile

def main(archive_list=[],zfilename='default.zip', debug=False):
    if debug:    print 'file to zip', zfilename
    zout = zipfile.ZipFile(zfilename, "w", zipfile.ZIP_DEFLATED)
    for fname in archive_list:
        if debug:    print "writing: ", fname
        zout.write(fname)
    zout.close()

if __name__ == '__main__':
    main()

EDIT:
I added the following two lines of code to the calling function, and it now works.

f =  open(logFile, 'a')
f.write(Zipper.__file__)

Can you explain THAT to me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:26:23+00:00Added an answer on May 18, 2026 at 7:26 am

    As Paul said, you’re probably running a different version of Zipper.py – I would print out Zipper.__file__ and then if you need to debug, print out sys.path to see why it’s finding a different file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running Python 3.1 on Windows and I'm trying to distribute my Pygame script
I've got a long running python script that I want to be able to
Hey I have a windows server running python CGI scripts and I'm having a
I am running a windows machine have installed Python 2.5. I also used the
I'm running Python 2.6 on Unix and when I run the interactive prompt (
A python script is running two parallel python processes ( created via os.fork() )
I am running Python under windows. I face no problem in installing pysqlite package.
I would like to install bitarray in Windows running python 2.6. I have mingw32
I'm running Python 2.5.4 on Windows and I keep getting an error when trying
I'm running python 2.6 with latest IPython on Windows XP SP3, and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.