Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Trac: Users

NameError: global name 'os' is not defined

 

 

Trac users RSS feed   Index | Next | Previous | View Threaded


jordan.padams at gmail

Apr 19, 2012, 1:28 PM

Post #1 of 4 (538 views)
Permalink
NameError: global name 'os' is not defined

I am running Trac 0.12 with the mod_python installation. When trying to
test the installation of the TracWikiToPDF Plugin, when I attempt to create
the PDF, I come across this error:

ERROR: Internal Server Error:
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 513, in
_dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 235, in
dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python2.4/site-packages/trac/admin/web_ui.py", line 121,
in process_request
path_info)
File "build/bdist.linux-i686/egg/wikitopdf/web_ui.py", line 79, in
process_admin_request
File "build/bdist.linux-i686/egg/wikitopdf/formats.py", line 26, in
process_wikitopdf
NameError: global name 'os' is not defined

I am by no means an expert with Trac installations or Python so any help
would be greatly appreciated.

Thanks,
Jordan


--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/csTA17_ApbYJ.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.


Jordan.H.Padams at jpl

Apr 19, 2012, 4:27 PM

Post #2 of 4 (544 views)
Permalink
Re: NameError: global name 'os' is not defined [In reply to]

I actually just got this resolved by the maintainer of the plugin. Apparently this was a bug.

- Jordan

From: Jordan <jordan.padams [at] gmail<mailto:jordan.padams [at] gmail>>
Reply-To: <trac-users [at] googlegroups<mailto:trac-users [at] googlegroups>>
Date: Thu, 19 Apr 2012 13:28:23 -0700
To: <trac-users [at] googlegroups<mailto:trac-users [at] googlegroups>>
Subject: [Trac] NameError: global name 'os' is not defined

I am running Trac 0.12 with the mod_python installation. When trying to test the installation of the TracWikiToPDF Plugin, when I attempt to create the PDF, I come across this error:

ERROR: Internal Server Error:
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 513, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 235, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python2.4/site-packages/trac/admin/web_ui.py", line 121, in process_request
path_info)
File "build/bdist.linux-i686/egg/wikitopdf/web_ui.py", line 79, in process_admin_request
File "build/bdist.linux-i686/egg/wikitopdf/formats.py", line 26, in process_wikitopdf
NameError: global name 'os' is not defined

I am by no means an expert with Trac installations or Python so any help would be greatly appreciated.

Thanks,
Jordan



--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/csTA17_ApbYJ.
To post to this group, send email to trac-users [at] googlegroups<mailto:trac-users [at] googlegroups>.
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups<mailto:trac-users+unsubscribe [at] googlegroups>.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.


benjamin.a.lau at gmail

Apr 19, 2012, 5:54 PM

Post #3 of 4 (525 views)
Permalink
Re: NameError: global name 'os' is not defined [In reply to]

I think rjollos may have gone a bit overboard with cleaning up the
import statements in this plugin...

If you add a line:
import os

to the formats.py file in the plugin sources... that should fix the
problem. I don't know how you installed the plugin... but you'll need
to grab the latest sources from svn, build it and install it again.

svn co http://trac-hacks.org/svn/tracwikitopdfplugin/0.11/ tracwikitopdfplugin
cd tracwikitopdfplugin
python setup.py install
or
python setup.py bdist_egg (the egg will be in the dist directory and
can be copied to you trac environment's plugins directory.

I'll hope that your python is the same one as your one for trac (2.4
based on your logs).

If you run into trouble feel free to pop over to #trac on irc.freenode.net

Ben

On Thu, Apr 19, 2012 at 1:28 PM, Jordan <jordan.padams [at] gmail> wrote:
> I am running Trac 0.12 with the mod_python installation.  When trying to
> test the installation of the TracWikiToPDF Plugin, when I attempt to create
> the PDF, I come across this error:
>
> ERROR: Internal Server Error:
> Traceback (most recent call last):
>   File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 513, in
> _dispatch_request
>     dispatcher.dispatch(req)
>   File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 235, in
> dispatch
>     resp = chosen_handler.process_request(req)
>   File "/usr/lib/python2.4/site-packages/trac/admin/web_ui.py", line 121, in
> process_request
>     path_info)
>   File "build/bdist.linux-i686/egg/wikitopdf/web_ui.py", line 79, in
> process_admin_request
>   File "build/bdist.linux-i686/egg/wikitopdf/formats.py", line 26, in
> process_wikitopdf
> NameError: global name 'os' is not defined
>
> I am by no means an expert with Trac installations or Python so any help
> would be greatly appreciated.
>
> Thanks,
> Jordan
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/trac-users/-/csTA17_ApbYJ.
> To post to this group, send email to trac-users [at] googlegroups
> To unsubscribe from this group, send email to
> trac-users+unsubscribe [at] googlegroups
> For more options, visit this group at
> http://groups.google.com/group/trac-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.


ryano at physiosonics

Apr 20, 2012, 1:50 PM

Post #4 of 4 (517 views)
Permalink
Re: NameError: global name 'os' is not defined [In reply to]

Stupid error on my part. The fear of such as sloppy error advertised
on the mailing list will lead me to be more careful next time ;)

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.

Trac users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.