Published in Cloud Security·PinnedCybersecurity Author, Teri RadichelPublications and Presentations by Teri Radichel — Teri Radichel is a professional cybersecurity speaker, trainer, and author. The following are links to some of her past presentations, articles, blog posts, books, and security classes. …Cloud Security4 min read
Published in Bugs That Bite·1 day agoTypeError: cannot unpack non-iterable NoneType objectForgetting to set a python variable or some related problem — Whenever you see NoneType in Python it usually means that something didn’t get set correctly. The other information is somewhat extraneous except possibly “unpack” because it gives you a clue what the program was trying to do, but your line of code will show you that as well. Check your…Nonetype2 min read
Published in Bugs That Bite·2 days agoTypeError: list indices must be integers or slices, not strProblems iterating through and accessing JSON elements with Python — If you get this error while trying to access data in a JSON object check to see whether you are trying to access a list or a dictionary(dict). Python lists look like this: mylist = [“apple”, “banana”, “cherry”] Python list: Python Lists mylist = ["apple", "banana", "cherry"] Lists are used to store multiple items in a single variable. Lists are one of 4…www.w3schools.comJson2 min read
Published in Bugs That Bite·2 days agoambiguous redirect in bashTrying to output the results of a process to a file — This is a very ambiguous error message. You’ll see this error message when you try to output the results of a line of code you’re running to a file. …Bash2 min read
Published in Bugs That Bite·3 days agoUnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x89 in position 1: invalid start byteEncoding and decoding in Python — Encoding and decoding values can get confusing. This sample code might help you out. I named the variables to show whether they were encoded (bytes) or decoded (a string) or base64 encoded or decoded. import base64 value="Decoded string value" value_encode = value.encode('utf-8') value_base64encode = base64.b64encode(value_encode) value_decode = value_base64encode.decode('utf-8')Base 642 min read
Published in Bugs That Bite·3 days agoKeyError: ‘xyz’Error when a key does not exist in json you’re parsing with python — You may be parsing through json with python and trying to print out values like this: jsonfile="data.json" jf = open(jsonfile, "r") j=json.load(jf) items=j['items'] for item in items: v1=item['name1'] v2=item['name2'] One problem that causes this error is when an item in your list of items does not have values for both…Json2 min read
Published in Bugs That Bite·3 days agoSyntaxError: EOL while scanning string literalForgot to close a string with quotes in python — In my case, this error was a on overcomplicated way of saying, “You forgot to close a string with a matching double or single quote.” EOL stands for End of Line. What that means is that the python parser got to the end of a line of code before it…Python2 min read
Published in Bugs That Bite·3 days agoNameError: name ‘xyz’ is not definedTrying to use a variable that doesn’t exist in python — If you try to use a variable in a python statement that hasn’t yet been declared, you’ll get an error that the value is not defined. Simply instantiate the variable to and empty string, 0, True, False, or None depending on what is appropriate for the datatype you’re using above…Python2 min read
Published in Bugs That Bite·3 days agoValueError: too many values to unpack (expected 2)Too many values passed back from a python function — Python differs from some other languages in that you can pass back multiple values from a function. The number of values that you retrieve from a function needs to match the number of values that you return from the function. For example, if you have this function: def funkyfunk(test1, test2…Python2 min read
Published in Bugs That Bite·3 days agoTypeError: expected str, bytes or os.PathLike object, not NoneTypePython error when you fail to set a value — The “not NoneType” is the clue with this error message. The particular function I called in this case is expecting a String (str), bytes (such as a file) or os.PathLike object which is a particular type of object you can instantiate that represents a file path. If you see NoneType…Python2 min read