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


Groups > comp.lang.python > #103117

Re: Weird and sparese cgi:error

Newsgroups comp.lang.python
Date 2016-02-18 06:45 -0800
References <813cd989-bc60-4d24-96ef-f20244d91362@googlegroups.com> <a0be3911-299e-4647-abca-3ed1f7acd453@googlegroups.com>
Message-ID <00242dad-3be0-41cb-b15f-ef31d32f23b8@googlegroups.com> (permalink)
Subject Re: Weird and sparese cgi:error
From Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com>

Show all headers | View raw


#!/usr/bin/python3
# coding=utf-8

import cgitb; cgitb.enable()
import cgi, re, os, sys, socket, time, datetime, locale, codecs, random, smtplib, subprocess, pymysql, geoip2.database
from datetime import datetime, timedelta
from http import cookies
===================

[root@nexus cgi-bin]# /usr/bin/python3 
Python 3.3.2 (default, Aug 14 2014, 14:25:52) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
=============================

[root@nexus cgi-bin]# /usr/bin/python3 ./metrites.py 
Error in sys.excepthook:
ValueError: underlying buffer has been detached

Original exception was:
Traceback (most recent call last):
  File "/opt/rh/python33/root/usr/lib64/python3.3/os.py", line 673, in __getitem__
    value = self._data[self.encodekey(key)]
KeyError: b'HTTP_USER_AGENT'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./metrites.py", line 22, in <module>
    userinfo = os.environ['HTTP_USER_AGENT']
  File "/opt/rh/python33/root/usr/lib64/python3.3/os.py", line 676, in __getitem__
    raise KeyError(key)
KeyError: 'HTTP_USER_AGENT'
[root@nexus cgi-bin]# 
=======================================

everything is they should but still iam gettign that weird cgi:err error

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


Thread

Weird and sparese cgi:error Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> - 2016-02-16 12:02 -0800
  Re: Weird and sparese cgi:error Jeremy Leonard <jrmy.lnrd@gmail.com> - 2016-02-17 05:47 -0800
    Re: Weird and sparese cgi:error Chris Angelico <rosuav@gmail.com> - 2016-02-18 00:53 +1100
      Re: Weird and sparese cgi:error Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> - 2016-02-18 06:47 -0800
    Re: Weird and sparese cgi:error Φώντας Λαδοπρακόπουλος <nikos.gr33k@gmail.com> - 2016-02-18 06:45 -0800

csiph-web