This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Error in Windows
Type: behavior Stage: resolved
Components: Windows Versions: Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ben.kummer, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2016-02-15 13:25 by ben.kummer, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit ben.kummer, 2016-02-15 13:25 Code to reproduce the bug
Messages (2)
msg260310 - (view) Author: Ben Kummer (ben.kummer) Date: 2016-02-15 13:25 throws an error in Python2.7.11 Windows

Code snippet:
product_dir ="/zope/eggs43"
my_tuple= os.path.split(product_dir)[:-1]
roduct_prefix = os.path.join(my_tuple )

The same code works in python 2.7.11 under Linux

Traceback (most recent call last):
  File "", line 10, in <module>
  File "", line 7, in main
    product_prefix = os.path.join(my_tuple )
  File "c:\Python27\lib\", line 90, in join
    return result_drive + result_path
TypeError: cannot concatenate 'str' and 'tuple' objects

code to reproduce:

import os

def main():
    product_dir ="/zope/eggs43"
    my_tuple= os.path.split(product_dir)[:-1]
    product_prefix = os.path.join(my_tuple )
if __name__ == "__main__":
msg260311 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-02-15 13:54
The first argument of os.path.join() (as well as all other) in Python 2.7 must be str or unicode. You pass a tuple.
Date User Action Args
2022-04-11 14:58:27adminsetgithub: 70553
2016-02-15 13:54:14serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg260311

resolution: not a bug
stage: resolved
2016-02-15 13:25:05ben.kummercreate