trentm / eol

a command-line script and Python module for working with text file end-of-line (EOL) characters
Other
17 stars 2 forks source link

python3: NameError: global name 'basestring' is not defined #4

Closed srid closed 13 years ago

srid commented 13 years ago
C:\Users\sridharr> \Python31\Scripts\pypm install eol
The following packages will be installed into "%APPDATA%\Python" (3.1):
 eol-0.7.4
Get: [pypm-be.activestate.com] eol 0.7.4
Installing eol-0.7.4
Fixing script %APPDATA%\Python\Scripts\eol-script.py

C:\Users\sridharr>eol
Traceback (most recent call last):
  File "C:\Users\sridharr\AppData\Roaming\Python\Scripts\eol-script.py", line 9, in <module>
    load_entry_point('eol==0.7.4', 'console_scripts', 'eol')()
  File "C:\Users\sridharr\AppData\Roaming\Python\Python31\site-packages\eol.py", line 719, in main
    excludes=opts.skip):
  File "C:\Users\sridharr\AppData\Roaming\Python\Python31\site-packages\eol.py", line 219, in eol_info_fr
s
    assert not isinstance(path_patterns, basestring), \
NameError: global name 'basestring' is not defined
trentm commented 13 years ago

What does the "five" (or was it "six") Python compat lib use to check if a something is a str or unicode?

srid commented 13 years ago
six.const.string_types
Possible types for text data. This is basestring in Python 2 and str in Python 3.

http://packages.python.org/six/const.html

trentm commented 13 years ago

added test case in 7013bff

trentm commented 13 years ago

fixed in 67e0249 (more test cases too)

After hitting the error above there were a number of other Python 3 failure points. Could still stand tests for more of the API.

trentm commented 13 years ago

in eol 0.7.5 release