Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #101435 > unrolled thread
| Started by | kbtyo <ahlusar.ahluwalia@gmail.com> |
|---|---|
| First post | 2016-01-10 07:04 -0800 |
| Last post | 2016-01-12 12:18 +1100 |
| Articles | 7 — 3 participants |
Back to article view | Back to comp.lang.python
Understanding " 'xml.etree.ElementTree.Element' does not support the buffer interface" kbtyo <ahlusar.ahluwalia@gmail.com> - 2016-01-10 07:04 -0800
Re: Understanding " 'xml.etree.ElementTree.Element' does not support the buffer interface" Steven D'Aprano <steve@pearwood.info> - 2016-01-11 02:19 +1100
Re: Understanding " 'xml.etree.ElementTree.Element' does not support the buffer interface" Saran Ahluwalia <ahlusar.ahluwalia@gmail.com> - 2016-01-10 10:46 -0500
Re: Understanding " 'xml.etree.ElementTree.Element' does not support the buffer interface" Steven D'Aprano <steve@pearwood.info> - 2016-01-11 04:27 +1100
Re: Understanding " 'xml.etree.ElementTree.Element' does not support the buffer interface" Saran Ahluwalia <ahlusar.ahluwalia@gmail.com> - 2016-01-10 12:53 -0500
Re: Understanding " 'xml.etree.ElementTree.Element' does not support the buffer interface" Saran Ahluwalia <ahlusar.ahluwalia@gmail.com> - 2016-01-11 16:54 -0500
Re: Understanding " 'xml.etree.ElementTree.Element' does not support the buffer interface" Steven D'Aprano <steve@pearwood.info> - 2016-01-12 12:18 +1100
| From | kbtyo <ahlusar.ahluwalia@gmail.com> |
|---|---|
| Date | 2016-01-10 07:04 -0800 |
| Subject | Understanding " 'xml.etree.ElementTree.Element' does not support the buffer interface" |
| Message-ID | <876e5e0c-42c4-416a-90c0-ac2641e81949@googlegroups.com> |
Hello Everyone:
I am curious to know why I receive the aforementioned message. I am using Python 3.4.3 and Windows 7. I am running the following script from Windows Powershell:
Response = 's.csv'
with open(Response, 'rU', encoding='utf-8') as data:
separated = data.read().split('","')
x = ElementTree.XML(separated[3])
y = ElementTree.XML(separated[4])
print(dict(flatten_dict(x)))
print(dict(flatten_dict(y)))
I am importing ElementTree as follows:
import xml.etree.cElementTree as ElementTree
from xml.etree.ElementTree import XMLParser
The input data is as follows:
A,B,C,D,E,F,G,H,I,J
"3","8","1","<Request TransactionID="3" RequestType="FOO"><InstitutionISO /><CallID>23</CallID><MemberID>12</MemberID><MemberPassword /><RequestData><AccountNumber>2</AccountNumber><AccountSuffix>85</AccountSuffix><AccountType>S</AccountType><MPIAcctType>Checking</MPIAcctType><TransactionCount>10</TransactionCount></RequestData></Request>","<Response TransactionID="2" RequestType="HoldInquiry"><PulledLoans>True</PulledLoans><PulledClosedLoans>False</PulledClosedLoans><PulledInvestments>False</PulledInvestments><PulledClosedInvestments>False</PulledClosedInvestments><PulledCards>False</PulledCards><ShareList>0000',0001,0070,</ShareList></Response>","1967-12-25 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"
Oddly, when I run the same script via WinPython' Jupyter Notebook, it works perfectly. The input string is an XML string and I am only interested in the 4th and 5th columns, (using zero based indexing).
Thank you, in advance for your feedback and support.
[toc] | [next] | [standalone]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2016-01-11 02:19 +1100 |
| Message-ID | <56927670$0$1616$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #101435 |
On Mon, 11 Jan 2016 02:04 am, kbtyo wrote:
> Hello Everyone:
>
> I am curious to know why I receive the aforementioned message.
It is impossible to be sure from the information you have given us, since we
do not know which line of code caused the error.
Please copy and paste the ENTIRE traceback, starting from the line:
Traceback (most recent call last)
to the end of the error message. This will (hopefully) show us which line of
your code caused the error.
--
Steven
[toc] | [prev] | [next] | [standalone]
| From | Saran Ahluwalia <ahlusar.ahluwalia@gmail.com> |
|---|---|
| Date | 2016-01-10 10:46 -0500 |
| Message-ID | <mailman.4.1452440826.3151.python-list@python.org> |
| In reply to | #101436 |
Hi Steven: That is the only message (*xml.etree.ElementTree.Element' does not support the buffer interface"*). There is no traceback. My apologies for not clarifying previously. On Sun, Jan 10, 2016 at 10:19 AM, Steven D'Aprano <steve@pearwood.info> wrote: > On Mon, 11 Jan 2016 02:04 am, kbtyo wrote: > > > Hello Everyone: > > > > I am curious to know why I receive the aforementioned message. > > > It is impossible to be sure from the information you have given us, since > we > do not know which line of code caused the error. > > Please copy and paste the ENTIRE traceback, starting from the line: > > Traceback (most recent call last) > > to the end of the error message. This will (hopefully) show us which line > of > your code caused the error. > > > > -- > Steven > > -- > https://mail.python.org/mailman/listinfo/python-list >
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2016-01-11 04:27 +1100 |
| Message-ID | <56929498$0$1622$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #101435 |
On Mon, 11 Jan 2016 02:04 am, kbtyo wrote:
> Hello Everyone:
>
> I am curious to know why I receive the aforementioned message. I am using
> Python 3.4.3 and Windows 7. I am running the following script from Windows
> Powershell:
I created a file "data" containing the input data you said:
> The input data is as follows:
>
> A,B,C,D,E,F,G,H,I,J
> "3","8","1","<Request TransactionID="3" RequestType="FOO"><InstitutionISO
> /><CallID>23</CallID><MemberID>12</MemberID><MemberPassword
> /><RequestData><AccountNumber>2</AccountNumber><AccountSuffix>85</AccountSuffix><AccountType>S</AccountType><MPIAcctType>Checking</MPIAcctType><TransactionCount>10</TransactionCount></RequestData></Request>","<Response
> TransactionID="2"
>
RequestType="HoldInquiry"><PulledLoans>True</PulledLoans><PulledClosedLoans>False</PulledClosedLoans><PulledInvestments>False</PulledInvestments><PulledClosedInvestments>False</PulledClosedInvestments><PulledCards>False</PulledCards><ShareList>0000',0001,0070,</ShareList></Response>","1967-12-25
> 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"
and then a script containing the code you said you used:
> import xml.etree.cElementTree as ElementTree
> from xml.etree.ElementTree import XMLParser
> Response = 's.csv'
> with open(Response, 'rU', encoding='utf-8') as data:
> separated = data.read().split('","')
> x = ElementTree.XML(separated[3])
> y = ElementTree.XML(separated[4])
> print(dict(flatten_dict(x)))
> print(dict(flatten_dict(y)))
I get a completely different error to you, complete with traceback as
expected:
Traceback (most recent call last):
File "/tmp/testxml.py", line 9, in <module>
print(dict(flatten_dict(x)))
NameError: name 'flatten_dict' is not defined
This shows me three things:
(1) The calls to ElementTree.XML work fine, and don't raise an exception;
(2) There is no error message referring to xml.etree.ElementTree.Element or
the buffer interface;
(3) The code you posted is clearly not the code you actually ran. At the
very least, it is not *all* the code you ran.
We cannot tell what it wrong with your code if you don't show us the code
that fails. I suggest you read this webpage:
http://www.sscce.org/
and follow the advice given. It's written for Java, but applies to any
programming language. Hopefully you will either solve your problem, or be
able to generate a sufficiently small piece of code that we can work with.
You also suggest that your code works when running in a Jupyter Notebook. It
is unlikely (but not impossible!) that exactly the same code will run
differently when run as a script and when run under Jupyter. More likely,
there is some difference between the code, something you have written in
the Notebook but not included in the script.
If it is exactly the same code, then perhaps it is a difference in the two
environments. Does Jupyter set up the environment differently to what you
get when running a script?
Finally, in another post, you state:
"That is the only message (*xml.etree.ElementTree.Element' does not support
the buffer interface"*). There is no traceback."
That is very unlikely with the code sample you posted. If true, that gives
more evidence that you are running code which is different from what you
have posted here. Perhaps your ACTUAL code (not the pretend code you showed
us) includes a try...except block like this:
try:
some code goes here
except Exception as err:
print(err)
sys.exit()
or similar. If so, TAKE IT OUT. That is destroying useful debugging
information and making it more difficult to solve your problem.
--
Steven
[toc] | [prev] | [next] | [standalone]
| From | Saran Ahluwalia <ahlusar.ahluwalia@gmail.com> |
|---|---|
| Date | 2016-01-10 12:53 -0500 |
| Message-ID | <mailman.6.1452448435.3151.python-list@python.org> |
| In reply to | #101439 |
Hi Steven:
The previous code was a stand along under the " if __name__ == '__main__':
". The full function suite that I have made (and indeed includes a try and
except block):
import os.path
import sys
import csv
from io import StringIO
import xml.etree.cElementTree as ElementTree
from xml.etree.ElementTree import XMLParser
# import xml
# import xml.sax
# from xml.sax import ContentHandler
def flatten_list(self, aList, prefix=''):
for i, element in enumerate(aList, 1):
eprefix = "{}{}".format(prefix, i)
if element:
# treat like dict
if len(element) == 1 or element[0].tag != element[1].tag:
yield from flatten_dict(element, eprefix)
# treat like list
elif element[0].tag == element[1].tag:
yield from flatten_list(element, eprefix)
elif element.text:
text = element.text.strip()
if text:
yield eprefix[:].rstrip('.'), element.text
def flatten_dict(parent_element, prefix=''):
prefix = prefix + parent_element.tag
if parent_element.items():
for k, v in parent_element.items():
yield prefix + k, v
for element in parent_element:
eprefix = element.tag
if element:
# treat like dict - we assume that if the first two tags
# in a series are different, then they are all different.
if len(element) == 1 or element[0].tag != element[1].tag:
yield from flatten_dict(element, prefix=prefix)
# treat like list - we assume that if the first two tags
# in a series are the same, then the rest are the same.
else:
# here, we put the list in dictionary; the key is the
# tag name the list elements all share in common, and
# the value is the list itself
yield from flatten_list(element, prefix=eprefix)
# if the tag has attributes, add those to the dict
if element.items():
for k, v in element.items():
yield eprefix+k
# this assumes that if you've got an attribute in a tag,
# you won't be having any text. This may or may not be a
# good idea -- time will tell. It works for the way we are
# currently doing XML configuration files...
elif element.items():
for k, v in element.items():
yield eprefix+k
# finally, if there are no child tags and no attributes, extract
# the text
else:
yield eprefix, element.text
def just_xml_data(path):
with open(path, 'rU', encoding='UTF-8') as data:
separated = data.read().split('","')
print(separated)
try:
x = ElementTree.XML(separated[3])
print(x)
xml.etree.ElementTree.dump(x)
y = ElementTree.XML(separated[4])
xml.etree.ElementTree.dump(y)
# response = ElementTree.XML(separated[4]) # work on the
Response column
# root = ElementTree.XML(response) #serialize and parse into
XML object
except Exception as e:
print(e)
else:
xml_field = dict(flatten_dict(y))
return xml_field
def read_data(path):
headers= set()
rows = []
with open(path, 'rU', encoding='utf-8') as data:
reader = csv.DictReader(data, dialect=csv.excel,
skipinitialspace=True)
for row in reader:
xml_field = row["CLIENT_RESP_DATA"]
# xml_data = just_xml_data(xml_field) ## function
if xml_data is not None:
row.update(xml_data)
headers.update(row.keys())
rows.append(row)
else:
print("Failure")
pass
with open(os.path.splitext(textFile)[0] + '_' + 'parsed' + '.csv',
"wt", newline='') as output_file:
wr = csv.writer(output_file)
csv_headers = list(headers)
wr.writerow(csv_headers)
for row in rows:
values = []
for field in csv_headers:
value = row.get(field, None)
values.append(value)
wr.writerow(values)
return output_file
if __name__ == '__main__':
Response = "s.csv"
just_xml_data(Response)
Hopefully this will provide you with enough information to emulate
(apologies for any and all indentation errors during the copy and paste).
FYI - I still receive the same error.
On Sun, Jan 10, 2016 at 12:27 PM, Steven D'Aprano <steve@pearwood.info>
wrote:
> On Mon, 11 Jan 2016 02:04 am, kbtyo wrote:
>
> > Hello Everyone:
> >
> > I am curious to know why I receive the aforementioned message. I am using
> > Python 3.4.3 and Windows 7. I am running the following script from
> Windows
> > Powershell:
>
> I created a file "data" containing the input data you said:
>
> > The input data is as follows:
> >
> > A,B,C,D,E,F,G,H,I,J
> > "3","8","1","<Request TransactionID="3" RequestType="FOO"><InstitutionISO
> > /><CallID>23</CallID><MemberID>12</MemberID><MemberPassword
> >
> /><RequestData><AccountNumber>2</AccountNumber><AccountSuffix>85</AccountSuffix><AccountType>S</AccountType><MPIAcctType>Checking</MPIAcctType><TransactionCount>10</TransactionCount></RequestData></Request>","<Response
> > TransactionID="2"
> >
>
> RequestType="HoldInquiry"><PulledLoans>True</PulledLoans><PulledClosedLoans>False</PulledClosedLoans><PulledInvestments>False</PulledInvestments><PulledClosedInvestments>False</PulledClosedInvestments><PulledCards>False</PulledCards><ShareList>0000',0001,0070,</ShareList></Response>","1967-12-25
> > 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"
>
>
>
> and then a script containing the code you said you used:
>
> > import xml.etree.cElementTree as ElementTree
> > from xml.etree.ElementTree import XMLParser
>
> > Response = 's.csv'
> > with open(Response, 'rU', encoding='utf-8') as data:
> > separated = data.read().split('","')
> > x = ElementTree.XML(separated[3])
> > y = ElementTree.XML(separated[4])
> > print(dict(flatten_dict(x)))
> > print(dict(flatten_dict(y)))
>
>
> I get a completely different error to you, complete with traceback as
> expected:
>
> Traceback (most recent call last):
> File "/tmp/testxml.py", line 9, in <module>
> print(dict(flatten_dict(x)))
> NameError: name 'flatten_dict' is not defined
>
>
> This shows me three things:
>
> (1) The calls to ElementTree.XML work fine, and don't raise an exception;
>
> (2) There is no error message referring to xml.etree.ElementTree.Element or
> the buffer interface;
>
> (3) The code you posted is clearly not the code you actually ran. At the
> very least, it is not *all* the code you ran.
>
> We cannot tell what it wrong with your code if you don't show us the code
> that fails. I suggest you read this webpage:
>
> http://www.sscce.org/
>
> and follow the advice given. It's written for Java, but applies to any
> programming language. Hopefully you will either solve your problem, or be
> able to generate a sufficiently small piece of code that we can work with.
>
>
> You also suggest that your code works when running in a Jupyter Notebook.
> It
> is unlikely (but not impossible!) that exactly the same code will run
> differently when run as a script and when run under Jupyter. More likely,
> there is some difference between the code, something you have written in
> the Notebook but not included in the script.
>
> If it is exactly the same code, then perhaps it is a difference in the two
> environments. Does Jupyter set up the environment differently to what you
> get when running a script?
>
> Finally, in another post, you state:
>
> "That is the only message (*xml.etree.ElementTree.Element' does not support
> the buffer interface"*). There is no traceback."
>
>
> That is very unlikely with the code sample you posted. If true, that gives
> more evidence that you are running code which is different from what you
> have posted here. Perhaps your ACTUAL code (not the pretend code you showed
> us) includes a try...except block like this:
>
> try:
> some code goes here
> except Exception as err:
> print(err)
> sys.exit()
>
>
> or similar. If so, TAKE IT OUT. That is destroying useful debugging
> information and making it more difficult to solve your problem.
>
>
>
>
>
> --
> Steven
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
[toc] | [prev] | [next] | [standalone]
| From | Saran Ahluwalia <ahlusar.ahluwalia@gmail.com> |
|---|---|
| Date | 2016-01-11 16:54 -0500 |
| Message-ID | <mailman.24.1452549315.13488.python-list@python.org> |
| In reply to | #101439 |
Hi Steven:
Just as an update - apparently there were bytes in the Windows Command
Terminal that were interrupting the process execution. I didn't realize
this was happening until I dug around Windows' Q&A forum.
Cheers
On Sun, Jan 10, 2016 at 12:53 PM, Saran Ahluwalia <
ahlusar.ahluwalia@gmail.com> wrote:
> Hi Steven:
>
> The previous code was a stand along under the " if __name__ ==
> '__main__': ". The full function suite that I have made (and indeed
> includes a try and except block):
>
> import os.path
> import sys
> import csv
> from io import StringIO
> import xml.etree.cElementTree as ElementTree
> from xml.etree.ElementTree import XMLParser
> # import xml
> # import xml.sax
> # from xml.sax import ContentHandler
>
>
> def flatten_list(self, aList, prefix=''):
>
> for i, element in enumerate(aList, 1):
> eprefix = "{}{}".format(prefix, i)
> if element:
> # treat like dict
> if len(element) == 1 or element[0].tag != element[1].tag:
> yield from flatten_dict(element, eprefix)
> # treat like list
> elif element[0].tag == element[1].tag:
> yield from flatten_list(element, eprefix)
> elif element.text:
> text = element.text.strip()
> if text:
> yield eprefix[:].rstrip('.'), element.text
>
>
> def flatten_dict(parent_element, prefix=''):
>
> prefix = prefix + parent_element.tag
> if parent_element.items():
> for k, v in parent_element.items():
> yield prefix + k, v
> for element in parent_element:
> eprefix = element.tag
> if element:
> # treat like dict - we assume that if the first two tags
> # in a series are different, then they are all different.
> if len(element) == 1 or element[0].tag != element[1].tag:
> yield from flatten_dict(element, prefix=prefix)
> # treat like list - we assume that if the first two tags
> # in a series are the same, then the rest are the same.
> else:
> # here, we put the list in dictionary; the key is the
> # tag name the list elements all share in common, and
> # the value is the list itself
> yield from flatten_list(element, prefix=eprefix)
> # if the tag has attributes, add those to the dict
> if element.items():
> for k, v in element.items():
> yield eprefix+k
> # this assumes that if you've got an attribute in a tag,
> # you won't be having any text. This may or may not be a
> # good idea -- time will tell. It works for the way we are
> # currently doing XML configuration files...
> elif element.items():
> for k, v in element.items():
> yield eprefix+k
> # finally, if there are no child tags and no attributes, extract
> # the text
> else:
> yield eprefix, element.text
>
>
>
> def just_xml_data(path):
> with open(path, 'rU', encoding='UTF-8') as data:
> separated = data.read().split('","')
> print(separated)
> try:
> x = ElementTree.XML(separated[3])
> print(x)
> xml.etree.ElementTree.dump(x)
> y = ElementTree.XML(separated[4])
> xml.etree.ElementTree.dump(y)
> # response = ElementTree.XML(separated[4]) # work on the
> Response column
> # root = ElementTree.XML(response) #serialize and parse into
> XML object
> except Exception as e:
> print(e)
> else:
> xml_field = dict(flatten_dict(y))
> return xml_field
>
> def read_data(path):
> headers= set()
> rows = []
> with open(path, 'rU', encoding='utf-8') as data:
> reader = csv.DictReader(data, dialect=csv.excel,
> skipinitialspace=True)
> for row in reader:
> xml_field = row["CLIENT_RESP_DATA"]
> # xml_data = just_xml_data(xml_field) ## function
> if xml_data is not None:
> row.update(xml_data)
> headers.update(row.keys())
> rows.append(row)
> else:
> print("Failure")
> pass
> with open(os.path.splitext(textFile)[0] + '_' + 'parsed' + '.csv',
> "wt", newline='') as output_file:
> wr = csv.writer(output_file)
> csv_headers = list(headers)
> wr.writerow(csv_headers)
> for row in rows:
> values = []
> for field in csv_headers:
> value = row.get(field, None)
> values.append(value)
> wr.writerow(values)
> return output_file
>
>
>
> if __name__ == '__main__':
> Response = "s.csv"
> just_xml_data(Response)
>
>
> Hopefully this will provide you with enough information to emulate
> (apologies for any and all indentation errors during the copy and paste).
> FYI - I still receive the same error.
>
>
> On Sun, Jan 10, 2016 at 12:27 PM, Steven D'Aprano <steve@pearwood.info>
> wrote:
>
>> On Mon, 11 Jan 2016 02:04 am, kbtyo wrote:
>>
>> > Hello Everyone:
>> >
>> > I am curious to know why I receive the aforementioned message. I am
>> using
>> > Python 3.4.3 and Windows 7. I am running the following script from
>> Windows
>> > Powershell:
>>
>> I created a file "data" containing the input data you said:
>>
>> > The input data is as follows:
>> >
>> > A,B,C,D,E,F,G,H,I,J
>> > "3","8","1","<Request TransactionID="3"
>> RequestType="FOO"><InstitutionISO
>> > /><CallID>23</CallID><MemberID>12</MemberID><MemberPassword
>> >
>> /><RequestData><AccountNumber>2</AccountNumber><AccountSuffix>85</AccountSuffix><AccountType>S</AccountType><MPIAcctType>Checking</MPIAcctType><TransactionCount>10</TransactionCount></RequestData></Request>","<Response
>> > TransactionID="2"
>> >
>>
>> RequestType="HoldInquiry"><PulledLoans>True</PulledLoans><PulledClosedLoans>False</PulledClosedLoans><PulledInvestments>False</PulledInvestments><PulledClosedInvestments>False</PulledClosedInvestments><PulledCards>False</PulledCards><ShareList>0000',0001,0070,</ShareList></Response>","1967-12-25
>> > 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"
>>
>>
>>
>> and then a script containing the code you said you used:
>>
>> > import xml.etree.cElementTree as ElementTree
>> > from xml.etree.ElementTree import XMLParser
>>
>> > Response = 's.csv'
>> > with open(Response, 'rU', encoding='utf-8') as data:
>> > separated = data.read().split('","')
>> > x = ElementTree.XML(separated[3])
>> > y = ElementTree.XML(separated[4])
>> > print(dict(flatten_dict(x)))
>> > print(dict(flatten_dict(y)))
>>
>>
>> I get a completely different error to you, complete with traceback as
>> expected:
>>
>> Traceback (most recent call last):
>> File "/tmp/testxml.py", line 9, in <module>
>> print(dict(flatten_dict(x)))
>> NameError: name 'flatten_dict' is not defined
>>
>>
>> This shows me three things:
>>
>> (1) The calls to ElementTree.XML work fine, and don't raise an exception;
>>
>> (2) There is no error message referring to xml.etree.ElementTree.Element
>> or
>> the buffer interface;
>>
>> (3) The code you posted is clearly not the code you actually ran. At the
>> very least, it is not *all* the code you ran.
>>
>> We cannot tell what it wrong with your code if you don't show us the code
>> that fails. I suggest you read this webpage:
>>
>> http://www.sscce.org/
>>
>> and follow the advice given. It's written for Java, but applies to any
>> programming language. Hopefully you will either solve your problem, or be
>> able to generate a sufficiently small piece of code that we can work with.
>>
>>
>> You also suggest that your code works when running in a Jupyter Notebook.
>> It
>> is unlikely (but not impossible!) that exactly the same code will run
>> differently when run as a script and when run under Jupyter. More likely,
>> there is some difference between the code, something you have written in
>> the Notebook but not included in the script.
>>
>> If it is exactly the same code, then perhaps it is a difference in the two
>> environments. Does Jupyter set up the environment differently to what you
>> get when running a script?
>>
>> Finally, in another post, you state:
>>
>> "That is the only message (*xml.etree.ElementTree.Element' does not
>> support
>> the buffer interface"*). There is no traceback."
>>
>>
>> That is very unlikely with the code sample you posted. If true, that gives
>> more evidence that you are running code which is different from what you
>> have posted here. Perhaps your ACTUAL code (not the pretend code you
>> showed
>> us) includes a try...except block like this:
>>
>> try:
>> some code goes here
>> except Exception as err:
>> print(err)
>> sys.exit()
>>
>>
>> or similar. If so, TAKE IT OUT. That is destroying useful debugging
>> information and making it more difficult to solve your problem.
>>
>>
>>
>>
>>
>> --
>> Steven
>>
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2016-01-12 12:18 +1100 |
| Message-ID | <56945478$0$1619$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #101494 |
On Tue, 12 Jan 2016 08:54 am, Saran Ahluwalia wrote: > Hi Steven: > > Just as an update - apparently there were bytes in the Windows Command > Terminal that were interrupting the process execution. I didn't realize > this was happening until I dug around Windows' Q&A forum. Thanks for letting us know, I'm glad you've solved your problem to your satisfaction, but now I'm curious as to what sort of bytes in the Windows terminal could cause the symptoms you were seeing. Could you share the link(s) you found that explain this? -- Steven
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web