Tom Morton is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

errant / eventscripts-xa

Welcome to the eXtensible Admin bug tracker and code repository. Please report all bugs you may find.

Clone this repository (size: 5.7 MB): HTTPS / SSH
hg clone https://bitbucket.org/errant/eventscripts-xa
hg clone ssh://hg@bitbucket.org/errant/eventscripts-xa

Issues

#68 cfgparser Invalid Syntax

Reported anonymously

#!errorlogs

04/28/10 12:14:20
Traceback (most recent call last):
  File "/srcds/cstrike/addons/eventscripts/es.py", line 339, in loadModuleAddon
    newaddon = __import__(importname)
  File "/srcds/cstrike/addons/eventscripts/xa/xa.py", line 46, in <module>
    import configparser
  File "/srcds/cstrike/addons/eventscripts/xa/configparser.py", line 57
    line = line.replace('\r', '').replace('\n', '').replace('\t', ' ').replace('  ', ' ')replace('"', '\'')[1:].split('\' ', 1)
                                                                                               ^
SyntaxError: invalid syntax


Status: resolved Responsible: Tom Morton Type: bug Priority: major
Milestone: scrum Component: xa-core Version: 1.1.0.x

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 James Y

    written

    this is actually me. I tried that new cfgparser errant and it gave me an invalid syntax

  2. #2 Tom Morton

    written

    • Changed status from new to open.
    • Changed responsible from nobody to errant.

    ah crap, my fault - it's a regression error. Give me a sec (also, thanks for all the help testing and stuff!)

  3. #3 Tom Morton

    written

    • Changed status from open to resolved.

    fixes #68 (regression error introduced in an earlier commit)

    0c0461840643

  4. #4 James Y

    written

    • Changed status from resolved to open.

    04/28/10 13:07:31 Traceback (most recent call last): File "/srcds/cstrike/addons/eventscripts/es.py", line 339, in loadModuleAddon newaddon = import(importname) File "/srcds/cstrike/addons/eventscripts/xa/modules/xasounds/xasounds.py", line 24, in <module> xasoundslist = xasounds.configparser.getAliasList('soundlist.txt') File "/srcds/cstrike/addons/eventscripts/xa/xa.py", line 185, in call return self._xalibfunc(self._xamod, *args, kw) File "/srcds/cstrike/addons/eventscripts/xa/configparser.py", line 57, in getAliasList line = line.translate("\r\n\t ").replace('"', '\'')[1:].split('\' ', 1) ValueError: translation table must be 256 characters long

    04/28/10 13:07:31 Traceback (most recent call last): File "/srcds/cstrike/addons/eventscripts/es.py", line 339, in loadModuleAddon newaddon = import(importname) File "/srcds/cstrike/addons/eventscripts/xa/modules/xaquakesounds/xaquakesounds.py", line 26, in <module> xaquakesoundslist = xaquakesounds.configparser.getAliasList('quakesoundlist.txt') File "/srcds/cstrike/addons/eventscripts/xa/xa.py", line 185, in call return self._xalibfunc(self._xamod, *args, kw) File "/srcds/cstrike/addons/eventscripts/xa/configparser.py", line 57, in getAliasList line = line.translate("\r\n\t ").replace('"', '\'')[1:].split('\' ', 1) ValueError: translation table must be 256 characters long

  5. #5 Tom Morton

    written

    • Changed status from open to resolved.

    blah, that was a mistake. Fixed.

  6. #6 James Y

    written

    :D

  7. #7 James Y

    written , last edited

    • Changed status from resolved to open.

    04/28/10 13:23:38 Traceback (most recent call last): File "/srcds/cstrike/addons/eventscripts/es.py", line 339, in loadModuleAddon newaddon = import(importname) File "/srcds/cstrike/addons/eventscripts/xa/modules/xasounds/xasounds.py", line 24, in <module> xasoundslist = xasounds.configparser.getAliasList('soundlist.txt') File "/srcds/cstrike/addons/eventscripts/xa/xa.py", line 185, in call return self._xalibfunc(self._xamod, *args, kw) File "/srcds/cstrike/addons/eventscripts/xa/configparser.py", line 57, in getAliasList line = line.translate(None,"\r\n\t ").replace('"', '\'')[1:].split('\' ', 1) TypeError: expected a character buffer object

    04/28/10 13:23:38 Traceback (most recent call last): File "/srcds/cstrike/addons/eventscripts/es.py", line 339, in loadModuleAddon newaddon = import(importname) File "/srcds/cstrike/addons/eventscripts/xa/modules/xaquakesounds/xaquakesounds.py", line 26, in <module> xaquakesoundslist = xaquakesounds.configparser.getAliasList('quakesoundlist.txt') File "/srcds/cstrike/addons/eventscripts/xa/xa.py", line 185, in call return self._xalibfunc(self._xamod, *args, kw) File "/srcds/cstrike/addons/eventscripts/xa/configparser.py", line 57, in getAliasList line = line.translate(None,"\r\n\t ").replace('"', '\'')[1:].split('\' ', 1) TypeError: expected a character buffer object

  8. #8 James Y

    written

    • Changed component from nothing to xa-core.
  9. #9 Tom Morton

    written

    I quit being clever (sorry about that) and reverted back to the original snippet of code.

    Should work now... *crosses fingers*

  10. #10 James Y

    written

    • Changed status from open to resolved.

    Fire in the hole!

  11. #11 Steven Hartin

    written

    Just for reference, .strip() strips all those horrible characters anyway.

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?