On 03/15/2015 07:01 AM, Peter Otten wrote:
Probably not helpful, but I can provoke the behaviour you see by toggling
bytes with ctypes, thus simulating a corrupted str object:
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for
emile wrote:
> On 03/14/2015 11:24 AM, Peter Otten wrote:
>> emile wrote:
>>
>>> On 03/14/2015 09:08 AM, Peter Otten wrote:
>
Why are you checking
int(decval)
>>>
>>>
>>> because it sure smells like int should work:
>>>
>>> (Pdb) "3">> True
>>
>> That's a normal string comparison w
On Sat, Mar 14, 2015, at 18:09, Cameron Simpson wrote:
> >So there's still something amiss.
>
> Am I missing something obvious here? int() likes only ints, not floats:
What you're missing is that when directly examined in pdb, the value
appeared to be '4', but then when passed to the int construc
On Sun, Mar 15, 2015 at 9:09 AM, Cameron Simpson wrote:
> On 14Mar2015 08:28, Emile van Sebille wrote:
>>
>> It ran almost to completion before generating the error again --
>>
>> (Pdb) decval
>> '4'
>> (Pdb) type(decval)
>>
>> (Pdb) len(decval)
>> 1
>> (Pdb) int(decval)
>> *** ValueError: inval
On 14Mar2015 08:28, Emile van Sebille wrote:
It ran almost to completion before generating the error again --
(Pdb) decval
'4'
(Pdb) type(decval)
(Pdb) len(decval)
1
(Pdb) int(decval)
*** ValueError: invalid literal for int() with base 10: '41.703'
So there's still something amiss
On 03/14/2015 11:24 AM, Peter Otten wrote:
emile wrote:
On 03/14/2015 09:08 AM, Peter Otten wrote:
Why are you checking
int(decval)
because it sure smells like int should work:
(Pdb) "3"
That's a normal string comparison when decval is a string. This and the
ValueError is expected Pyth
emile wrote:
> On 03/14/2015 09:08 AM, Peter Otten wrote:
>> emile wrote:
>>
>>> On 03/13/2015 08:09 PM, Chris Angelico wrote:
On Sat, Mar 14, 2015 at 1:33 PM, Paul Rubin
wrote:
> emile writes:
>> *** NameError: name 'val' is not defined
>> (Pdb) l
>> 139 try:
>
On 03/14/2015 08:52 AM, Chris Angelico wrote:
On Sun, Mar 15, 2015 at 2:28 AM, emile wrote:
It ran almost to completion before generating the error again --
(Pdb) decval
'4'
(Pdb) type(decval)
(Pdb) len(decval)
1
(Pdb) int(decval)
*** ValueError: invalid literal for int() with base 10: '41.70
On 03/14/2015 09:08 AM, Peter Otten wrote:
emile wrote:
On 03/13/2015 08:09 PM, Chris Angelico wrote:
On Sat, Mar 14, 2015 at 1:33 PM, Paul Rubin
wrote:
emile writes:
*** NameError: name 'val' is not defined
(Pdb) l
139 try:
140 val = round(float(decval),1)
141
emile wrote:
> On 03/13/2015 08:09 PM, Chris Angelico wrote:
>> On Sat, Mar 14, 2015 at 1:33 PM, Paul Rubin
>> wrote:
>>> emile writes:
*** NameError: name 'val' is not defined
(Pdb) l
139 try:
140 val = round(float(decval),1)
141 except:
On Sun, Mar 15, 2015 at 2:28 AM, emile wrote:
> It ran almost to completion before generating the error again --
>
> (Pdb) decval
> '4'
> (Pdb) type(decval)
>
> (Pdb) len(decval)
> 1
> (Pdb) int(decval)
> *** ValueError: invalid literal for int() with base 10: '41.703'
>
> So there's
On 03/13/2015 08:09 PM, Chris Angelico wrote:
On Sat, Mar 14, 2015 at 1:33 PM, Paul Rubin wrote:
emile writes:
*** NameError: name 'val' is not defined
(Pdb) l
139 try:
140 val = round(float(decval),1)
141 except:
142 import pdb; pdb.set_trace()
If 'f
On Sat, Mar 14, 2015 at 1:33 PM, Paul Rubin wrote:
> emile writes:
>> *** NameError: name 'val' is not defined
>> (Pdb) l
>> 139 try:
>> 140 val = round(float(decval),1)
>> 141 except:
>> 142 import pdb; pdb.set_trace()
>
> If 'float' or 'round' throw an ex
emile writes:
> *** NameError: name 'val' is not defined
> (Pdb) l
> 139 try:
> 140 val = round(float(decval),1)
> 141 except:
> 142 import pdb; pdb.set_trace()
If 'float' or 'round' throw an exception, the assignment to 'val' never
happens, so 'val' is und
On 03/13/2015 03:14 PM, Chris Angelico wrote:
On Sat, Mar 14, 2015 at 9:10 AM, emile wrote:
(Pdb) decval
'4'
(Pdb) len(decval)
1
(Pdb) int(decval)
*** ValueError: invalid literal for int() with base 10: '41.703'
(Pdb)
Any ideas?
What's type(decval) tell you? I suspect you may ha
On Sat, Mar 14, 2015 at 9:10 AM, emile wrote:
> (Pdb) decval
> '4'
> (Pdb) len(decval)
> 1
> (Pdb) int(decval)
> *** ValueError: invalid literal for int() with base 10: '41.703'
> (Pdb)
>
>
> Any ideas?
What's type(decval) tell you? I suspect you may have something other
than a string
On an older WinXP SP2 box with python2.6 that's been running this
process fine for years, this week we're seeing:
> c:\python26\lib\site-packages\fenx\sql_interface.py(144)normalized()
-> return val
(Pdb) val
*** NameError: name 'val' is not defined
(Pdb) l
139 try:
140 val =
17 matches
Mail list logo