irahorecka / pycraigslist

Craigslist API wrapper
MIT License
40 stars 14 forks source link

Limit function has problems. #3

Closed usctzen closed 3 years ago

usctzen commented 3 years ago

Using the script below yields different results based on the environment. When used with Google Collab (python 3.8.8) the limit function works fine. When used in my PyCharm (also python 3.8.8) it returns exactly 3 times the limit requested. In this case 15 results are returned in PyCharm.

import pycraigslist

bike_filters = {
    'posted_today': True,
    'bundle_duplicates': True,
    'make': 'Harley',
    'model': 'Softail'
}

bikes = pycraigslist.forsale.mca(site='miami', area='brw', filters=bike_filters)

for bike in bikes.search(limit=5):
    print(bike)

Let it be known, that my PyCharm is on Windows 10.

usctzen commented 3 years ago

OK, I just tried the script on a PyCharm on a Ubuntu and the limit function is returning the proper number of results. This is definitely a Windows problem.

irahorecka commented 3 years ago

Hey Marc, thank you for the feedback. Could you try upgrading the pycraigslist package in your Windows environment? I patched this issue just a couple of days ago. Let me know if the limit issue persists.

usctzen commented 3 years ago

Was running 0.2.0. Just upgraded to 0.3.3. The limit option is now working under windows. I am letting you close the issue.

irahorecka commented 3 years ago

Thanks, Marc!