Bug 12430 - NameError: global name 'strerror' is not defined
: NameError: global name 'strerror' is not defined
Status: RESOLVED FIXED
Product: www2sms
General
: unspecified
: N900 Maemo
: Low minor (vote)
: ---
Assigned To: Bjoern Olausson
: general
:
:
:
:
  Show dependency tree
 
Reported: 2011-09-19 15:15 UTC by Jan Kratochvil
Modified: 2011-10-06 00:09 UTC (History)
1 user (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Jan Kratochvil (reporter) 2011-09-19 15:15:51 UTC
SOFTWARE VERSION: 
20.2010.36-2
 - I have all the testing+devel repositories enabled.
www2sms 1.3.0 armel

EXACT STEPS LEADING TO PROBLEM: 
start by app icon
+
start by: python /opt/www2sms/www2sms.py

EXPECTED OUTCOME: 
Started application.
+
Started application.

ACTUAL OUTCOME:
Nothing happens.
+
~ $ python /opt/www2sms/www2sms.py
Traceback (most recent call last):
  File "/opt/www2sms/www2sms.py", line 629, in <module>
    mk_db()
  File "/opt/www2sms/www2sms.py", line 530, in mk_db
    raise Exception("Failed to create %s. (%s, %s)" %(CONFIG_DIR, errno,
strerror))
NameError: global name 'strerror' is not defined

REPRODUCIBILITY:
Always. 

EXTRA SOFTWARE INSTALLED: 

OTHER COMMENTS:
Comment 1 Bjoern Olausson 2011-09-20 11:27:54 UTC
Yes this is a bug ;-) Thanks for reporting.

The offending line is:

raise Exception("Failed to create %s. (%s, %s)" %(CONFIG_DIR, errno, strerror))


which should read:

raise Exception("Failed to create %s. (%s, %s)" %(CONFIG_DIR, e.errno,
e.strerror))


Despite from the bug, looks like www2sms is unable to create the config dir
(/home/user/MyDocs/www2sms) on your device which is the underlying problem that
triggered the bug in the first place ;-)

Out of Memory? Connect via USB while starting web2sms?

You might want to change the line manually to se what error python throws at
you.
Just add a "e." in front of "errno" and "strerror" in line 530.

Let me know what it tells you then.

Cheers,
Bjoern
Comment 2 Jan Kratochvil (reporter) 2011-09-20 12:05:38 UTC
Thanks, true, I had ~user/MyDocs accidentally owner by root (it is on ext3 fs).

Unfortunately vodafonesmscz no longer works, they now switched to
park.vodafone.cz site.  I will try if I can update it (it is Python, I would
prefer Perl, C or anything else, maybe to execute external CGI-like plugins?).
Comment 3 Bjoern Olausson 2011-09-20 13:34:23 UTC
(In reply to comment #2)
> Thanks, true, I had ~user/MyDocs accidentally owner by root (it is on ext3 fs).
> 
> Unfortunately vodafonesmscz no longer works, they now switched to
> park.vodafone.cz site.  I will try if I can update it (it is Python, I would
> prefer Perl, C or anything else, maybe to execute external CGI-like plugins?).
>

This would mean changes to the core app. It would have to go through the entire
QA process and it would have even more dependencies and third, I don't like
Perl at all ;-)

I'll keep that bug open and fix it if there are more serious bugs popping up.
Since the app is supposed to exit when it can't create the config dir, it does
what it should do - in a way or another ;-)

Please open a new bug for vodafonesmscz.

Cheers,
Bjoern
Comment 4 Jan Kratochvil (reporter) 2011-09-20 15:04:45 UTC
(In reply to comment #3)
> I don't like Perl at all ;-)

This was the reason why I was suggesting making the provider controllers a
standalone separate executable - "the CGI way".
Comment 5 Jan Kratochvil (reporter) 2011-09-20 15:07:46 UTC
(In reply to comment #3)
> Please open a new bug for vodafonesmscz.

https://bugs.maemo.org/show_bug.cgi?id=12432
Comment 6 Bjoern Olausson 2011-10-06 00:09:44 UTC
Fixed in 1.3.1

Will hit devel repo soon.