Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Does not work on OSX qsize(): not supported #16

Open
@JGillam

Description

On OSX Queue.qsize() breaks for multiprocessor queues. There are two calls to this function in httpscreenshot.

Locally I was able to get httpscreenshot to run on OSX by changing these to use the .empty() method, but this results in not getting any stdout feedback on how many items left in the queue... unless you hack some external global counter... but then you have to contend with thread-safe (and multi-processor safe) access to that... so I'm not sure its worth a pull request. Hopefully someone will update the OSX libs to implement qsize(), but in the meantime if anyone wants to run this on OSX, here is what worked for me:

@@ -194,12 +194,12 @@ def worker(urlQueue, tout, debug, headless, doProfile, vhosts, subs, extraHosts,
 while True:
 #Try to get a URL from the Queue
- if urlQueue.qsize() > 0:
+ if not urlQueue.empty():
 try: 
 curUrl = urlQueue.get(timeout=tout)
 except Queue.Empty:
 continue
- print '[+] '+str(urlQueue.qsize())+' URLs remaining'
+ print '[+] more URLs remaining'
 screenshotName = quote(curUrl[0], safe='')
 if(debug):
 print '[+] Got URL: '+curUrl[0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /