Help! AssertionError in Python 3

0 Kristine Birkeland · March 31, 2015
Hi!

Have a minor setback with my code. Because of confidentiality I cant publish the whole code, so forgive me if it is somewhat vague..

I have a variable f = os.path.join(Path, 'Attachements', filename), which looks like this: "D:\Dump\Date_2015 03 31-11 03 42_b'33'\Attachments\TEST.txt"

Path and filename is variables that is generated automaticly.
Then I have a script that contains a test for "assert os.path.isfile(path) or os.path.isdir(path)", among other things. 

Now, if I call this script using this line of code:
- vt.send_files(list_all_files("D:\Dump\Date_2015 03 31-11 03 42_b'33'\Attachments\TEST.txt"))
The code works just fine!

But if i use the variable (which I have to in order for the program to work), like this: 
- vt.send_files(list_all_files(f))
The AssertionError pops up!


Would appreciate if anyone could help me with this one! And again, sorry for the somewhat confusing explaining. Also my first time asking for help so, yes Im a bit newbie at this. 

Post a Reply

Replies

Oldest  Newest  Rating
+1 Kristine Birkeland · April 1, 2015
Well, found the problem. What a coffee break can do..! Just one simple adjustment and it was working smooth as ever. 
0 Colonel Panic · April 3, 2015
That's why the good tech companies have ping pong tables and video games everywhere.  So you can step back and take a break.   I can't tell you how many times I seen someone at work playing Foosball stop and say "OHHHH, Why did I think of that before..... It's so simple.... I'm such an idiot!!!!"  and then run to their desk.
0 Kristine Birkeland · April 9, 2015
Haha indeed! I really need to get my company to invest in such efficient equipment like foosball and pingpong tables :P 
0 Colonel Panic · April 9, 2015
Google Might know something about efficiency. 

/images/forum/upload/2015-04-09/992f5f7faee212cd2856c0f1904a6429.jpg
0 Kristine Birkeland · April 14, 2015
Sweet!
  • 1

Python

107,099 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator