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

  • SEARCH
  • Home
  • 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 3485518
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:55:02+00:00 2026-05-18T10:55:02+00:00

I was trying to download images with multi-thread, which has a limited max_count in

  • 0

I was trying to download images with multi-thread, which has a limited max_count in python.

Each time a download_thread is started, I leave it alone and activate another one. I hope the download process could be ended in 5s, which means downloading is failed if opening the url costs more than 5s.

But how can I know it and stop the failed thread???

  • 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-18T10:55:03+00:00Added an answer on May 18, 2026 at 10:55 am

    Can you tell which version of python you are using?
    Maybe you could have posted a snippet too.
    From Python 2.6, you have a timeout added in urllib2.urlopen.
    Hope this will help you. It’s from the python docs.

    urllib2.urlopen(url[, data][,
    timeout])
    Open the URL url, which can
    be either a string or a Request
    object.

    Warning HTTPS requests do not do any
    verification of the server’s
    certificate. data may be a string
    specifying additional data to send to
    the server, or None if no such data is
    needed. Currently HTTP requests are
    the only ones that use data; the HTTP
    request will be a POST instead of a
    GET when the data parameter is
    provided. data should be a buffer in
    the standard
    application/x-www-form-urlencoded
    format. The urllib.urlencode()
    function takes a mapping or sequence
    of 2-tuples and returns a string in
    this format. urllib2 module sends
    HTTP/1.1 requests with
    Connection:close header included.

    The optional timeout parameter
    specifies a timeout in seconds for
    blocking operations like the
    connection attempt (if not specified,
    the global default timeout setting
    will be used). This actually only
    works for HTTP, HTTPS and FTP
    connections.

    This function returns a file-like
    object with two additional methods:

    geturl() — return the URL of the
    resource retrieved, commonly used to
    determine if a redirect was followed
    info() — return the meta-information
    of the page, such as headers, in the
    form of an mimetools.Message instance
    (see Quick Reference to HTTP Headers)
    Raises URLError on errors.

    Note that None may be returned if no
    handler handles the request (though
    the default installed global
    OpenerDirector uses UnknownHandler to
    ensure this never happens).

    In addition, default installed
    ProxyHandler makes sure the requests
    are handled through the proxy when
    they are set.

    Changed in version 2.6: timeout was
    added.

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

Sidebar

Related Questions

I'm trying to download images for each artist that has music on my phone,
I'm trying to download multiple images concurrently using Python over the internet, and I've
I am trying to download images from the site. The code which I am
I am trying to develop an application which would download images (from a photography
I am trying to download images from multiple urls from a search in google
I'm trying to download images (.jpg) from web folder using wget. I want to
I'm trying to download images from URLs and pass them to PIL. I would
I am trying to download google images for a particular search. Currently, if i
I'm trying to download several images in response to a single http request. On
I am trying to download all the images in a directory from my web

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.