rsmills36 / pyftpdlib

Automatically exported from code.google.com/p/pyftpdlib
Other
0 stars 0 forks source link

Test failures with Python 3.1 #256

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Some change between pyftpdlib-1.0.1 and pyftpdlib-1.1.0 has caused some errors 
in test suite with Python 3.1.
In pyftpdlib-1.2.0, there are 28 errors in test_contrib.py and 18 errors in 
test_ftpd.py with Python 3.1.

The attached patch seems to fix these problems.

Original issue reported on code.google.com by Arfrever...@gmail.com on 28 Apr 2013 at 9:31

Attachments:

GoogleCodeExporter commented 9 years ago
Example errors:

======================================================================
ERROR: test_common_methods (__main__.TestDummyAuthorizer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_ftpd.py", line 308, in assertRaisesRegex
    callable_obj(*args, **kwargs)
  File "/tmp/pyftpdlib-1.2.0/pyftpdlib/authorizers.py", line 130, in add_user
    raise ValueError('no such directory: %r' % homedir)
ValueError: no such directory: '?:\\'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test/test_ftpd.py", line 585, in test_common_methods
    auth.add_user, USER, PASSWD, '?:\\')
  File "test/test_ftpd.py", line 312, in assertRaisesRegex
    if isinstance(expected_regexp, basestring):
NameError: global name 'basestring' is not defined

======================================================================
ERROR: test_override_perm_interface (__main__.TestDummyAuthorizer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_ftpd.py", line 308, in assertRaisesRegex
    callable_obj(*args, **kwargs)
  File "/tmp/pyftpdlib-1.2.0/pyftpdlib/authorizers.py", line 168, in override_perm
    raise ValueError('no such directory: %r' % directory)
ValueError: no such directory: '?:\\'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test/test_ftpd.py", line 621, in test_override_perm_interface
    auth.override_perm, USER, '?:\\', 'elr')
  File "test/test_ftpd.py", line 312, in assertRaisesRegex
    if isinstance(expected_regexp, basestring):
NameError: global name 'basestring' is not defined

======================================================================
ERROR: test_anon_auth (__main__.TestFtpAuthentication)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_ftpd.py", line 308, in assertRaisesRegex
    callable_obj(*args, **kwargs)
  File "/usr/lib64/python3.1/ftplib.py", line 380, in login
    if resp[0] == '3': resp = self.sendcmd('PASS ' + passwd)
  File "/usr/lib64/python3.1/ftplib.py", line 246, in sendcmd
    return self.getresp()
  File "/usr/lib64/python3.1/ftplib.py", line 220, in getresp
    raise error_perm(resp)
ftplib.error_perm: 530 Authentication failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test/test_ftpd.py", line 871, in test_anon_auth
    self.assert_auth_failed('AnoNymouS', 'foo')
  File "test/test_ftpd.py", line 862, in assert_auth_failed
    self.client.login, user, passwd)
  File "test/test_ftpd.py", line 312, in assertRaisesRegex
    if isinstance(expected_regexp, basestring):
NameError: global name 'basestring' is not defined

======================================================================

Original comment by Arfrever...@gmail.com on 28 Apr 2013 at 9:34

GoogleCodeExporter commented 9 years ago
I'm going to close this out as by now as I expect it to be outdated, plus I 
doesn't really make sense to target Python 3.1 anymore.

Original comment by g.rodola on 11 Apr 2014 at 9:31