Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #24639

Re: PySerial could not open port COM4: [Error 5] Access is denied- please help

Path csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From "Adam" <adam@no_thanks.com>
Newsgroups comp.lang.python
Subject Re: PySerial could not open port COM4: [Error 5] Access is denied- please help
Date Thu, 28 Jun 2012 14:48:08 -0700
Organization A noiseless patient Spider
Lines 44
Message-ID <jsijer$ick$1@dont-email.me> (permalink)
References <jse17v$d5n$1@dont-email.me><jse604$1cq$1@dont-email.me> <jseim6$tn7$1@dont-email.me><jseu9c$sp3$1@dont-email.me> <jsf8nf$13d$1@dont-email.me><jsfatv$djt$1@dont-email.me> <jsfgkr$kf7$1@dont-email.me><jsfhv2$ta9$1@dont-email.me> <jsfr3i$p6d$1@dont-email.me><jsftah$bb5$1@reader1.panix.com> <jsfv3v$imr$1@dont-email.me><jsg05u$mgk$1@reader1.panix.com> <jsg0sj$4t9$1@reader1.panix.com><ra2nu7h75720i75ijhabg12dngrab756e8@4ax.com> <mailman.1618.1340910525.4697.python-list@python.org>
Injection-Date Thu, 28 Jun 2012 21:48:11 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="Bh0M18YIbCo+pO+cFqDnkw"; logging-data="18836"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+j83Ze/QzE13Bo0ys/jADN"
X-MimeOLE Produced By Microsoft MimeOLE V6.00.2900.6157
X-RFC2646 Format=Flowed; Response
X-Newsreader Microsoft Outlook Express 6.00.2900.5931
Cancel-Lock sha1:6j/DeS/d3zpX14b7KMRR1AyD5zw=
X-Priority 3
X-MSMail-Priority Normal
Xref csiph.com comp.lang.python:24639

Show key headers only | View raw


"Roel Schroeven" <roel@roelschroeven.net> wrote in message 
news:mailman.1618.1340910525.4697.python-list@python.org...
> Temia Eszteri schreef:
>> Actually, I believe someone in an earlier thread in the newsgroup or
>> elsewhere pointed out that serial ports automatically open under
>> Windows. I'd have to look it back up when I have the time, which I
>> don't have at the moment, unfortunately.
>
> That doesn't have anything to do with Windows, but with how pySerial 
> works. See the documentation for __init__():
>
> "The port is immediately opened on object creation, when a port is given. 
> It is not opened when port is None and a successive call to open() will be 
> needed."
>
> So if your script does something like
>
> prt = serial.Serial('COM4')
>
> then pySerial automatically opens the port, and you shouldn't call 
> prt.open() anymore.
>
> If, on the contrary, you do something like
>
> prt = serial.Serial()
> prt.port = 'COM4'
>
> then pySerial doesn't open the port, and you have to call prt.open() to do 
> it.
>
> PySerial has this same behavior on both Windows and Linux. The difference 
> might be that on Linux it is possible to open serial ports more than once, 
> while that doesn't work on Windows.
>
> Best regards,
> Roel
>


Thanks for the info.  Your explanation helps a lot.


Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-26 21:12 -0700
  Re: PySerial could not open port COM4: [Error 5] Access is denied - please help John Nagle <nagle@animats.com> - 2012-06-26 22:33 -0700
    Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 02:10 -0700
      Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Paul <nospam@needed.com> - 2012-06-27 08:28 -0400
        Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 08:26 -0700
          Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Paul <nospam@needed.com> - 2012-06-27 12:04 -0400
            Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 10:41 -0700
              Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Paul <nospam@needed.com> - 2012-06-27 14:04 -0400
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 13:40 -0700
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 21:18 +0000
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 14:48 -0700
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 22:06 +0000
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 22:18 +0000
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Temia Eszteri <lamialily@cleverpun.com> - 2012-06-27 15:31 -0700
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 15:51 -0700
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 23:24 +0000
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-27 17:14 -0700
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-28 14:15 +0000
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "Adam" <adam@no_thanks.com> - 2012-06-28 13:31 -0700
                Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Roel Schroeven <roel@roelschroeven.net> - 2012-06-28 21:08 +0200
                Re: PySerial could not open port COM4: [Error 5] Access is denied- please help "Adam" <adam@no_thanks.com> - 2012-06-28 14:48 -0700
      Re: PySerial could not open port COM4: [Error 5] Access is denied - please help "David H. Lipman" <DLipman~nospam~@Verizon.Net> - 2012-06-27 08:28 -0400
        Re: PySerial could not open port COM4: [Error 5] Access is denied - please help Grant Edwards <invalid@invalid.invalid> - 2012-06-27 14:53 +0000

csiph-web