RE: where is requests

2023-05-23 Thread Mike Dewhirst
Try pip install requests--(Unsigned mail from my phone) Original message From: Rich Osborne Date: 24/5/23 11:49 (GMT+10:00) To: python-list@python.org Subject: where is requests I have install Python 3.11.3 but my import requests does not work. I found documentation that

Re: where is requests

2023-05-23 Thread MRAB
On 2023-05-24 01:14, Rich Osborne wrote: I have install Python 3.11.3 but my import requests does not work. I found documentation that refers to C:\python35 but I am on 3.11.3. Where do I find requests? It's not part of the standard library. You can import it using pip. If you're

where is requests

2023-05-23 Thread Rich Osborne
I have install Python 3.11.3 but my import requests does not work. I found documentation that refers to C:\python35 but I am on 3.11.3. Where do I find requests? Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows -- https://mail.python.org/mailman/listinfo/

Discussion forum for typing Q&A and review requests

2021-09-13 Thread Sebastian Rittau
Typing with Python is hard and constantly evolving. This is why we set up a forum to help users with typing at https://github.com/python/typing/discussions . It's fairly new, but at the moment we have two categories for general Q&A and for asking fo

Re: Async requests library with NTLM auth support?

2021-06-03 Thread Albert-Jan Roskam
> Asyncio and httpx [1] look promising but don't seem to support ntlm. Any tips? ==> https://pypi.org/project/httpx-ntlm/ Not sure how I missed this in the first place. :-) -- https://mail.python.org/mailman/listinfo/python-list

Async requests library with NTLM auth support?

2021-06-01 Thread Albert-Jan Roskam
Hi, I need to make thousands of requests that require ntlm authentication so I was hoping to do them asynchronously. With synchronous requests I use requests/requests_ntlm. Asyncio and httpx [1] look promising but don't seem to support ntlm. Any tips? Cheers! Albert-Jan

Re: requests-html 0.10.0 stopped rendering

2020-09-12 Thread nhpython
> On 09/12/2020 11:28 AM nhpython wrote: > > > Windows 10 x64 Pro v10.0.19041.488 build 19041 > 2020-09 Cumulative Update for Win 10 Ver 2004 for x64 KB4571756 > 2020-09 Cumulative Update for .NET Framework 3.5 & 4.8 for Win 10 Ver 2004 > for x64 KB4576478 > requ

requests-html 0.10.0 stopped rendering

2020-09-12 Thread nhpython
Windows 10 x64 Pro v10.0.19041.488 build 19041 2020-09 Cumulative Update for Win 10 Ver 2004 for x64 KB4571756 2020-09 Cumulative Update for .NET Framework 3.5 & 4.8 for Win 10 Ver 2004 for x64 KB4576478 requests-html 0.10.0 pyppeteer 0.2.2 python 3.7+ requests 2.24 I've been using requ

Re: why is requests 2.24 behaving differently on different Win10Pro PCs?

2020-07-30 Thread Barry
> On 29 Jul 2020, at 23:06, nhpython wrote: > > python 3.6+ > requests 2.24 > 2- windows 10 Pro version 2004, build 19041.388 > 1- kubuntu 18.04 > 1-suse leap 15.2 > > Questions > 1. how do I begin to diagnose the source of the problem? > 2. Has anyone exp

why is requests 2.24 behaving differently on different Win10Pro PCs?

2020-07-29 Thread nhpython
python 3.6+ requests 2.24 2- windows 10 Pro version 2004, build 19041.388 1- kubuntu 18.04 1-suse leap 15.2 Questions 1. how do I begin to diagnose the source of the problem? 2. Has anyone experienced this behavior? I have 4 PCs running the same code. On 3 they work, but 1 fails. I have 2

Re: Logging all the requests into a specific file

2020-02-27 Thread DL Neil via Python-list
On 28/02/20 9:29 AM, valon.januza...@gmail.com wrote: I am new to python and all of this, I am using this FastAPI, to build API, I want when users hit any endpoint for ex /products, that to be written into a file , how do I do it? The Python Standard Library offers a Logging library. It has "

Logging all the requests into a specific file

2020-02-27 Thread valon . januzaj98
Hello guys, I am new to python and all of this, I am using this FastAPI, to build API, I want when users hit any endpoint for ex /products, that to be written into a file , how do I do it? -- https://mail.python.org/mailman/listinfo/python-list

Threading hang problems with requests module

2020-01-13 Thread John Levine
. Is there anything wrong here? Is this a known problem with requests or httplib3? I'm running it on MacOS under 3.8.1 but had the same problem under 3.7.4. def lookup1(d): """ lookup one domain """ ans = dict( ... stuff ...) ... various

Obtain all the content from https://free-ss.site/ by pycurl/requests.

2019-09-22 Thread Hongyi Zhao
Hi, I try to obtain the content from https://free-ss.site/ by pycurl/requests. But it seems that the above tools cannot get all of the content as the stuff obtained by the firefox. Is is possible to get all of the content just as the results via firefox for this website by using pycurl

Re: Python unit test framework to fire 1000 unique concurrent requests (rmlibre)

2019-08-29 Thread rmlibre
If you want to try out some libraries to build your own tests, you could try aiohttp, aiodns, and asyncio. The requests using these libraries are made asynchronously, not completely in parallel, but produce a similar effect at lower cost. Some examples and docs on these can be found here: https

Re: Python unit test framework to fire 1000 unique concurrent requests

2019-08-28 Thread Pankaj Jangid
vishwatheworld...@gmail.com writes: > Looking for a unit test framework with below requirements: > 1. Send 1000 unique URL requests in parallel ( Not sequential and not > repetitive requests) > 2. Verify HTTP response status code ( eg: 200, 403, 404 etc) of each > requests

Re: python requests get from API and post to another API and remote u'

2019-08-21 Thread Heinrich Kruger
APIs. I am using python requests. > > I place a get request and the response from the API is "{'id': 32, > > 'description': u'Firewall Outside', 'address': u'10.10.10.230/30'}" > > I then take that information and attempt

Re: python requests get from API and post to another API and remote u'

2019-08-20 Thread Pankaj Jangid
Noah writes: > I place a get request and the response from the API is "{'id': 32, > 'description': u'Firewall Outside', 'address': u'10.10.10.230/30'}" > > I then take that information and attempt post it to the other API. > The data is not accepted and the result is an HTTP 400 code. > > I tried

Re: python requests get from API and post to another API and remote u'

2019-08-20 Thread Chris Angelico
On Tue, Aug 20, 2019 at 6:59 PM Noah wrote: > > Hi, > > I am trying to migrate information and data between two systems using > their corresponding APIs. I am using python requests. > > I place a get request and the response from the API is "{'id': 32,

python requests get from API and post to another API and remote u'

2019-08-20 Thread Noah
Hi, I am trying to migrate information and data between two systems using their corresponding APIs. I am using python requests. I place a get request and the response from the API is "{'id': 32, 'description': u'Firewall Outside', 'address&#

Re: How to load cookies from a json input in python-requests?

2019-08-12 Thread Alexandre Brault
On 2019-08-12 11:38 p.m., Peng Yu wrote: ``` import requests s = requests.Session() import json s.cookies.set_cookie(requests.utils.cookiejar_from_dict(json.load(sys.stdin))) ``` I used the above command to load cookies from a json file. But I got the following error. Does anybody know how to

How to load cookies from a json input in python-requests?

2019-08-12 Thread Peng Yu
``` import requests s = requests.Session() import json s.cookies.set_cookie(requests.utils.cookiejar_from_dict(json.load(sys.stdin))) ``` I used the above command to load cookies from a json file. But I got the following error. Does anybody know how to fix the error? Thanks. ``` Traceback (most

Re: How to pass username and password in the curl requests using requests python module

2019-05-02 Thread Tobiah
On 5/2/19 4:30 AM, Pradeep Patra wrote: Can anyone pls help in this regard? Something like this?: requests.get('https://api.github.com/user', auth=('user', 'pass')) -- https://mail.python.org/mailman/listinfo/python-list

Re: How to pass username and password in the curl requests using requests python module

2019-05-02 Thread DL Neil
On 2/05/19 11:30 PM, Pradeep Patra wrote: Can anyone pls help in this regard? Yes! | | | | | | | | | | | | | | | | | | | | | | V However, whilst accurate, that answer in NOT helpful? The question is so wide. Which part(s) should we answer? Why

How to pass username and password in the curl requests using requests python module

2019-05-02 Thread Pradeep Patra
Can anyone pls help in this regard? -- https://mail.python.org/mailman/listinfo/python-list

Re: requests

2019-04-04 Thread Rhodri James
learn a little Python" says me. So I figure I can either go the requests route to the sharepoint site and navigate the path to the place where the work items are and then figure out (based on the responses) how to pick the right item and get the data back, or connect to the SP database

requests

2019-04-04 Thread Jack Dangler
figure I can either go the requests route to the sharepoint site and navigate the path to the place where the work items are and then figure out (based on the responses) how to pick the right item and get the data back, or connect to the SP database and work through the schema (assuming I even

Re: mocking for get method in requests

2019-03-26 Thread Toni Sissala
er '' and assigning 'Hello' to its return value's return_value attribute. By default MagicMock instance methods always return a new MagicMock instance, which will create attributes on demand. You are not actually setting the return value of the patched requests, but ra

Re: mocking for get method in requests

2019-03-16 Thread George Fischhof
Shakti Kumar ezt írta (időpont: 2019. jan. 18., P, 18:18): > Hello people, > I noticed something weird (weird as per my current knowledge, though I know > its subjective) today. > > sample.py file > > -- > > import requests > def random_testing(): >

Re: Help, Can't find the default proxy in requests by config

2019-02-21 Thread Evi1 T1me
On Thursday, February 21, 2019 at 7:12:40 AM UTC-5, Evi1 T1me wrote: > ```bash > ~ python3 > Python 3.7.0 (default, Oct 22 2018, 14:54:27) > [Clang 10.0.0 (clang-1000.11.45.2)] on darwin > Type "help", "copyright", "credits" or "license&qu

Help, Can't find the default proxy in requests by config

2019-02-21 Thread Evi1 T1me
```bash ~ python3 Python 3.7.0 (default, Oct 22 2018, 14:54:27) [Clang 10.0.0 (clang-1000.11.45.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> r = requests.get('https://

mocking for get method in requests

2019-01-18 Thread Shakti Kumar
Hello people, I noticed something weird (weird as per my current knowledge, though I know its subjective) today. sample.py file -- import requests def random_testing(): out = requests.get('www.cisco.com') a = out.json() return a testing.py file -- @patch(*’*sample.requ

Re: Python - requests - forms - web scraping - how to deal with multi stage forms

2018-05-17 Thread Grant Edwards
On 2018-05-17, kret...@gmail.com wrote: > https://stackoverflow.com/questions/50383210/python-requests-how-to-post-few-stages-forms Your point? -- Grant Edwards grant.b.edwardsYow! I had pancake makeup at for bru

Re: Python - requests - forms - web scraping - how to deal with multi stage forms

2018-05-17 Thread GMX
https://stackoverflow.com/questions/50383210/python-requests-how-to-post-few-stages-forms   --  https://mail.python.org/mailman/listinfo/python-list  Hi,  Your post will get more traction on the email list if you try to post the actual question on the list against posting a url to an external

Python - requests - forms - web scraping - how to deal with multi stage forms

2018-05-16 Thread kret . ca
https://stackoverflow.com/questions/50383210/python-requests-how-to-post-few-stages-forms -- https://mail.python.org/mailman/listinfo/python-list

Re: How to benchmark a HTTP connection with requests module?

2018-02-16 Thread Etienne Robillard
Hi Dennis, Here's my code so far: import os import requests import threading import time from Queue import Queue from test_support import unittest test_queue = Queue() def worker(ident, url, queue):     while True:     start = time.clock()     r = requests.get(url)   

Re: How to benchmark a HTTP connection with requests module?

2018-02-16 Thread Etienne Robillard
Hi Dennis, Nice pseudo code! :-) Is it possible benchmark/measure the latency of a HTTP connection for each threads by timing the duration of the requests.get method to complete? I also plan to test with gevent.monkey extension for enabling cooperative multithreading support: from gevent i

How to benchmark a HTTP connection with requests module?

2018-02-15 Thread Etienne Robillard
Hi, Is it possible to emulate a range of concurrent connections to a http server with the requests module? import os import requests from test_support import unittest class HTTPBenchmarkTestCase(unittest.TestCase):     url = 'http://localhost/benchmark/'     def setUp(self):   

Re: [Python-Dev] How to set/update value in a xml file using requests in python

2018-02-12 Thread Sum J
local network: > > > > http://192.168.43.109/DevMgmt/NetAppsDyn.xml > > > > Below is a part content of above xml I want to update : > > > > > > > > > > > > > > off > > > > > > > > > > I want to se

Re: [Python-Dev] How to set/update value in a xml file using requests in python

2018-02-08 Thread Dan Stromberg
to update : > > > > > > > off > > > > > I want to set the value for 'ResourceUI' and 'Port' field in above xml. > > I have used below code : > > import requests > data = { > 'R

Re: How to set/update value in a xml file using requests in python

2018-02-06 Thread dieter
Sum J writes: > My xml file is located in local network : > http://192.168.43.109/DevMgmt/NetAppsDyn.xml > > Below is a part content of above xml I want to update : > > > > > off > > > I want to set value for 'ResourceUI' and 'Port' field in above xml. > I have used below

How to set/update value in a xml file using requests in python

2018-02-06 Thread Sum J
My xml file is located in local network : http://192.168.43.109/DevMgmt/NetAppsDyn.xml Below is a part content of above xml I want to update : off I want to set value for 'ResourceUI' and 'Port' field in above xml. I have used below code : data = { 'R

Re: Trace back error just trying to run a simple import of requests

2018-02-02 Thread Chris Angelico
> python to diagnose and just typed in the first line - import >>>> requests. I received screenfulls of errors. Why? What could have >>>> happened when nothing changed on my end? The traceback is copied >>>> below. >>>> >>>>

Re: Trace back error just trying to run a simple import of requests

2018-02-02 Thread Grant Edwards
On 2018-02-01, MRAB wrote: > On 2018-02-01 22:32, Grant Edwards wrote: >> On 2018-02-01, William Sewell wrote: >> >>> My python script which I run daily just blew up. So, I went into >>> python to diagnose and just typed in the first line - import >>

Re: Trace back error just trying to run a simple import of requests

2018-02-01 Thread Cameron Simpson
xpert in how Python works on Windows; I gather it is rather different an experience from my usual UNIX environment. I would guess that the requests module is not installed in a place in your normal Python's sys.path, but because the current directory is normally a part of that, navigat

RE: Trace back error just trying to run a simple import of requests

2018-02-01 Thread William Sewell
u.edu -Original Message- From: Cameron Simpson [mailto:c...@cskk.id.au] Sent: Thursday, February 01, 2018 8:08 PM To: William Sewell Cc: python-list@python.org Subject: Re: Trace back error just trying to run a simple import of requests On 01Feb2018 20:26, William Sewell wrote: >M

Re: Trace back error just trying to run a simple import of requests

2018-02-01 Thread Cameron Simpson
On 01Feb2018 20:26, William Sewell wrote: My python script which I run daily just blew up. So, I went into python to diagnose and just typed in the first line - import requests. I received screenfulls of errors. Why? What could have happened when nothing changed on my end? The traceback

Re: Trace back error just trying to run a simple import of requests

2018-02-01 Thread MRAB
On 2018-02-01 22:32, Grant Edwards wrote: On 2018-02-01, William Sewell wrote: My python script which I run daily just blew up. So, I went into python to diagnose and just typed in the first line - import requests. I received screenfulls of errors. Why? What could have happened when

Re: Trace back error just trying to run a simple import of requests

2018-02-01 Thread Steven D'Aprano
On Thu, 01 Feb 2018 20:26:20 +, William Sewell wrote: > My python script which I run daily just blew up. So, I went into python > to diagnose and just typed in the first line - import requests. I > received screenfulls of errors. Why? What could have happened when > nothing c

Re: Trace back error just trying to run a simple import of requests

2018-02-01 Thread Grant Edwards
On 2018-02-01, William Sewell wrote: > My python script which I run daily just blew up. So, I went into > python to diagnose and just typed in the first line - import > requests. I received screenfulls of errors. Why? What could have > happened when nothing changed on my end? T

RE: Trace back error just trying to run a simple import of requests

2018-02-01 Thread William Sewell
My python script which I run daily just blew up. So, I went into python to diagnose and just typed in the first line - import requests. I received screenfulls of errors. Why? What could have happened when nothing changed on my end? The traceback is copied below. [cid:image001.png

Re: requests / SSL blocks forever?

2018-01-16 Thread Nagy László Zsolt
>> Or maybe I misunderstood the docs and the timeout means the max. time >> elapsed between receiving two chunks of data from the server? > Yes. It's documented better here: > http://docs.python-requests.org/en/master/user/advanced/#timeouts > > You can't specify a "total time" within which the op

Re: requests / SSL blocks forever?

2018-01-15 Thread Jon Ribbens
On 2018-01-15, Nagy László Zsolt wrote: >> In other words: if the server starts to send the response, but then >> stops sending it (without closing the connection), then this will block >> forever anyway. > Or maybe I misunderstood the docs and the timeout means the max. time > elapsed between rec

Re: requests / SSL blocks forever?

2018-01-15 Thread Nagy László Zsolt
> In other words: if the server starts to send the response, but then > stops sending it (without closing the connection), then this will block > forever anyway. Or maybe I misunderstood the docs and the timeout means the max. time elapsed between receiving two chunks of data from the server? --

Re: requests / SSL blocks forever?

2018-01-15 Thread Nagy László Zsolt
> (a) are you setting daemon=True on the thread? > (b) are you setting a timeout on the requests call? Hmm setting the timeout might not be the solution. This is from the docs of the requests module: > > Note > > |timeout| is not a time limit on the entire response down

Re: requests / SSL blocks forever?

2018-01-15 Thread Nagy László Zsolt
narrowed down the problem to request and >> _lib.SSL_read. > (a) are you setting daemon=True on the thread? > (b) are you setting a timeout on the requests call? The thread is not daemonic, but it can be stopped (usually) within a second by setting a threading.Event. I'm not set

Re: requests / SSL blocks forever?

2018-01-13 Thread Jon Ribbens
ou setting daemon=True on the thread? (b) are you setting a timeout on the requests call? -- https://mail.python.org/mailman/listinfo/python-list

Re: requests / SSL blocks forever?

2018-01-13 Thread Thomas Jollans
> File: "C:\Python36-32\lib\site-packages\requests\api.py", line 112, in post Unfortunately, this traceback doesn't contain any of your own code, so we can't really tell what you're trying to do, or whether this call *should* be terminating. > [snip] > > File

requests / SSL blocks forever?

2018-01-13 Thread Nagy László Zsolt
e.com/recipes/577334-how-to-debug-deadlocked-multi-threaded-programs/ So even thould I cannot stop the service (only kill it from task manager), I can tell that this is the rebellious thread: File: "C:\Python36-32\lib\site-packages\requests\api.py", line 112, in post   return request(&#

Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, Chris Angelico wrote: > On Sat, Aug 26, 2017 at 6:16 AM, Jon Ribbens > wrote: >> I said it in the majority of the posts I've made in this thread. >> I said it in the post you were responding to just now. I'm using >> threads. Now I've said it again. > > You said WHY you are using

Re: requests.{get,post} timeout

2017-08-25 Thread Chris Angelico
On Sat, Aug 26, 2017 at 6:16 AM, Jon Ribbens wrote: > On 2017-08-25, Chris Angelico wrote: >> On Sat, Aug 26, 2017 at 5:40 AM, Jon Ribbens >> wrote: >>> On 2017-08-25, Chris Angelico wrote: On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens wrote: > On 2017-08-25, Chris Angelico wro

Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, Chris Angelico wrote: > On Sat, Aug 26, 2017 at 5:40 AM, Jon Ribbens > wrote: >> On 2017-08-25, Chris Angelico wrote: >>> On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens >>> wrote: On 2017-08-25, Chris Angelico wrote: > That looks like an exception to me. Not a "process

Re: requests.{get,post} timeout

2017-08-25 Thread Chris Angelico
On Sat, Aug 26, 2017 at 5:40 AM, Jon Ribbens wrote: > On 2017-08-25, Chris Angelico wrote: >> On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens >> wrote: >>> On 2017-08-25, Chris Angelico wrote: That looks like an exception to me. Not a "process is now terminated". That's what happened wh

Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, Chris Angelico wrote: > On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens > wrote: >> On 2017-08-25, Chris Angelico wrote: >>> That looks like an exception to me. Not a "process is now terminated". >>> That's what happened when I pressed Ctrl-C (the IP address was >>> deliberately pic

Re: requests.{get,post} timeout

2017-08-25 Thread Chris Angelico
On Sat, Aug 26, 2017 at 1:47 AM, Jon Ribbens wrote: > On 2017-08-25, Chris Angelico wrote: >> That looks like an exception to me. Not a "process is now terminated". >> That's what happened when I pressed Ctrl-C (the IP address was >> deliberately picked as one that doesn't currently exist on my n

Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, dieter wrote: > This may no longer work. Long ago, I have often been plagued > by such EINTR exceptions, and I have wished heavily that in those > cases the IO operation should be automatically resumed. In recent time, > I have no longer seen such exceptions - and I concluded that m

Re: requests.{get,post} timeout

2017-08-25 Thread Jon Ribbens
On 2017-08-25, Chris Angelico wrote: > That looks like an exception to me. Not a "process is now terminated". > That's what happened when I pressed Ctrl-C (the IP address was > deliberately picked as one that doesn't currently exist on my network, > so it took time). Ok yes, so ctrl-C is sending

Re: requests.{get,post} timeout

2017-08-25 Thread dieter
Chris Angelico writes: > ... > That looks like an exception to me. Not a "process is now terminated". > That's what happened when I pressed Ctrl-C (the IP address was > deliberately picked as one that doesn't currently exist on my network, > so it took time). What Jon argues about: signals are de

Re: requests.{get,post} timeout

2017-08-24 Thread dieter
you can't get >>> access to it, and as you mentioned even if you were to do so the >>> effect it would have on requests is completely undefined. >> >> In a single-threaded program, just hit Ctrl-C. > > By that, do you mean "kill the process"? That&

Re: requests.{get,post} timeout

2017-08-24 Thread Chris Angelico
aised. Give it a try. > > Give what a try? Pressing ctrl-c? That'll kill the process. > Obviously we all agree that killing the entire process will > terminate the request and all resources associated with it. >>> import requests >>> requests.get("http://1

Re: requests.{get,post} timeout

2017-08-24 Thread Jon Ribbens
help? As far as I'm >>>> aware, you can't close the socket without help since you can't get >>>> access to it, and as you mentioned even if you were to do so the >>>> effect it would have on requests is completely undefined. >>> >>>

Re: requests.{get,post} timeout

2017-08-24 Thread breamoreboy
On Thursday, August 24, 2017 at 5:02:12 PM UTC+1, Chris Angelico wrote: > > (Caveat: I have no idea how this works on Windows. I do expect, > though, that it will abort the connection without terminating the > process, just like it does on Unix.) > > ChrisA There was a big thread "cross platform

Re: requests.{get,post} timeout

2017-08-24 Thread Chris Angelico
On Fri, Aug 25, 2017 at 5:07 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Fri, Aug 25, 2017 at 3:40 AM, Marko Rauhamaa wrote: >>> Signals are an arcane Unix communication method. I strongly recommend >>> against using signals for anything but terminating a process, and even >>> then you h

Re: requests.{get,post} timeout

2017-08-24 Thread Marko Rauhamaa
Chris Angelico : > On Fri, Aug 25, 2017 at 3:40 AM, Marko Rauhamaa wrote: >> Signals are an arcane Unix communication method. I strongly recommend >> against using signals for anything but terminating a process, and even >> then you have to be extra careful. >> >> I have seen code that uses signa

Re: requests.{get,post} timeout

2017-08-24 Thread Chris Angelico
e command (maybe you didn't expect it to be multi-line?), and the current input is cancelled. Easy. No termination needed. And no race condition. I don't know why you'd get those, but they're not hard to eliminate. >>>>> Basically the only way to use requests sa

Re: requests.{get,post} timeout

2017-08-24 Thread Marko Rauhamaa
recommend against using signals for anything but terminating a process, and even then you have to be extra careful. I have seen code that uses signals for runtime communication, but none of it was free from race conditions. >>>> Basically the only way to use requests safely is to fork

Re: requests.{get,post} timeout

2017-08-24 Thread Chris Angelico
the socket without help since you can't get >>> access to it, and as you mentioned even if you were to do so the >>> effect it would have on requests is completely undefined. >> >> In a single-threaded program, just hit Ctrl-C. > > By that, do you mean "

Re: requests.{get,post} timeout

2017-08-24 Thread Jon Ribbens
as you mentioned even if you were to do so the >> effect it would have on requests is completely undefined. > > In a single-threaded program, just hit Ctrl-C. By that, do you mean "kill the process"? That's obviously not a sensible answer in general, especially given

Re: requests.{get,post} timeout

2017-08-24 Thread Chris Angelico
On Thu, Aug 24, 2017 at 9:43 PM, Jon Ribbens wrote: > On 2017-08-23, Chris Angelico wrote: >> On Thu, Aug 24, 2017 at 8:54 AM, Jon Ribbens >> wrote: >>> On 2017-08-23, Chris Angelico wrote: >>>> Yes and no. If requests provided a 'cancel query

Re: requests.{get,post} timeout

2017-08-24 Thread Jon Ribbens
On 2017-08-23, Chris Angelico wrote: > On Thu, Aug 24, 2017 at 8:54 AM, Jon Ribbens > wrote: >> On 2017-08-23, Chris Angelico wrote: >>> Yes and no. If requests provided a 'cancel query' feature, it would >>> play nicely with everything else, but (a)

Re: requests.{get,post} timeout

2017-08-23 Thread Chris Angelico
On Thu, Aug 24, 2017 at 8:54 AM, Jon Ribbens wrote: > On 2017-08-23, Chris Angelico wrote: >> Yes and no. If requests provided a 'cancel query' feature, it would >> play nicely with everything else, but (a) the entire concept here is >> that the request has stalle

Re: requests.{get,post} timeout

2017-08-23 Thread Jon Ribbens
On 2017-08-23, Chris Angelico wrote: > Yes and no. If requests provided a 'cancel query' feature, it would > play nicely with everything else, but (a) the entire concept here is > that the request has stalled, so you COULD just ignore the pending > query and pretend it

Re: requests.{get,post} timeout

2017-08-23 Thread Marko Rauhamaa
Chris Angelico : > What I said was that you don't need threading or alarms because most > of the time you can let the user use SIGINT. And without the (utterly > totally useless) threading that you have here, it works flawlessly: > Ctrl-C instantly breaks the recv call. Oh, if you give up threadi

Re: requests.{get,post} timeout

2017-08-23 Thread Chris Angelico
On Thu, Aug 24, 2017 at 2:59 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> But also, this honestly isn't as big an issue as you might think. If >> the user thinks a program has been running for too long, s/he can hit >> Ctrl-C. Voila! Signal is sent, which aborts a socket read, > > Well, no, i

Re: requests.{get,post} timeout

2017-08-23 Thread Marko Rauhamaa
Chris Angelico : > But also, this honestly isn't as big an issue as you might think. If > the user thinks a program has been running for too long, s/he can hit > Ctrl-C. Voila! Signal is sent, which aborts a socket read, Well, no, it doesn't. First run: ==

Re: requests.{get,post} timeout

2017-08-23 Thread Chris Angelico
On Thu, Aug 24, 2017 at 12:52 AM, Jon Ribbens wrote: > OK cool, so circling back to where you were - which is the same place > that the 'requests' developers are - which is the claim that requests > does not need to provide an "overall timeout" feature because

Re: requests.{get,post} timeout

2017-08-23 Thread Jon Ribbens
f "cut off", and > how it needs to interact with other things. I'm not sure about the > requests module specifically, but one very effective method of > terminating a network query is to close the socket (since resources > are owned by processes, not threads, any thread can

Re: requests.{get,post} timeout

2017-08-23 Thread Marko Rauhamaa
Jon Ribbens : > Yes, what I was interested to learn was how the monitoring thread can > "cut off" the requesting thread. In general, that cannot be done. Often, you resort to a dirty trick whereby the monitoring thread closes the I/O object requesting thread is waiting on, triggering an immediate

Re: requests.{get,post} timeout

2017-08-23 Thread Chris Angelico
On Wed, Aug 23, 2017 at 10:52 PM, Jon Ribbens wrote: > On 2017-08-23, Chris Angelico wrote: >> On Wed, Aug 23, 2017 at 9:10 PM, Jon Ribbens >> wrote: >>> I am interested to learn what you mean by "with a thread". How would >>> one execute a requ

Re: requests.{get,post} timeout

2017-08-23 Thread Jon Ribbens
On 2017-08-23, Chris Angelico wrote: > On Wed, Aug 23, 2017 at 9:10 PM, Jon Ribbens > wrote: >> I am interested to learn what you mean by "with a thread". How would >> one execute a requests, er, request in a thread with a proper timeout? > > Assuming that b

Re: requests.{get,post} timeout

2017-08-23 Thread Chris Angelico
both types of timeout. >> >> You could provide both, but since one of them can be handled >> externally (with a thread, with a SIGALRM, or with some other sort of >> time limiting), the other one MUST be provided by the request. > > I am interested to learn what you

Re: requests.{get,post} timeout

2017-08-23 Thread Jon Ribbens
e of them can be handled > externally (with a thread, with a SIGALRM, or with some other sort of > time limiting), the other one MUST be provided by the request. I am interested to learn what you mean by "with a thread". How would one execute a requests, er, request in a thread with a pro

Re: requests.{get,post} timeout

2017-08-23 Thread dieter
Skip Montanaro writes: > ... > Given the semantics of timeouts which percolate up from the socket > level, I agree with Chris. It has a particular meaning, that > implemented by the underlying socket layer. Unfortunately, the word > "timeout" can take on related (but different) meanings, depending

Re: requests.{get,post} timeout

2017-08-22 Thread Skip Montanaro
> You could provide both, but since one of them can be handled > externally (with a thread, with a SIGALRM, or with some other sort of > time limiting), the other one MUST be provided by the request. Given the semantics of timeouts which percolate up from the socket level, I agree with Chris. It h

Re: requests.{get,post} timeout

2017-08-22 Thread Chris Angelico
On Wed, Aug 23, 2017 at 5:06 AM, Jon Ribbens wrote: >> You can always add in the overall timeout separately. If the low-level >> timeout were implemented that way, there would be no way to externally >> add the other form of timeout. Therefore the only sane way to >> implement the request timeout

Re: requests.{get,post} timeout

2017-08-22 Thread Chris Angelico
2:58 AM, Jon Ribbens >>>> wrote: >>>>> >>>>> Yes. There is no timeout feature that can be used to limit the total >>>>> time a 'requests' request takes. Some people might think that this is >>>>> a serious flaw in the r

Re: requests.{get,post} timeout

2017-08-22 Thread Jon Ribbens
On 2017-08-22, Chris Angelico wrote: > The low-level timeout will distinguish between those. If you want a > high-level timeout across the entire job, you can do that too, but > then you have to figure out exactly how long is "too long". Let's say > you set a thirty-second timeout. Great! Now some

Re: requests.{get,post} timeout

2017-08-22 Thread MRAB
On 2017-08-22 19:43, Chris Angelico wrote: On Wed, Aug 23, 2017 at 4:14 AM, Jon Ribbens wrote: On 2017-08-22, Chris Angelico wrote: On Wed, Aug 23, 2017 at 2:58 AM, Jon Ribbens wrote: Yes. There is no timeout feature that can be used to limit the total time a 'requests' request t

Re: requests.{get,post} timeout

2017-08-22 Thread Chris Angelico
On Wed, Aug 23, 2017 at 4:31 AM, Grant Edwards wrote: > On 2017-08-22, Chris Angelico wrote: > >> """ >> Once your client has connected to the server and sent the HTTP >> request, the read timeout is the number of seconds the client will >> wait for the server to send a response. (Specifically, i

Re: requests.{get,post} timeout

2017-08-22 Thread Chris Angelico
On Wed, Aug 23, 2017 at 4:14 AM, Jon Ribbens wrote: > On 2017-08-22, Chris Angelico wrote: >> On Wed, Aug 23, 2017 at 2:58 AM, Jon Ribbens >> wrote: >>> Yes. There is no timeout feature that can be used to limit the total >>> time a 'requests' reque

  1   2   3   4   >