Earlier this month, Malaysia received the first (the "Tunku Abdul Rahman") of two Scorpene class subs it purchased from France. What was unusual about this was the long voyage the "Tunku Abdul Rahman" had to make to get from France to Malaysia. The voyage was 54 days long, with several stops along the way. Not all 54 days were at sea, but 42 (32 submerged, ten on the surface) were, and that's an extraordinary long voyage (over 10,000 kilometers) for a sub of this size (under 2,000 tons).
These are basically coastal subs, built to defend local waters. In peacetime, these boats rarely stay at sea for more than a week at a time. These boats have only one toilet, and limited fresh water supplies. Thus the sailors got about one shower a week. There is also no proper kitchen, and the crew subsisted on prepared meals, that were boiled before eating (sort of super MREs). Thus, after passing through the Suez Canal, the "Tunku Abdul Rahman" stopped at Jeddah in Saudi Arabia, and then Djibouti. The longest stretch was from there to Cochin (Kochi) in southern India, where there was a three day layover. From there, the boat made the final leg of its voyage straight to Malaysia.
The Scorpene is a modern French-Spanish diesel-electric submarine (a variant uses air-independent propulsion) that displaces 1,700 tons, has a top speed of 37 kilometers per hour, and is armed with six 21-inch torpedo tubes with eighteen torpedoes or SM.39 Exocet anti-ship missiles. Each sub has a crew of 31. The boat is 66 meters (205 feet) long and 6.2 meters (19 feet wide). There are two decks, with the bottom one used for fuel, barriers and stores. Scorpenes are built to handle a 50 day cruise, but that's the max, and it takes a lot out of the crew, and the boat.
In a similar situation, a Swedish Gotland class (1,500 tons, 200 feet long, crew of 25) boat had to travel from Sweden to San Diego, California (via the Panama Canal). Instead of sending the sub across the Atlantic (a nastier stretch of water than the Mediterranean Sea and Indian Ocean), the sub was loaded on a semi-submersible (so the vessel being carried can be "floated" aboard) ship transport, and carried to California. The Gotland stayed there for two years to help train the U.S. Navy to better cope with diesel-electric subs.