Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError when Author is None #140

Open
TylerGubala opened this issue Aug 31, 2019 · 3 comments
Open

AttributeError when Author is None #140

TylerGubala opened this issue Aug 31, 2019 · 3 comments

Comments

@TylerGubala
Copy link

OS: Windows 10 64bit
Python version: 3.5-32
PySvn version: 0.3.46

When attempting to list files in extended mode (extended=True) or recursively, an exception is thrown when the commit_node.find('author') is None.

Example:

#! /usr/bin/python
# -*- coding: utf-8 -*-
"""Basic example of issue where author nodes not being found breaks svn functionality
"""
from svn.remote import RemoteClient as SvnRepo  
blendersvn = SvnRepo("https://svn.blender.org/svnroot/bf-blender/")

for tag in blendersvn.list_recursive(rel_path="/tags"): 
     print(tag)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\TGubs\Code\Python\bpymaketest\venvs\3.5-32\lib\site-packages\svn\common.py", line 396, in list_recursive
    for entry in self.list(extended=True, rel_path=current_rel_path):
  File "C:\Users\TGubs\Code\Python\bpymaketest\venvs\3.5-32\lib\site-packages\svn\common.py", line 363, in list
    author = commit_node.find('author').text
AttributeError: 'NoneType' object has no attribute 'text'
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""Basic example of issue where author nodes not being found breaks svn functionality
"""
from svn.remote import RemoteClient as SvnRepo  
blendersvn = SvnRepo("https://svn.blender.org/svnroot/bf-blender/")

for tag in blendersvn.list(rel_path="/tags", extended=True): 
     print(tag)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\TGubs\Code\Python\bpymaketest\venvs\3.5-32\lib\site-packages\svn\common.py", line 363, in list
    author = commit_node.find('author').text
AttributeError: 'NoneType' object has no attribute 'text'

Possibly related is a pull request from 2017 and issue #89

@mtHB
Copy link

mtHB commented Nov 23, 2020

I ran into the same problem. Have you found a solution @TylerGubala?

In common.py I added

try:
     author = commit_node.find('author').text
except AttributeError:
     author = None

as a quick fix for me. I am currently not sure what kind of impact this will have but for now its fine I guess...

@TylerGubala
Copy link
Author

TylerGubala commented Nov 23, 2020 via email

@mtHB
Copy link

mtHB commented Dec 10, 2020

@TylerGubala You should not avoid commits where author is None.
While implementing the log_default method by myself I found out that a merge commit does not need a author.
The project I am working on does need an information like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants